xiaoyong931011
2023-10-11 63a12d1eaaea08d7573e2788156adb7976a8a32d
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package cc.mrbird.febs.mall.controller;
 
import cc.mrbird.febs.common.annotation.ControllerEndpoint;
import cc.mrbird.febs.common.controller.BaseController;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.common.enumerates.DataDictionaryEnum;
import cc.mrbird.febs.mall.dto.*;
import cc.mrbird.febs.mall.entity.ChatUser;
import cc.mrbird.febs.mall.entity.MallMember;
import cc.mrbird.febs.mall.service.IAdminChatService;
import cc.mrbird.febs.mall.vo.AdminGroupInfoVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Map;
 
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/admin/chat")
public class AdminChatController extends BaseController {
 
    @Resource
    private IAdminChatService iAdminChatService;
 
    /**
     * 用户列表
     *
     * @param chatUser
     * @param request
     * @return
     */
    @GetMapping("getUserList")
    public FebsResponse getUserList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getUserList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 用户列表---开启
     *
     * @param userId
     * @return
     */
    @GetMapping("openAccount/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openAccount(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.openAccount(userId);
    }
    /**
     * 用户列表---关闭
     *
     * @param userId
     * @return
     */
    @GetMapping("closeAccount/{userId}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeAccount(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.closeAccount(userId);
    }
 
    /**
     * 是否是机器人---开启
     *
     * @param userId
     * @return
     */
    @GetMapping("openSwitchIsRobot/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openSwitchIsRobot(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.openSwitchIsRobot(userId);
    }
    /**
     * 是否是机器人---关闭
     *
     * @param userId
     * @return
     */
    @GetMapping("closeSwitchIsRobot/{userId}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeSwitchIsRobot(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.closeSwitchIsRobot(userId);
    }
 
    /**
     * 用户列表-系统拨付
     */
    @PostMapping("updateSystemPay")
    @ControllerEndpoint(operation = "会员列表-系统拨付", exceptionMessage = "操作失败")
    public FebsResponse updateSystemPay(@Valid AdminSystemPayDto adminSystemPayDto) {
        return iAdminChatService.updateSystemPay(adminSystemPayDto);
    }
 
    /**
     * 资金流水
     */
    @GetMapping("getFlowList")
    public FebsResponse getFlowList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getFlowList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 会员充值
     */
    @GetMapping("getChargeList")
    public FebsResponse getChargeList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getChargeList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 会员提现
     */
    @GetMapping("getWithdrawList")
    public FebsResponse getWithdrawList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getWithdrawList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 会员提现-同意
     *
     * @param id
     * @return
     */
    @GetMapping("agreeEvent/{id}")
    @ControllerEndpoint(operation = "会员提现-同意", exceptionMessage = "操作失败")
    public FebsResponse agreeEvent(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.agreeEvent(id);
    }
 
    /**
     * 会员提现-拒绝
     *
     * @param id
     * @return
     */
    @GetMapping("disagreeEvent/{id}")
    @ControllerEndpoint(operation = "会员提现-拒绝", exceptionMessage = "操作失败")
    public FebsResponse disagreeEvent(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.disagreeEvent(id);
    }
 
    @PostMapping(value = "/basicSetting")
    public FebsResponse basicSetting(AdminBasicSettingDto adminBasicSettingDto) {
        iAdminChatService.updateDataDic(
                DataDictionaryEnum.MODEL_TYPE.getType(),
                DataDictionaryEnum.MODEL_TYPE.getCode(),
                adminBasicSettingDto.getModelType());
        return new FebsResponse().success();
    }
 
    /**
     * 会员充值
     */
    @GetMapping("groupList")
    public FebsResponse groupList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getGroupList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 使用机器人---开启
     *
     * @param id
     * @return
     */
    @GetMapping("openSwitchUseRobot/{id}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openSwitchUseRobot(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.openSwitchUseRobot(id);
    }
    /**
     * 使用机器人---关闭
     *
     * @param id
     * @return
     */
    @GetMapping("closeSwitchUseRobot/{id}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeSwitchUseRobot(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.closeSwitchUseRobot(id);
    }
 
    /**
     * 群组管理-更新
     */
    @PostMapping("updateGroupInfo")
    @ControllerEndpoint(operation = "新闻中心-更新", exceptionMessage = "操作失败")
    public FebsResponse updateGroupInfo(AdminGroupInfoVo adminGroupInfoVo) {
        return iAdminChatService.updateGroupInfo(adminGroupInfoVo);
    }
    /**
     * 添加会员
     */
    @GetMapping("registerMember/")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse registerMember() {
        return iAdminChatService.registerMember();
    }
}