소스 검색

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	common/fire-dto/pom.xml
yf1800 4 년 전
부모
커밋
5407d72a99

+ 0 - 2
common/fire-dto/pom.xml

@@ -19,7 +19,6 @@
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
         </dependency>
-
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
@@ -29,7 +28,6 @@
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
         </dependency>
-
     </dependencies>
 
 </project>

+ 6 - 6
common/fire-dto/src/main/java/com/fire/param/HeaderDto.java

@@ -1,6 +1,6 @@
 package com.fire.param;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -10,23 +10,23 @@ import lombok.Data;
 public class HeaderDto {
 
     @ApiModelProperty(value = "版本")
-    @JSONField(name = "VERSION")
+    @JsonProperty(value = "VERSION")
     private String version;
 
     @ApiModelProperty(value = "时间戳")
-    @JSONField(name = "TIMESTAMP")
+    @JsonProperty(value = "TIMESTAMP")
     private Long timestamp;
 
     @ApiModelProperty(value = "流水号")
-    @JSONField(name = "SEQNO")
+    @JsonProperty(value = "SEQNO")
     private String seqNo;
 
     @ApiModelProperty(value = "appid")
-    @JSONField(name = "APPID")
+    @JsonProperty(value = "APPID")
     private String appId;
 
     @ApiModelProperty(value = "私有key")
-    @JSONField(name = "SECERTKEY")
+    @JsonProperty(value = "SECERTKEY")
     private String secretKey;
 
 }

+ 5 - 1
modules/make-order/src/main/java/com/fire/order/MakeOrderApplication.java

@@ -1,15 +1,19 @@
 package com.fire.order;
 
+import com.spring4all.swagger.EnableSwagger2Doc;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 /**
  * 下单项目的启动类
- * 此项目只有一个接口,就是下单接口
+ *
+ * @author ZJQ 2021年5月12日13:51:09
+ * @apiNote 此项目只有一个接口,就是下单接口
  */
 @SpringBootApplication
 @EnableDiscoveryClient
