|
- using SafeCampus.Application.Services.Business.BuildingService;
- using SafeCampus.Application.Services.Business.CameraInfoService;
-
- namespace SafeCampus.Web.Core.Controllers.Application.Business;
- /// <summary>
- /// 宿舍楼管理接口
- /// </summary>
- [ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 87, Tag = "宿舍楼管理")]
- [Route("/business/building")]
- [RolePermission]
- public class BuildingController
- {
- private readonly IBuildingService _buildingService;
- private readonly ICameraInfoService _cameraInfoService;
-
- public BuildingController(IBuildingService buildingService, ICameraInfoService cameraInfoService)
- {
- _buildingService = buildingService;
- _cameraInfoService = cameraInfoService;
- }
-
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="input">添加参数</param>
- /// <returns></returns>
- public async Task<bool> Add(BuildingInfoDto input)
- {
- return await _buildingService.Add(input);
- }
-
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="input">添加参数</param>
- /// <returns></returns>
- public async Task<bool> Update(BuildingInfoDto input)
- {
- return await _buildingService.Update(input);
- }
-
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="id">id</param>
- /// <returns></returns>
- public async Task<bool> Delete(long id)
- {
- return await _buildingService.Delete(id);
- }
-
- /// <summary>
- /// 获取列表
- /// </summary>
- /// <returns></returns>
- public async Task<List<BuildingInfoDto>> GetNoPageList()
- {
- return await _buildingService.GetNoPageList();
- }
- /// <summary>
- /// 获取未被宿舍楼使用的摄像头
- /// </summary>
- /// <returns></returns>
- public async Task<List<CameraInfoDto>> GetBuildCameraList()
- {
- var list =await _buildingService.GetUseCameraList();
- var camera = await _cameraInfoService.GetBuildCameraList(list);
- return camera;
- }
- }
|