xuhy
2025-09-28 454558a053c1dcf864686f9fe642c8a6ae12d058
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.ruoyi.web.controller.api;
 
 
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.TAppUser;
import com.ruoyi.system.service.TAppUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 人员管理 前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2025-09-28
 */
@Api(tags = "人员管理")
@RestController
@RequestMapping("/t-app-user")
public class TAppUserController {
 
    private final TAppUserService appUserService;
    private final TokenService tokenService;
    @Autowired
    public TAppUserController(TAppUserService appUserService, TokenService tokenService) {
        this.appUserService = appUserService;
        this.tokenService = tokenService;
    }
 
    /**
     * 添加人员管理管理管理
     */
    @ApiOperation(value = "添加人员管理",response = TAppUser.class)
    @PostMapping(value = "/api/t-equipment/add")
    public R<Boolean> add(@RequestBody String param) {
        TAppUser dto = JSON.parseObject(param,TAppUser.class);
        appUserService.save(dto);
        return R.ok();
    }
 
    /**
     * 查看人员管理详情
     */
    @ApiOperation(value = "查看人员管理详情")
    @GetMapping(value = "/open/t-equipment/getDetailById")
    public R<TAppUser> getDetailById() {
        String userId = tokenService.getLoginUserApplet().getUserId();
        TAppUser appUser = appUserService.getById(userId);
        return R.ok(appUser);
    }
 
}