jiangping
2025-07-15 c4bd6e7e1fadfac44466d589ee4d5dfcf77c2a59
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package com.doumee.api.web;
 
import com.doumee.core.annotation.LoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.IdentityInfo;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.dto.WxPhoneRequest;
import com.doumee.dao.vo.AccountResponse;
import com.doumee.service.business.IdentityInfoService;
import com.doumee.service.business.MemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/7/10 9:29
 */
@Api(tags = "2、用户信息")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/user")
@Slf4j
public class UserApi extends  ApiController{
 
 
    @Autowired
    private MemberService memberService;
 
    @Autowired
    private IdentityInfoService identityInfoService;
 
    @LoginRequired
    @ApiOperation(value = "编辑个人信息", notes = "小程序端")
    @GetMapping("/getMemberInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<Member> getMemberInfo() {
        return  ApiResponse.success("查询成功",memberService.getMemberInfo(getMemberId()));
    }
 
 
    @LoginRequired
    @ApiOperation(value = "编辑个人信息", notes = "小程序端")
    @PostMapping("/editMemberInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse editMemberInfo(@RequestBody Member member) {
        member.setId(getMemberId());
        memberService.editMemberInfo(member);
        return  ApiResponse.success("操作成功");
    }
 
    @LoginRequired
    @ApiOperation(value = "切换用工身份", notes = "小程序端")
    @PostMapping("/editUseIdentity")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse editUseIdentity(@RequestBody Member member) {
        member.setId(getMemberId());
        memberService.editUseIdentity(member);
        return  ApiResponse.success("操作成功");
    }
 
 
 
    @LoginRequired
    @ApiOperation(value = "获取身份认证信息", notes = "小程序端")
    @GetMapping("/getIdentityInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<IdentityInfo> getIdentityInfo(@RequestParam Integer type) {
        return  ApiResponse.success("查询成功",identityInfoService.findByMemberType(type,getMemberId()));
    }
 
 
    @LoginRequired
    @ApiOperation(value = "申请身份信息", notes = "小程序端")
    @PostMapping("/applyForIdentity")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse applyForIdentity(@RequestBody IdentityInfo identityInfo) {
        identityInfo.setMemberId(getMemberId());
        identityInfoService.create(identityInfo);
        return  ApiResponse.success("操作成功");
    }
 
 
 
    @LoginRequired
    @ApiOperation(value = "修改身份信息(认证失败后使用)", notes = "小程序端")
    @PostMapping("/updateIdentity")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse updateIdentity(@RequestBody IdentityInfo identityInfo) {
        identityInfo.setMemberId(getMemberId());
        identityInfoService.updateById(identityInfo);
        return  ApiResponse.success("操作成功");
    }
 
 
    @LoginRequired
    @ApiOperation(value = "修改身份信息位置(认证成功后使用)", notes = "小程序端")
    @PostMapping("/updateLocation")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse updateLocation(@RequestBody IdentityInfo identityInfo) {
        identityInfo.setMemberId(getMemberId());
        identityInfoService.updateLocation(identityInfo);
        return  ApiResponse.success("操作成功");
    }
 
}