CompanyWxUserController.java 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.fs.wxuser;
  2. import java.util.List;
  3. import com.fs.wxUser.domain.CompanyWxUser;
  4. import com.fs.wxUser.service.ICompanyWxUserService;
  5. import org.springframework.security.access.prepost.PreAuthorize;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.PutMapping;
  10. import org.springframework.web.bind.annotation.DeleteMapping;
  11. import org.springframework.web.bind.annotation.PathVariable;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import com.fs.common.annotation.Log;
  16. import com.fs.common.core.controller.BaseController;
  17. import com.fs.common.core.domain.AjaxResult;
  18. import com.fs.common.enums.BusinessType;
  19. import com.fs.common.utils.poi.ExcelUtil;
  20. import com.fs.common.core.page.TableDataInfo;
  21. /**
  22. * 【个微管理】Controller
  23. *
  24. * @author fs
  25. * @date 2025-03-28
  26. */
  27. @RestController
  28. @RequestMapping("/company/wxuser")
  29. public class CompanyWxUserController extends BaseController
  30. {
  31. @Autowired
  32. private ICompanyWxUserService companyWxUserService;
  33. /**
  34. * 查询【个微管理】列表
  35. */
  36. @GetMapping("/list")
  37. public TableDataInfo list(CompanyWxUser companyWxUser)
  38. {
  39. startPage();
  40. List<CompanyWxUser> list = companyWxUserService.selectCompanyWxUserList(companyWxUser);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出【个微管理】列表
  45. */
  46. @Log(title = "【个微管理】", businessType = BusinessType.EXPORT)
  47. @GetMapping("/export")
  48. public AjaxResult export(CompanyWxUser companyWxUser)
  49. {
  50. List<CompanyWxUser> list = companyWxUserService.selectCompanyWxUserList(companyWxUser);
  51. ExcelUtil<CompanyWxUser> util = new ExcelUtil<CompanyWxUser>(CompanyWxUser.class);
  52. return util.exportExcel(list, "user");
  53. }
  54. /**
  55. * 获取【个微管理】详细信息
  56. */
  57. @GetMapping(value = "/{userId}")
  58. public AjaxResult getInfo(@PathVariable("userId") Long userId)
  59. {
  60. return AjaxResult.success(companyWxUserService.selectCompanyWxUserByUserId(userId));
  61. }
  62. /**
  63. * 新增【个微管理】
  64. */
  65. @Log(title = "【个微管理】", businessType = BusinessType.INSERT)
  66. @PostMapping
  67. public AjaxResult add(@RequestBody CompanyWxUser companyWxUser)
  68. {
  69. return toAjax(companyWxUserService.insertCompanyWxUser(companyWxUser));
  70. }
  71. /**
  72. * 修改【个微管理】
  73. */
  74. @Log(title = "【个微管理】", businessType = BusinessType.UPDATE)
  75. @PutMapping
  76. public AjaxResult edit(@RequestBody CompanyWxUser companyWxUser)
  77. {
  78. return toAjax(companyWxUserService.updateCompanyWxUser(companyWxUser));
  79. }
  80. /**
  81. * 删除【个微管理】
  82. */
  83. @Log(title = "【个微管理】", businessType = BusinessType.DELETE)
  84. @DeleteMapping("/{userIds}")
  85. public AjaxResult remove(@PathVariable Long[] userIds)
  86. {
  87. return toAjax(companyWxUserService.deleteCompanyWxUserByUserIds(userIds));
  88. }
  89. }