瀏覽代碼

下单接口rest定义

张均强 4 年之前
父節點
當前提交
db9e466b4f

+ 3 - 0
common/fire-dto/src/main/java/com/fire/dto/param/MakeOrderParam.java

@@ -1,5 +1,8 @@
 package com.fire.dto.param;
 
+/**
+ * 下单参数
+ */
 public class MakeOrderParam {
 
 }

+ 4 - 0
modules/make-order/src/main/java/com/fire/order/MakeOrderApplication.java

@@ -4,6 +4,10 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
+/**
+ * 下单项目的启动类
+ * 此项目只有一个接口,就是下单接口
+ */
 @SpringBootApplication
 @EnableDiscoveryClient
 public class MakeOrderApplication {

+ 10 - 2
modules/make-order/src/main/java/com/fire/order/rest/MakeOrderRest.java

@@ -6,6 +6,9 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+/**
+ * 下单接口类
+ */
 @RestController
 @RefreshScope
 public class MakeOrderRest {
@@ -13,8 +16,13 @@ public class MakeOrderRest {
     @Value("${project.name}")
     private String swagger;
 
-    @RequestMapping("/test")
-    public String test(MakeOrderParam makeOrderParam) {
+    /**
+     * 下单接口
+     *
+     * @param makeOrderParam 下单参数
+     */
+    @RequestMapping("/makeOrder")
+    public String makeOrder(MakeOrderParam makeOrderParam) {
         return swagger;
     }
 }

+ 1 - 0
modules/pom.xml

@@ -34,6 +34,7 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-bootstrap</artifactId>
         </dependency>
+        <!--这里引入本地公共的类-->
         <dependency>
             <groupId>com.blue</groupId>
             <artifactId>fire-dto</artifactId>