| | |
| | | * @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) { |
| | |
| | | * 模式类型 1:简单模式-正常模式 2:困难模式 |
| | | */ |
| | | private Integer modelType; |
| | | /** |
| | | * 是否允许创建群聊 1:可以 0:不可以 |
| | | */ |
| | | private Integer createGroup; |
| | | |
| | | |
| | | } |
| | |
| | | void updateAutoSendByGroupId(@Param("id")String id, @Param("autoSend")int i); |
| | | |
| | | IPage<AdminRedBagVo> selectRedBagListInPage(Page<AdminRedBagVo> page, @Param("record")ChatUser chatUser); |
| | | |
| | | void updateCreateGroupByUserId(@Param("userId")String userId, @Param("createGroup")int i); |
| | | } |
| | |
| | | FebsResponse closeSwitchAutoSend(String id); |
| | | |
| | | IPage<AdminRedBagVo> getRedBagList(ChatUser chatUser, QueryRequest request); |
| | | |
| | | FebsResponse openCreateGroup(String userId); |
| | | |
| | | FebsResponse closeCreateGroup(String userId); |
| | | } |
| | |
| | | Page<AdminRedBagVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.baseMapper.selectRedBagListInPage(page, chatUser); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse openCreateGroup(String userId) { |
| | | ChatUser chatUser = this.baseMapper.selectByUserId(userId); |
| | | if(ObjectUtil.isEmpty(chatUser)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | this.baseMapper.updateCreateGroupByUserId(userId,2); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse closeCreateGroup(String userId) { |
| | | ChatUser chatUser = this.baseMapper.selectByUserId(userId); |
| | | if(ObjectUtil.isEmpty(chatUser)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | this.baseMapper.updateCreateGroupByUserId(userId,2); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |
| | |
| | | * 模式类型 1:简单模式-正常模式 2:困难模式 |
| | | */ |
| | | private Integer modelType; |
| | | /** |
| | | * 是否允许创建群聊 1:可以 0:不可以 |
| | | */ |
| | | private Integer createGroup; |
| | | } |
| | |
| | | a.nick_name nickName, |
| | | a.chat_no chatNo, |
| | | a.model_type modelType, |
| | | a.create_group createGroup, |
| | | a.phone phone, |
| | | a.status status, |
| | | a.invite_id inviteId, |
| | |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | <update id="updateCreateGroupByUserId"> |
| | | update chat_user |
| | | set |
| | | create_group = #{createGroup} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <input type="checkbox" value={{d.userId}} lay-text="简单模式|困难模式" lay-skin="switch" lay-filter="switchModelType"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchCreateGroup"> |
| | | {{# if(d.createGroup === 1) { }} |
| | | <input type="checkbox" value={{d.userId}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchCreateGroup"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.userId}} lay-text="是|否" lay-skin="switch" lay-filter="switchCreateGroup"> |
| | | {{# } }} |
| | | </script> |
| | | <style> |
| | | .layui-form-onswitch { |
| | | background-color: #5FB878 !important; |
| | |
| | | {field: 'status', title: '账号状态', templet: '#switchStatus', minWidth: 80,align:'center'}, |
| | | {field: 'isRobot', title: '机器人', templet: '#switchIsRobot', minWidth: 80,align:'center'}, |
| | | {field: 'modelType', title: '模式', templet: '#switchModelType', minWidth: 80,align:'center'}, |
| | | {field: 'createGroup', title: '允许建群', templet: '#switchCreateGroup', minWidth: 80,align:'center'}, |
| | | {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | ]] |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchCreateGroup)', function (data) { |
| | | if (data.elem.checked) { |
| | | openCreateGroup(data.value); |
| | | } else { |
| | | closeCreateGroup(data.value); |
| | | } |
| | | }) |
| | | function openCreateGroup(userId) { |
| | | febs.get(ctx + 'admin/chat/openCreateGroup/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function closeCreateGroup(userId) { |
| | | febs.get(ctx + 'admin/chat/closeCreateGroup/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchModelType)', function (data) { |
| | | if (data.elem.checked) { |
| | | openModelType(data.value); |