MrShi
2025-08-21 d98b610bd0793dd5d29f623400a1d0a81bb55334
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
package com.doumee.api.web;
 
import com.doumee.config.wx.TransferToUser;
import com.doumee.core.annotation.LoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.IdentityInfo;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.MemberRevenue;
import com.doumee.dao.dto.WithdrawalDTO;
import com.doumee.dao.dto.WxPhoneRequest;
import com.doumee.dao.vo.AccountResponse;
import com.doumee.dao.vo.UserCenterVO;
import com.doumee.service.business.IdentityInfoService;
import com.doumee.service.business.MemberRevenueService;
import com.doumee.service.business.MemberService;
import com.doumee.service.business.WithdrawalOrdersService;
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.apache.shiro.authz.annotation.RequiresPermissions;
import org.checkerframework.checker.units.qual.A;
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;
 
    @Autowired
    private MemberRevenueService memberRevenueService;
 
    @Autowired
    private WithdrawalOrdersService withdrawalOrdersService;
 
 
    @ApiOperation(value = "获取系统配置", notes = "小程序端")
    @GetMapping("/getPlatformAboutUs")
    public ApiResponse<UserCenterVO> getPlatformAboutUs() {
        return  ApiResponse.success("查询成功",memberService.getPlatformAboutUs());
    }
 
 
    @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("操作成功");
    }
 
    @LoginRequired
    @ApiOperation("余额明细")
    @PostMapping("/revenuePage")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<PageData<MemberRevenue>> revenuePage (@RequestBody PageWrap<MemberRevenue> pageWrap) {
        pageWrap.getModel().setMemberId(this.getMemberId());
        return ApiResponse.success(memberRevenueService.findPage(pageWrap));
    }
 
    @LoginRequired
    @ApiOperation("提现申请")
    @PostMapping("/applyWithdrawal")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<TransferToUser.TransferToUserResponse> applyWithdrawal (@RequestBody WithdrawalDTO withdrawalDTO) {
        withdrawalDTO.setMember(this.getMemberResponse());
        return ApiResponse.success("操作成功",withdrawalOrdersService.applyWithdrawal(withdrawalDTO));
    }
 
 
 
    @LoginRequired
    @ApiOperation("撤销提现申请")
    @PostMapping("/cancelTransfer")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse cancelTransfer (@RequestBody TransferToUser.CancelTransferRequest request) {
        withdrawalOrdersService.cancelTransfer(request);
        return ApiResponse.success("操作成功");
    }
 
 
}