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 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("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);
|
}
|
|
/**
|
* 使用机器人---开启
|
*
|
* @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);
|
}
|
/**
|
* 添加会员
|
*/
|
@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);
|
}
|
}
|