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

79 lines
2.0 KiB

  1. using SafeCampus.Application.Services.Business.DepartmentService;
  2. namespace SafeCampus.Web.Core.Controllers.Application.Business;
  3. /// <summary>
  4. ///系部管理接口
  5. /// </summary>
  6. [ApiDescriptionSettings(ApiGroupConsts.SYSTEM_Business, Order = 83, Tag = "系部管理")]
  7. [Route("/business/department")]
  8. [RolePermission]
  9. public class DepartmentController
  10. {
  11. private readonly IDepartmentService _departmentService;
  12. public DepartmentController(IDepartmentService departmentService)
  13. {
  14. _departmentService = departmentService;
  15. }
  16. /// <summary>
  17. /// 添加
  18. /// </summary>
  19. /// <param name="input">添加参数</param>
  20. /// <returns></returns>
  21. public async Task<bool> Add(DepartmentDto input)
  22. {
  23. return await _departmentService.Add(input);
  24. }
  25. /// <summary>
  26. /// 修改
  27. /// </summary>
  28. /// <param name="input">添加参数</param>
  29. /// <returns></returns>
  30. public async Task<bool> Update(DepartmentDto input)
  31. {
  32. return await _departmentService.Update(input);
  33. }
  34. /// <summary>
  35. /// 获取详情
  36. /// </summary>
  37. /// <param name="id"></param>
  38. /// <returns></returns>
  39. public async Task<DepartmentDto> GetInfo(long id)
  40. {
  41. return await _departmentService.GetInfo(id);
  42. }
  43. /// <summary>
  44. /// 删除
  45. /// </summary>
  46. /// <param name="id">id</param>
  47. /// <returns></returns>
  48. [HttpPost]
  49. public async Task<bool> Delete(BaseIdListInput id)
  50. {
  51. return await _departmentService.Delete(id.Ids);
  52. }
  53. /// <summary>
  54. /// 获取列表
  55. /// </summary>
  56. /// <returns></returns>
  57. public async Task<SqlSugarPagedList<DepartmentDto>> GetPageList(DepartmentSearch search)
  58. {
  59. return await _departmentService.GetPageList(search);
  60. }
  61. /// <summary>
  62. /// 不分页获取列表
  63. /// </summary>
  64. /// <param name="search"></param>
  65. /// <returns></returns>
  66. public async Task<List<DepartmentDto>> GetNoPageList(DepartmentSearch search)
  67. {
  68. return await _departmentService.GetNoPageList(search);
  69. }
  70. }