UserArchivesController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package com.goafanti.customer.controller;
  2. import com.goafanti.common.bo.Result;
  3. import com.goafanti.common.controller.BaseController;
  4. import com.goafanti.common.model.UserArchives;
  5. import com.goafanti.customer.service.UserArchivesService;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import javax.annotation.Resource;
  11. /**
  12. * 客户档案表(UserArchives)表控制层
  13. *
  14. * @author makejava
  15. * @since 2024-07-12 11:52:01
  16. */
  17. @RestController
  18. @RequestMapping("/api/admin/userArchives")
  19. public class UserArchivesController extends BaseController {
  20. /**
  21. * 服务对象
  22. */
  23. @Resource
  24. private UserArchivesService userArchivesService;
  25. /**
  26. * 新增数据
  27. *
  28. * @param userArchives 实体
  29. * @return 新增结果
  30. */
  31. @PostMapping("/add")
  32. public Result add(UserArchives userArchives) {
  33. return new Result<>().data(this.userArchivesService.insert(userArchives));
  34. }
  35. /**
  36. * 通过主键查询单条数据
  37. *
  38. * @param id 主键
  39. * @return 单条数据
  40. */
  41. @GetMapping("/get")
  42. public Result<UserArchives> queryById( Integer id) {
  43. return new Result<>().data(this.userArchivesService.queryById(id));
  44. }
  45. /**
  46. * 编辑用户档案数据
  47. *
  48. * @param userArchives 实体
  49. * @return 编辑结果
  50. */
  51. @PostMapping("/update")
  52. public Result edit(UserArchives userArchives) {
  53. return new Result<>().data(this.userArchivesService.update(userArchives));
  54. }
  55. /**
  56. * 删除数据
  57. *
  58. * @param id 主键
  59. * @return 删除是否成功
  60. */
  61. @GetMapping("/delete")
  62. public Result deleteById(Integer id) {
  63. return new Result<>().data(this.userArchivesService.deleteById(id));
  64. }
  65. /**
  66. * 列表查询
  67. * @param in 参数
  68. */
  69. @GetMapping("/list")
  70. public Result<UserArchives> list(UserArchives in, Integer pageNo, Integer pageSize) {
  71. return new Result<>().data(this.userArchivesService.list(in, pageNo, pageSize));
  72. }
  73. /**
  74. * 查询企业档案
  75. *
  76. * @param id 主键
  77. * @return 单条数据
  78. */
  79. @GetMapping("/queryByUid")
  80. public Result<UserArchives> queryByUid( String id) {
  81. return new Result<>().data(this.userArchivesService.queryByUid(id));
  82. }
  83. /**
  84. * 微信查询查询企业其他信息与档案信息
  85. *
  86. * @param id 主键
  87. * @return 单条数据
  88. */
  89. @GetMapping("/queryByUidAll")
  90. public Result queryByUidAll( String id) {
  91. Result res = new Result<>();
  92. if (userArchivesService.checkPermission(id)){
  93. res.error(buildError("查看超时,请要分享人重新分享。"));
  94. return res;
  95. }
  96. res.data(this.userArchivesService.queryByUidAll(id));
  97. return res;
  98. }
  99. }