|
|
|
@ -8,7 +8,9 @@ import com.luoo.user.pojo.MembershipCode;
|
|
|
|
|
import com.luoo.user.service.MembershipCodeService;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -36,12 +38,14 @@ public class MembershipController extends BaseController {
|
|
|
|
|
@GetMapping("/code/generate")
|
|
|
|
|
@GlobalInterceptor(checkAdminLogin = true)
|
|
|
|
|
@ApiImplicitParams(value = {
|
|
|
|
|
@ApiImplicitParam(name = "duration", value = "会员时长(天)", required = true, dataType = "Integer", paramType = "query")
|
|
|
|
|
@ApiImplicitParam(name = "duration", value = "会员时长(天)", required = true, dataType = "Integer", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "life", value = "是否永久会员 1-是 2-否", required = true, dataType = "Integer", paramType = "query")
|
|
|
|
|
})
|
|
|
|
|
public Result<String> generateMembershipCode(
|
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@NotNull Integer duration) {
|
|
|
|
|
return Result.success(membershipCodeService.generateMembershipCode(authorization, duration));
|
|
|
|
|
@NotNull Integer duration,
|
|
|
|
|
@NotNull Integer life) {
|
|
|
|
|
return Result.success(membershipCodeService.generateMembershipCode(authorization, duration, life));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "1.1 批量生成会员码", notes = "仅限admin权限用户调用")
|
|
|
|
@ -49,14 +53,16 @@ public class MembershipController extends BaseController {
|
|
|
|
|
@GlobalInterceptor(checkAdminLogin = true)
|
|
|
|
|
@ApiImplicitParams(value = {
|
|
|
|
|
@ApiImplicitParam(name = "duration", value = "会员时长(天)", required = true, dataType = "Integer", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "count", value = "生成数量", required = true, dataType = "Integer", paramType = "query")
|
|
|
|
|
@ApiImplicitParam(name = "count", value = "生成数量", required = true, dataType = "Integer", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "life", value = "是否永久会员 1-是 2-否", required = true, dataType = "Integer", paramType = "query")
|
|
|
|
|
})
|
|
|
|
|
public Result<List<String>> generateMembershipCodeBatch(
|
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@NotNull Integer duration,
|
|
|
|
|
@NotNull Integer count) {
|
|
|
|
|
@NotNull Integer count,
|
|
|
|
|
@NotNull Integer life) {
|
|
|
|
|
List<String> list = membershipCodeService.generateMembershipCodeBatch(authorization,
|
|
|
|
|
duration, count);
|
|
|
|
|
duration, count, life);
|
|
|
|
|
return Result.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -75,7 +81,7 @@ public class MembershipController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "3.查询会员码", notes = "仅限admin权限用户调用")
|
|
|
|
|
@GetMapping("/code/list")
|
|
|
|
|
@GetMapping("/code/list{page}/{size}")
|
|
|
|
|
@GlobalInterceptor(checkAdminLogin = true)
|
|
|
|
|
public Result<PageResult<MembershipCode>> queryMembershipCode(
|
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|