feat: 会员和邀请添加swagger注解
parent
f77029ead8
commit
b2a3596f20
|
@ -14,6 +14,8 @@ import com.mcwl.memberCenter.service.MemberLevelService;
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -26,6 +28,7 @@ import java.util.Optional;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("member")
|
@RequestMapping("member")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberController {
|
public class MemberController {
|
||||||
|
|
||||||
private final MemberService memberService;
|
private final MemberService memberService;
|
||||||
|
@ -76,6 +79,7 @@ public class MemberController {
|
||||||
* @return 积分余额和历史记录
|
* @return 积分余额和历史记录
|
||||||
*/
|
*/
|
||||||
@GetMapping("getPoints")
|
@GetMapping("getPoints")
|
||||||
|
@ApiOperation(value = "获取积分余额和历史记录")
|
||||||
public AjaxResult getPoints() {
|
public AjaxResult getPoints() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
@ -103,6 +107,7 @@ public class MemberController {
|
||||||
* 会员积分充值
|
* 会员积分充值
|
||||||
*/
|
*/
|
||||||
@PostMapping("rechargePoints")
|
@PostMapping("rechargePoints")
|
||||||
|
@ApiOperation(value = "会员积分充值")
|
||||||
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||||
Long userId = rechargePointsDto.getUserId();
|
Long userId = rechargePointsDto.getUserId();
|
||||||
Double amount = rechargePointsDto.getAmount();
|
Double amount = rechargePointsDto.getAmount();
|
||||||
|
@ -129,6 +134,7 @@ public class MemberController {
|
||||||
* 消费积分
|
* 消费积分
|
||||||
*/
|
*/
|
||||||
@GetMapping("consumePoints/{consumePoints}")
|
@GetMapping("consumePoints/{consumePoints}")
|
||||||
|
@ApiOperation(value = "消费积分")
|
||||||
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
||||||
|
|
||||||
if (consumePoints == null || consumePoints <= 0) {
|
if (consumePoints == null || consumePoints <= 0) {
|
||||||
|
@ -145,6 +151,7 @@ public class MemberController {
|
||||||
* 根据会员等级和活动计算支付金额
|
* 根据会员等级和活动计算支付金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calculatePayment")
|
@GetMapping("calculatePayment")
|
||||||
|
@ApiOperation(value = "根据会员等级和活动计算支付金额")
|
||||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||||
Double unitPrice = memberLevel.getUnitPrice();
|
Double unitPrice = memberLevel.getUnitPrice();
|
||||||
|
@ -156,6 +163,7 @@ public class MemberController {
|
||||||
* 是否是会员
|
* 是否是会员
|
||||||
*/
|
*/
|
||||||
@GetMapping("isMember")
|
@GetMapping("isMember")
|
||||||
|
@ApiOperation(value = "是否是会员")
|
||||||
public AjaxResult isMember() {
|
public AjaxResult isMember() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.mcwl.memberCenter.domain.MemberLevel;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -17,6 +19,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("memberLevel")
|
@RequestMapping("memberLevel")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberLevelController {
|
public class MemberLevelController {
|
||||||
|
|
||||||
private final MemberLevelService memberLevelService;
|
private final MemberLevelService memberLevelService;
|
||||||
|
@ -29,6 +32,7 @@ public class MemberLevelController {
|
||||||
* @return 会员等级列表
|
* @return 会员等级列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
|
@ApiOperation(value = "获取会员等级列表")
|
||||||
public AjaxResult list() {
|
public AjaxResult list() {
|
||||||
|
|
||||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
List<MemberLevel> memberLevelList = memberLevelService.list();
|
||||||
|
@ -41,6 +45,7 @@ public class MemberLevelController {
|
||||||
* 获取会员等级及权益列表
|
* 获取会员等级及权益列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("getMemberBenefitList")
|
@GetMapping("getMemberBenefitList")
|
||||||
|
@ApiOperation(value = "获取会员等级及权益列表")
|
||||||
public AjaxResult getMemberBenefitList() {
|
public AjaxResult getMemberBenefitList() {
|
||||||
|
|
||||||
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
||||||
|
|
|
@ -14,6 +14,8 @@ import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
import com.mcwl.memberCenter.service.PromotionService;
|
import com.mcwl.memberCenter.service.PromotionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@ import java.util.Optional;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("promotion")
|
@RequestMapping("promotion")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class PromotionController {
|
public class PromotionController {
|
||||||
|
|
||||||
private final PromotionService promotionService;
|
private final PromotionService promotionService;
|
||||||
|
@ -42,6 +45,7 @@ public class PromotionController {
|
||||||
* 创建活动
|
* 创建活动
|
||||||
*/
|
*/
|
||||||
@PostMapping("createPromotion")
|
@PostMapping("createPromotion")
|
||||||
|
@ApiOperation(value = "创建活动")
|
||||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||||
|
|
||||||
Date startTime = promotionDto.getStartTime();
|
Date startTime = promotionDto.getStartTime();
|
||||||
|
@ -63,6 +67,7 @@ public class PromotionController {
|
||||||
* 活动列表
|
* 活动列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("promotionList")
|
@GetMapping("promotionList")
|
||||||
|
@ApiOperation(value = "活动列表")
|
||||||
public AjaxResult promotionList() {
|
public AjaxResult promotionList() {
|
||||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
List<Promotion> promotionList = promotionService.lambdaQuery()
|
||||||
.gt(Promotion::getEndTime, new Date())
|
.gt(Promotion::getEndTime, new Date())
|
||||||
|
@ -74,6 +79,7 @@ public class PromotionController {
|
||||||
* 获取当前用户参与的活动
|
* 获取当前用户参与的活动
|
||||||
*/
|
*/
|
||||||
@GetMapping("myPromotionList")
|
@GetMapping("myPromotionList")
|
||||||
|
@ApiOperation(value = "获取当前用户参与的活动")
|
||||||
public AjaxResult myPromotionList() {
|
public AjaxResult myPromotionList() {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
@ -87,6 +93,7 @@ public class PromotionController {
|
||||||
* 参与活动
|
* 参与活动
|
||||||
*/
|
*/
|
||||||
@PostMapping("joinPromotion")
|
@PostMapping("joinPromotion")
|
||||||
|
@ApiOperation(value = "参与活动")
|
||||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
||||||
// 用户id
|
// 用户id
|
||||||
Long userId = joinPromotionDto.getUserId();
|
Long userId = joinPromotionDto.getUserId();
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.mcwl.myInvitation.domain.Invitation;
|
||||||
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
||||||
import com.mcwl.myInvitation.service.InvitationService;
|
import com.mcwl.myInvitation.service.InvitationService;
|
||||||
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -26,6 +28,7 @@ import static com.mcwl.common.core.domain.AjaxResult.success;
|
||||||
@RestController()
|
@RestController()
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/invitation")
|
@RequestMapping("/invitation")
|
||||||
|
@Api(tags = "邀请管理")
|
||||||
public class InvitationController {
|
public class InvitationController {
|
||||||
|
|
||||||
private final InvitationService invitationService;
|
private final InvitationService invitationService;
|
||||||
|
@ -37,6 +40,7 @@ public class InvitationController {
|
||||||
* @return 邀请码
|
* @return 邀请码
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getInvitationCode")
|
@GetMapping("/getInvitationCode")
|
||||||
|
@ApiOperation(value = "获取邀请码")
|
||||||
public AjaxResult getInvitationCode() {
|
public AjaxResult getInvitationCode() {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
@ -55,6 +59,7 @@ public class InvitationController {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping("/list/{userId}")
|
@GetMapping("/list/{userId}")
|
||||||
|
@ApiOperation(value = "获取邀请列表")
|
||||||
public AjaxResult list(@PathVariable Long userId) {
|
public AjaxResult list(@PathVariable Long userId) {
|
||||||
List<Invitation> list = invitationService.lambdaQuery()
|
List<Invitation> list = invitationService.lambdaQuery()
|
||||||
.eq(Invitation::getUserId, userId)
|
.eq(Invitation::getUserId, userId)
|
||||||
|
@ -67,6 +72,7 @@ public class InvitationController {
|
||||||
* 邀请人收益展示
|
* 邀请人收益展示
|
||||||
*/
|
*/
|
||||||
@GetMapping("earningsDisplay")
|
@GetMapping("earningsDisplay")
|
||||||
|
@ApiOperation(value = "邀请人收益展示")
|
||||||
public AjaxResult earningsDisplay() {
|
public AjaxResult earningsDisplay() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue