| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- package com.goafanti.customer.controller;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.controller.BaseController;
- import com.goafanti.common.model.UserArchives;
- import com.goafanti.customer.service.UserArchivesService;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import javax.annotation.Resource;
- /**
- * 客户档案表(UserArchives)表控制层
- *
- * @author makejava
- * @since 2024-07-12 11:52:01
- */
- @RestController
- @RequestMapping("/api/admin/userArchives")
- public class UserArchivesController extends BaseController {
- /**
- * 服务对象
- */
- @Resource
- private UserArchivesService userArchivesService;
- /**
- * 新增数据
- *
- * @param userArchives 实体
- * @return 新增结果
- */
- @PostMapping("/add")
- public Result add(UserArchives userArchives) {
- return new Result<>().data(this.userArchivesService.insert(userArchives));
- }
-
-
- /**
- * 通过主键查询单条数据
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("/get")
- public Result<UserArchives> queryById( Integer id) {
- return new Result<>().data(this.userArchivesService.queryById(id));
- }
- /**
- * 编辑用户档案数据
- *
- * @param userArchives 实体
- * @return 编辑结果
- */
- @PostMapping("/update")
- public Result edit(UserArchives userArchives) {
- return new Result<>().data(this.userArchivesService.update(userArchives));
- }
- /**
- * 删除数据
- *
- * @param id 主键
- * @return 删除是否成功
- */
- @GetMapping("/delete")
- public Result deleteById(Integer id) {
- return new Result<>().data(this.userArchivesService.deleteById(id));
- }
-
- /**
- * 列表查询
- * @param in 参数
- */
- @GetMapping("/list")
- public Result<UserArchives> list(UserArchives in, Integer pageNo, Integer pageSize) {
- return new Result<>().data(this.userArchivesService.list(in, pageNo, pageSize));
- }
- /**
- * 查询企业档案
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("/queryByUid")
- public Result<UserArchives> queryByUid( String id) {
- return new Result<>().data(this.userArchivesService.queryByUid(id));
- }
- /**
- * 微信查询查询企业其他信息与档案信息
- *
- * @param id 主键
- * @return 单条数据
- */
- @GetMapping("/queryByUidAll")
- public Result queryByUidAll( String id) {
- Result res = new Result<>();
- if (userArchivesService.checkPermission(id)){
- res.error(buildError("查看超时,请要分享人重新分享。"));
- return res;
- }
- res.data(this.userArchivesService.queryByUidAll(id));
- return res;
- }
- }
|