瀏覽代碼

增加学生端,老师端优惠券接口定义

Eric 3 年之前
父節點
當前提交
c3909f9e85

+ 3 - 3
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/coupon/CouponInfoController.java

@@ -3,19 +3,19 @@ package com.yonge.cooleshow.admin.controller.coupon;
 
 import com.yonge.cooleshow.admin.io.request.coupon.CouponInfoVO;
 import com.yonge.cooleshow.biz.dal.service.CouponInfoService;
+import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.toolset.base.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.validation.Valid;
@@ -31,7 +31,7 @@ import javax.validation.Valid;
 @Controller
 @RequestMapping("/couponInfo")
 @Api(value = "优惠券信息", tags = "优惠券信息")
-public class CouponInfoController {
+public class CouponInfoController extends BaseController {
 
     @Autowired
     private CouponInfoService couponInfoService;

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CouponIssue.java

@@ -27,7 +27,7 @@ public class CouponIssue implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty("会员记录id")
+    @ApiModelProperty("发放ID")
     @TableId(value = "id_", type = IdType.AUTO)
     private Long id;
 
@@ -47,6 +47,10 @@ public class CouponIssue implements Serializable {
     @TableField("use_state_")
     private String useState;
 
+    @ApiModelProperty("使用时间")
+    @TableField("use_time_")
+    private Long useTime;
+
     @ApiModelProperty("订单编号")
     @TableField("order_no_")
     private Long orderNo;

+ 2 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponIssueMapper.xml

@@ -9,6 +9,7 @@
         <result column="coupon_id_" property="couponId" />
         <result column="client_type_" property="clientType" />
         <result column="use_state_" property="useState" />
+        <result column="use_time_" property="useTime" />
         <result column="order_no_" property="orderNo" />
         <result column="start_time_" property="startTime" />
         <result column="end_time_" property="endTime" />
@@ -22,7 +23,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id_, user_id_, coupon_id_, client_type_, use_state_, order_no_, start_time_, end_time_, issue_way_, issuer_, issue_time_, remark_, status_, created_time_
+        id_, user_id_, coupon_id_, client_type_, use_state_, use_time_, order_no_, start_time_, end_time_, issue_way_, issuer_, issue_time_, remark_, status_, created_time_
     </sql>
 
 </mapper>

+ 34 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/coupon/CouponInfoController.java

@@ -0,0 +1,34 @@
+package com.yonge.cooleshow.student.controller.coupon;
+
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.student.io.request.CouponInfoVO;
+import com.yonge.toolset.base.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * 优惠券信息
+ * Created by Eric.Shang on 2022/9/2.
+ */
+@Controller
+@RequestMapping("/couponInfo")
+@Api(value = "优惠券信息", tags = "优惠券信息")
+public class CouponInfoController extends BaseController {
+
+    /**
+     * 优惠券信息
+     * @param request CouponInfoVO.RequestInfo
+     * @return HttpResponseResult<PageInfo<CouponInfoVO.ResponseInfo>>
+     */
+    @PostMapping("/page")
+    @ApiOperation(value = "查询优惠券分页", notes = "传入CouponInfoVO.PageRequest")
+    public HttpResponseResult<PageInfo<CouponInfoVO.CouponPageInfo>> queryCouponPageInfo(@RequestBody CouponInfoVO.PageRequest request) {
+
+        return null;
+    }
+}

+ 87 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/io/request/CouponInfoVO.java

@@ -0,0 +1,87 @@
+package com.yonge.cooleshow.student.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 优惠券信息
+ * Created by Eric.Shang on 2022/9/2.
+ */
+public class CouponInfoVO {
+
+    /**
+     * 优惠券分页请求信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(value = "优惠券信息分页请求", description = "优惠券信息分页")
+    public static class PageRequest extends QueryInfo {
+
+        @ApiModelProperty("客户类型")
+        private String clientType;
+        @ApiModelProperty("优惠券类型")
+        private String couponType;
+        @ApiModelProperty("使用状态")
+        private String useState;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+    }
+
+    /**
+     * 优惠券分页响应数据
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(value = "优惠券信息分页信息", description = "优惠券信息分页信息")
+    public static class CouponPageInfo implements Serializable {
+
+        @ApiModelProperty("优惠券ID")
+        private Long id;
+
+        @ApiModelProperty("优惠券名称")
+        private String name;
+
+        @ApiModelProperty("客户端类型")
+        private String clientType;
+
+        @ApiModelProperty("优惠券类型")
+        private String couponType;
+
+        @ApiModelProperty("使用门槛")
+        private BigDecimal useLimit;
+
+        @ApiModelProperty("优惠金额")
+        private BigDecimal discountPrice;
+
+        @ApiModelProperty("用户ID")
+        private Long userId;
+
+        @ApiModelProperty("优惠券ID")
+        private Long couponId;
+
+        @ApiModelProperty("使用状态")
+        private String useState;
+
+        @ApiModelProperty("使用时间")
+        private Long useTime;
+
+        @ApiModelProperty("生效时间")
+        private Long startTime;
+
+        @ApiModelProperty("失效时间")
+        private Long endTime;
+    }
+
+}

+ 34 - 0
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/coupon/CouponInfoController.java

@@ -0,0 +1,34 @@
+package com.yonge.cooleshow.teacher.controller.coupon;
+
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.teacher.io.request.CouponInfoVO;
+import com.yonge.toolset.base.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * 优惠券信息
+ * Created by Eric.Shang on 2022/9/2.
+ */
+@Controller
+@RequestMapping("/couponInfo")
+@Api(value = "优惠券信息", tags = "优惠券信息")
+public class CouponInfoController extends BaseController {
+
+    /**
+     * 优惠券信息
+     * @param request CouponInfoVO.RequestInfo
+     * @return HttpResponseResult<PageInfo<CouponInfoVO.ResponseInfo>>
+     */
+    @PostMapping("/page")
+    @ApiOperation(value = "查询优惠券分页", notes = "传入CouponInfoVO.PageRequest")
+    public HttpResponseResult<PageInfo<CouponInfoVO.CouponPageInfo>> queryCouponPageInfo(@RequestBody CouponInfoVO.PageRequest request) {
+
+        return null;
+    }
+}

+ 87 - 0
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/io/request/CouponInfoVO.java

@@ -0,0 +1,87 @@
+package com.yonge.cooleshow.teacher.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 优惠券信息
+ * Created by Eric.Shang on 2022/9/2.
+ */
+public class CouponInfoVO {
+
+    /**
+     * 优惠券分页请求信息
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(value = "优惠券信息分页请求", description = "优惠券信息分页")
+    public static class PageRequest extends QueryInfo {
+
+        @ApiModelProperty("客户类型")
+        private String clientType;
+        @ApiModelProperty("优惠券类型")
+        private String couponType;
+        @ApiModelProperty("使用状态")
+        private String useState;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+    }
+
+    /**
+     * 优惠券分页响应数据
+     */
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(value = "优惠券信息分页信息", description = "优惠券信息分页信息")
+    public static class CouponPageInfo implements Serializable {
+
+        @ApiModelProperty("优惠券ID")
+        private Long id;
+
+        @ApiModelProperty("优惠券名称")
+        private String name;
+
+        @ApiModelProperty("客户端类型")
+        private String clientType;
+
+        @ApiModelProperty("优惠券类型")
+        private String couponType;
+
+        @ApiModelProperty("使用门槛")
+        private BigDecimal useLimit;
+
+        @ApiModelProperty("优惠金额")
+        private BigDecimal discountPrice;
+
+        @ApiModelProperty("用户ID")
+        private Long userId;
+
+        @ApiModelProperty("优惠券ID")
+        private Long couponId;
+
+        @ApiModelProperty("使用状态")
+        private String useState;
+
+        @ApiModelProperty("使用时间")
+        private Long useTime;
+
+        @ApiModelProperty("生效时间")
+        private Long startTime;
+
+        @ApiModelProperty("失效时间")
+        private Long endTime;
+    }
+
+}