|
|
@@ -1,19 +1,31 @@
|
|
|
package com.zsElectric.boot.business.controller.applet;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.zsElectric.boot.business.model.entity.UserFeedback;
|
|
|
import com.zsElectric.boot.business.model.form.UserFeedbackForm;
|
|
|
import com.zsElectric.boot.business.model.form.applet.AppFeedbackForm;
|
|
|
+import com.zsElectric.boot.business.model.query.CouponQuery;
|
|
|
+import com.zsElectric.boot.business.model.query.CouponTemplateQuery;
|
|
|
+import com.zsElectric.boot.business.model.query.applet.AppCouponQuery;
|
|
|
import com.zsElectric.boot.business.model.query.applet.AppUserOrderInfoQuery;
|
|
|
+import com.zsElectric.boot.business.model.vo.CouponTemplateVO;
|
|
|
+import com.zsElectric.boot.business.model.vo.CouponVO;
|
|
|
+import com.zsElectric.boot.business.model.vo.applet.AppCouponStatusNumVO;
|
|
|
import com.zsElectric.boot.business.model.vo.applet.AppletUserInfoVO;
|
|
|
+import com.zsElectric.boot.business.service.CouponService;
|
|
|
+import com.zsElectric.boot.business.service.CouponTemplateService;
|
|
|
import com.zsElectric.boot.business.service.UserFeedbackService;
|
|
|
import com.zsElectric.boot.business.service.UserInfoService;
|
|
|
+import com.zsElectric.boot.common.constant.SystemConstants;
|
|
|
+import com.zsElectric.boot.core.web.PageResult;
|
|
|
import com.zsElectric.boot.core.web.Result;
|
|
|
import com.zsElectric.boot.security.util.SecurityUtils;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.validation.Valid;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -28,6 +40,10 @@ public class AppletUserController {
|
|
|
|
|
|
private final UserFeedbackService userFeedbackService;
|
|
|
|
|
|
+ private final CouponService couponService;
|
|
|
+
|
|
|
+ private final CouponTemplateService couponTemplateService;
|
|
|
+
|
|
|
@Operation(summary = "微信小程序获取当前登录信息")
|
|
|
@GetMapping("/getUserInfo")
|
|
|
public Result<AppletUserInfoVO> getUserInfo() {
|
|
|
@@ -54,4 +70,27 @@ public class AppletUserController {
|
|
|
List<UserFeedback> list = userFeedbackService.list(Wrappers.<UserFeedback>lambdaQuery().eq(UserFeedback::getUserId, SecurityUtils.getUserId()));
|
|
|
return Result.success(list);
|
|
|
}
|
|
|
+
|
|
|
+ @Operation(summary = "个人优惠券列表")
|
|
|
+ @PostMapping("/getCouponPage")
|
|
|
+ public Result<IPage<CouponVO>> getCouponPage(@RequestBody AppCouponQuery queryParams) {
|
|
|
+ IPage<CouponVO> result = couponService.getUserCouponPage(queryParams);
|
|
|
+ return Result.success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "获取个人优惠券数量")
|
|
|
+ @GetMapping("/getCouponStatusNum")
|
|
|
+ public Result<AppCouponStatusNumVO> getCouponStatusNum() {
|
|
|
+ AppCouponStatusNumVO result = couponService.getCouponStatusNum(SecurityUtils.getUserId());
|
|
|
+ return Result.success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "待领取优惠券列表")
|
|
|
+ @GetMapping("/getCouponTemplatePage")
|
|
|
+ public Result<IPage<CouponTemplateVO>> getAppCouponTemplatePage() {
|
|
|
+ CouponTemplateQuery CouponTemplateQuery = new CouponTemplateQuery();
|
|
|
+ CouponTemplateQuery.setStatus(SystemConstants.STATUS_ONE);
|
|
|
+ IPage<CouponTemplateVO> result = couponTemplateService.getCouponTemplatePage(CouponTemplateQuery);
|
|
|
+ return Result.success(result);
|
|
|
+ }
|
|
|
}
|