平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BuildingController.cs 2.0 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using SafeCampus.Application.Services.Business.BuildingService;
  2. using SafeCampus.Application.Services.Business.CameraInfoService;
  3. namespace SafeCampus.Web.Core.Controllers.Application.Business;
  4. /// <summary>
  5. /// 宿舍楼管理接口
  6. /// </summary>
  7. [ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 87, Tag = "宿舍楼管理")]
  8. [Route("/business/building")]
  9. [RolePermission]
  10. public class BuildingController
  11. {
  12. private readonly IBuildingService _buildingService;
  13. private readonly ICameraInfoService _cameraInfoService;
  14. public BuildingController(IBuildingService buildingService, ICameraInfoService cameraInfoService)
  15. {
  16. _buildingService = buildingService;
  17. _cameraInfoService = cameraInfoService;
  18. }
  19. /// <summary>
  20. /// 添加
  21. /// </summary>
  22. /// <param name="input">添加参数</param>
  23. /// <returns></returns>
  24. public async Task<bool> Add(BuildingInfoDto input)
  25. {
  26. return await _buildingService.Add(input);
  27. }
  28. /// <summary>
  29. /// 修改
  30. /// </summary>
  31. /// <param name="input">添加参数</param>
  32. /// <returns></returns>
  33. public async Task<bool> Update(BuildingInfoDto input)
  34. {
  35. return await _buildingService.Update(input);
  36. }
  37. /// <summary>
  38. /// 删除
  39. /// </summary>
  40. /// <param name="id">id</param>
  41. /// <returns></returns>
  42. public async Task<bool> Delete(long id)
  43. {
  44. return await _buildingService.Delete(id);
  45. }
  46. /// <summary>
  47. /// 获取列表
  48. /// </summary>
  49. /// <returns></returns>
  50. public async Task<List<BuildingInfoDto>> GetNoPageList()
  51. {
  52. return await _buildingService.GetNoPageList();
  53. }
  54. /// <summary>
  55. /// 获取未被宿舍楼使用的摄像头
  56. /// </summary>
  57. /// <returns></returns>
  58. public async Task<List<CameraInfoDto>> GetBuildCameraList()
  59. {
  60. var list =await _buildingService.GetUseCameraList();
  61. var camera = await _cameraInfoService.GetBuildCameraList(list);
  62. return camera;
  63. }
  64. }