平安校园
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.
 
 
 
 
 
 

59 lines
1.6 KiB

  1. using SafeCampus.Application.Services.Business.CameraGroupService;
  2. namespace SafeCampus.Web.Core.Controllers.Application.Business;
  3. /// <summary>
  4. /// 摄像头分组管理接口
  5. /// </summary>
  6. [ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 90, Tag = "摄像头分组管理")]
  7. [Route("/business/cameraGroup")]
  8. [RolePermission]
  9. public class CameraGroupController
  10. {
  11. private readonly ICameraGroupService _cameraGroupService;
  12. public CameraGroupController(ICameraGroupService cameraGroupService)
  13. {
  14. _cameraGroupService = cameraGroupService;
  15. }
  16. /// <summary>
  17. /// 添加分组
  18. /// </summary>
  19. /// <param name="input">添加参数</param>
  20. /// <returns></returns>
  21. public Task<bool> Add(CameraGroupAddInput input)
  22. {
  23. return _cameraGroupService.Add(input);
  24. }
  25. /// <summary>
  26. /// 修改分组
  27. /// </summary>
  28. /// <param name="input">添加参数</param>
  29. /// <returns></returns>
  30. public Task<bool> Update(CameraGroupInput input)
  31. {
  32. return _cameraGroupService.Update(input);
  33. }
  34. /// <summary>
  35. /// 删除分组
  36. /// </summary>
  37. /// <param name="id">id</param>
  38. /// <returns></returns>
  39. public Task<bool> Delete(long id)
  40. {
  41. return _cameraGroupService.Delete(id);
  42. }
  43. /// <summary>
  44. /// 获取分组列表
  45. /// </summary>
  46. /// <returns></returns>
  47. public async Task<List<CameraGroup>> GetNoPageList()
  48. {
  49. var list =await _cameraGroupService.GetNoPageList();
  50. list.Insert(0, new CameraGroup { Name = "无分组", Id = -1 });
  51. return list;
  52. }
  53. }