1.app角色升级功能
2.sys_user表新增字段
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.njcn.user.controller.app;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.user.service.IAppRoleService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/25 18:30
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appRole")
|
||||
@Api(tags = "App角色管理")
|
||||
@AllArgsConstructor
|
||||
public class AppRoleController extends BaseController {
|
||||
|
||||
private final IAppRoleService appRoleService;
|
||||
|
||||
/**
|
||||
* app用户角色升级
|
||||
*/
|
||||
@PostMapping("/roleUpdate")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "角色升级", notes = "角色升级")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "referralCode", value = "推荐码", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||
})
|
||||
public HttpResult<String> roleUpdate(@Param("userId")String userId,@Param("referralCode")String referralCode,@Param("devCode")String devCode) {
|
||||
String methodDescribe = getMethodDescribe("roleUpdate");
|
||||
appRoleService.roleUpdate(userId,referralCode,devCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.njcn.user.controller.app;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.user.pojo.vo.app.RoleReferralCodeVO;
|
||||
import com.njcn.user.service.IReferralCodeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/6/25 16:13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/referralCode")
|
||||
@Api(tags = "推荐码管理")
|
||||
@AllArgsConstructor
|
||||
public class ReferralCodeController extends BaseController {
|
||||
|
||||
private final IReferralCodeService referralCodeService;
|
||||
|
||||
|
||||
/**
|
||||
* 查看角色推荐码
|
||||
* 1.用完就生成新的推荐码
|
||||
* 2.规定时间内失效,重新生成推荐码
|
||||
*/
|
||||
@PostMapping("findReferralCode")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "查看角色推荐码", notes = "生成角色推荐码")
|
||||
public HttpResult<List<RoleReferralCodeVO>> findReferralCode() {
|
||||
String methodDescribe = getMethodDescribe("findReferralCode");
|
||||
List<RoleReferralCodeVO> list = referralCodeService.findReferralCode();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新角色推荐码
|
||||
* 1.重新生成推荐码
|
||||
*/
|
||||
@PostMapping("refreshReferralCode")
|
||||
@OperateInfo
|
||||
@ApiOperation(value = "刷新角色推荐码", notes = "刷新角色推荐码")
|
||||
public HttpResult<List<RoleReferralCodeVO>> refreshReferralCode() {
|
||||
String methodDescribe = getMethodDescribe("refreshReferralCode");
|
||||
List<RoleReferralCodeVO> list = referralCodeService.refreshReferralCode();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user