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

DepartmentController.cs 2.0 KiB

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