xiaoyong931011
2023-10-23 df998a061e22b13297e02eee97e2418e4bbeaa1a
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
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 cc.mrbird.febs.mall.vo.AdminRegisterMemberVo;
import cc.mrbird.febs.mall.vo.AdminVersionVo;
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("openCreateGroup/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openCreateGroup(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.openCreateGroup(userId);
    }
    /**
     * 用户列表---关闭
     *
     * @param userId
     * @return
     */
    @GetMapping("closeCreateGroup/{userId}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeCreateGroup(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.closeCreateGroup(userId);
    }
 
    /**
     * 用户列表---开启
     *
     * @param userId
     * @return
     */
    @GetMapping("openModelType/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openModelType(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.openModelType(userId);
    }
    /**
     * 用户列表---关闭
     *
     * @param userId
     * @return
     */
    @GetMapping("closeModelType/{userId}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeModelType(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.closeModelType(userId);
    }
 
    /**
     * 用户列表---开启
     *
     * @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);
    }
 
    /**
     * 版本管理
     */
    @GetMapping("versionTable")
    public FebsResponse versionTable(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getVersionList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 使用机器人---开启
     *
     * @param id
     * @return
     */
    @GetMapping("openSwitchAutoSend/{id}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openSwitchAutoSend(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.openSwitchAutoSend(id);
    }
    /**
     * 使用机器人---关闭
     *
     * @param id
     * @return
     */
    @GetMapping("closeSwitchAutoSend/{id}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeSwitchAutoSend(@NotNull(message = "{required}") @PathVariable String id) {
        return iAdminChatService.closeSwitchAutoSend(id);
    }
 
    /**
     * 使用机器人---开启
     *
     * @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);
    }
 
    /**
     * 版本管理-更新
     */
    @PostMapping("updateVersionInfo")
    @ControllerEndpoint(operation = "版本管理-更新", exceptionMessage = "操作失败")
    public FebsResponse updateVersionInfo(AdminVersionVo adminVersionVo) {
        return iAdminChatService.updateVersionInfo(adminVersionVo);
    }
    /**
     * 添加会员
     */
    @GetMapping("registerMember/")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse registerMember() {
        return iAdminChatService.registerMember();
    }
 
    /**
     * 用户列表-添加会员
     */
    @PostMapping("updateRegisterMember")
    @ControllerEndpoint(operation = "会员列表-添加会员", exceptionMessage = "操作失败")
    public FebsResponse updateRegisterMember(@Valid AdminRegisterMemberVo adminRegisterMemberVo) {
        return iAdminChatService.updateRegisterMember(adminRegisterMemberVo);
    }
 
    /**
     * 红包列表
     */
    @GetMapping("redBagList")
    public FebsResponse redBagList(ChatUser chatUser, QueryRequest request) {
        Map<String, Object> data = getDataTable(iAdminChatService.getRedBagList(chatUser, request));
        return new FebsResponse().success().data(data);
    }
}