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