Browse Source

订单接口添加

小么熊🐻 2 years ago
parent
commit
4ef7a79c87

+ 58 - 0
jsjp-admin/src/main/java/com/miaxis/app/controller/order/OrderInfoController.java

@@ -0,0 +1,58 @@
+package com.miaxis.app.controller.order;
+
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.order.domain.OrderInfo;
+import com.miaxis.order.service.IOrderInfoService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【订单信息】Controller
+ *
+ * @author miaxis
+ * @date 2022-06-07
+ */
+@RestController
+@RequestMapping(Constants.OPEN_PREFIX+"/order/info")
+@Api(tags={"【APP-订单信息】"})
+public class OrderInfoController extends BaseController{
+    @Autowired
+    private IOrderInfoService orderInfoService;
+
+    /**
+     * 查询订单信息列表
+     */
+    @GetMapping("/list")
+    @ApiOperation("查询订单信息列表")
+        @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<OrderInfo> list(@ModelAttribute OrderInfo orderInfo){
+        startPage();
+        List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
+        return toResponsePageInfo(list);
+    }
+    
+
+    /**
+     * 获取订单信息详细信息
+     */
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取订单信息详细信息")
+    public Response<OrderInfo> getInfo(
+            @ApiParam(name = "id", value = "订单信息参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(orderInfoService.getById(id));
+    }
+
+
+
+}

+ 1 - 0
jsjp-service/src/main/resources/mapper/order/OrderInfoMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="successTime != null "> and success_time = #{successTime}</if>
             <if test="successTime != null "> and success_time = #{successTime}</if>
             <if test="payType != null "> and pay_type = #{payType}</if>
             <if test="payType != null "> and pay_type = #{payType}</if>
         </where>
         </where>
+        order by success_time desc;
     </select>
     </select>