+@EnableSwagger2Doc
 public class MakeOrderApplication {
     public static void main(String[] args) {
         SpringApplication.run(MakeOrderApplication.class, args);

+ 7 - 7
modules/make-order/src/main/java/com/fire/order/request/OrderRequestContent.java

@@ -1,6 +1,6 @@
 package com.fire.order.request;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -8,27 +8,27 @@ import lombok.Data;
 public class OrderRequestContent {
 
     @ApiModelProperty(value = "产品包id")
-    @JSONField(name = "PACKAGEID")
+    @JsonProperty(value = "PACKAGEID")
     private String packageId;
 
     @ApiModelProperty(value = "客户订单")
-    @JSONField(name = "EXTORDER")
+    @JsonProperty(value = "EXTORDER")
     private String extOrder;
 
     @ApiModelProperty(value = "说明")
-    @JSONField(name = "NOTE")
+    @JsonProperty(value = "NOTE")
     private String note;
 
     @ApiModelProperty(value = "订单类型")
-    @JSONField(name = "ORDERTYPE")
+    @JsonProperty(value = "ORDERTYPE")
     private String orderType;
 
     @ApiModelProperty(value = "校验sign")
-    @JSONField(name = "SIGN")
+    @JsonProperty(value = "SIGN")
     private String sign;
 
     @ApiModelProperty(value = "用户")
-    @JSONField(name = "USER")
+    @JsonProperty(value = "USER")
     private String user;
 
 }

+ 2 - 2
modules/make-order/src/main/java/com/fire/order/request/OrderRequestMsgBody.java

@@ -1,6 +1,6 @@
 package com.fire.order.request;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -10,6 +10,6 @@ import lombok.Data;
 public class OrderRequestMsgBody {
 
     @ApiModelProperty(value = "请求正文")
-    @JSONField(name = "CONTENT")
+    @JsonProperty(value = "CONTENT")
     private OrderRequestContent content;
 }

+ 3 - 3
modules/make-order/src/main/java/com/fire/order/request/OrderRequestParam.java

@@ -1,6 +1,6 @@
 package com.fire.order.request;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fire.param.HeaderDto;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,11 +11,11 @@ import lombok.Data;
 public class OrderRequestParam {
 
     @ApiModelProperty(value = "请求参数头信息")
-    @JSONField(name = "HEADER")
+    @JsonProperty(value = "HEADER")
     private HeaderDto header;
 
     @ApiModelProperty(value = "请求参数消息体")
-    @JSONField(name = "MSGBODY")
+    @JsonProperty(value = "MSGBODY")
     private OrderRequestMsgBody msgBody;
 
 }

+ 3 - 3
modules/make-order/src/main/java/com/fire/order/response/OrderResp.java

@@ -1,6 +1,6 @@
 package com.fire.order.response;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -10,10 +10,10 @@ import lombok.Data;
 public class OrderResp {
 
     @ApiModelProperty(value = "响应信息")
-    @JSONField(name = "RMSG")
+    @JsonProperty(value = "RMSG")
     private String rMsg;
 
     @ApiModelProperty(value = "响应代码")
-    @JSONField(name = "RCODE")
+    @JsonProperty(value = "RCODE")
     private String rCode;
 }

+ 3 - 3
modules/make-order/src/main/java/com/fire/order/response/OrderResponseDto.java

@@ -1,6 +1,6 @@
 package com.fire.order.response;
 
-import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fire.param.HeaderDto;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,11 +11,11 @@ import lombok.Data;
 public class OrderResponseDto {
 
     @ApiModelProperty(value = "响应头信息")
-    @JSONField(name = "HEADER")
+    @JsonProperty(value = "HEADER")
     private HeaderDto header;
 
     @ApiModelProperty(value = "响应消息体")
-    @JSONField(name = "MSGBODY")
+    @JsonProperty(value = "MSGBODY")
     private OrderResponseMsgBody msgBody;
 
 }

+ 2 - 3
modules/make-order/src/main/java/com/fire/order/response/OrderResponseMsgBody.java

@@ -1,7 +1,6 @@
 package com.fire.order.response;
 
-import com.alibaba.fastjson.annotation.JSONField;
-import com.fire.order.request.OrderRequestContent;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -11,6 +10,6 @@ import lombok.Data;
 public class OrderResponseMsgBody {
 
     @ApiModelProperty(value = "响应信息")
-    @JSONField(name = "RESP")
+    @JsonProperty(value = "RESP")
     private OrderResp resp;
 }

+ 8 - 3
modules/make-order/src/main/java/com/fire/order/rest/MakeOrderRest.java

@@ -2,7 +2,10 @@ package com.fire.order.rest;
 
 import com.fire.order.request.OrderRequestParam;
 import com.fire.order.response.OrderResponseDto;
-import org.springframework.web.bind.annotation.RequestMapping;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -10,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
  *
  * @author ZJQ 2021年5月12日11:26:39
  */
+@Api(tags = "开放接口-下单")
 @RestController
 public class MakeOrderRest {
 
@@ -19,8 +23,9 @@ public class MakeOrderRest {
      * @param makeOrderParam 下单参数
      * @return OrderResponseDto 下单响应对象
      */
-    @RequestMapping("/gateway/flowservice/makeorder.ws")
-    public OrderResponseDto makeOrder(OrderRequestParam makeOrderParam) {
+    @PostMapping("/gateway/flowservice/makeorder.ws")
+    @ApiOperation(value = "下单接口", notes = "request_make_order.py")
+    public OrderResponseDto makeOrder(@RequestBody OrderRequestParam makeOrderParam) {
 
 
         return new OrderResponseDto();

+ 1 - 1
modules/make-order/src/main/resources/bootstrap.yml

@@ -12,4 +12,4 @@ spring:
       discovery:
         server-addr: 192.168.101.104:8848
         namespace: fire
-        service: make-order
+        service: make-order

+ 4 - 0
modules/pom.xml

@@ -39,6 +39,10 @@
             <groupId>com.spring4all</groupId>
             <artifactId>swagger-spring-boot-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
         <!--这里引入本地公共的类-->
         <dependency>
             <groupId>com.blue</groupId>

+ 5 - 0
pom.xml

@@ -42,6 +42,11 @@
                 <artifactId>spring-boot-starter-web</artifactId>
                 <version>2.4.5</version>
             </dependency>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-validation</artifactId>
+                <version>2.4.5</version>
+            </dependency>
             <dependency>
                 <groupId>org.springframework.cloud</groupId>
                 <artifactId>spring-cloud-starter-bootstrap</artifactId>