浏览代码

增加生成文档注解

周箭河 5 年之前
父节点
当前提交
fef5c174b9

+ 11 - 0
pom.xml

@@ -181,6 +181,17 @@
 			<artifactId>springfox-swagger-ui</artifactId>
 			<version>2.2.2</version>
 		</dependency>
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-swagger2</artifactId>
+			<version>2.7.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-swagger-ui</artifactId>
+			<version>2.7.0</version>
+		</dependency>
 	</dependencies>
 
 	<build>

+ 9 - 5
src/main/java/com/ym/mec/collectfee/controller/YqPayController.java

@@ -7,6 +7,8 @@ import com.ym.mec.collectfee.service.YqPayService;
 import com.ym.mec.collectfee.service.YqQueryService;
 import com.ym.mec.collectfee.utils.GenerateNum;
 import com.ym.mec.collectfee.utils.yqpay.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -22,6 +24,7 @@ import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+@Api(description = "支付")
 @Slf4j
 @RestController
 @RequestMapping("yqPay")
@@ -43,7 +46,8 @@ public class YqPayController {
      * @return String
      * @throws Exception
      */
-    @RequestMapping("/toPay")
+    @ApiOperation(value = "提交支付", notes = "易乾支付统一下单")
+    @PostMapping("/toPay")
     @Transactional
     public Msg toPay(@ModelAttribute @Validated Order order) throws Exception {
         String orderNo = GenerateNum.getInstance().GenerateOrderNo();
@@ -99,7 +103,7 @@ public class YqPayController {
      * @return
      * @throws Exception
      */
-    @RequestMapping("/query")
+    @PostMapping("/query")
     public String query(String merOrderNoList) throws Exception {
         String notifyUrl = ""; //回调地址
         Map<String, Object> resultMap = new LinkedHashMap<>();
@@ -115,7 +119,7 @@ public class YqPayController {
      * @return
      * @throws Exception
      */
-    @RequestMapping("/queryaccount")
+    @PostMapping("/queryaccount")
     public String queryAccount(String sonMerNo) throws Exception {
         String notifyUrl = ""; //回调地址
         Map<String, Object> resultMap = new LinkedHashMap<>();
@@ -147,7 +151,7 @@ public class YqPayController {
      * @return
      * @throws Exception
      */
-    @RequestMapping("/platformtransferacc")
+    @PostMapping("/platformtransferacc")
     public String platformTransferAcc() throws Exception {
         String notifyUrl = ""; //回调地址
         Map<String, Object> resultMap = new LinkedHashMap<>();
@@ -210,7 +214,7 @@ public class YqPayController {
      * @return String
      * @throws Exception
      */
-    @RequestMapping("/notify")
+    @PostMapping("/notify")
     public Msg notify(@ModelAttribute Msg msg) throws Exception {
         log.info(msg.toString());
         Map<String, Object> rqMap = new LinkedHashMap<String, Object>();

+ 2 - 0
src/main/java/com/ym/mec/collectfee/entity/Order.java

@@ -1,6 +1,7 @@
 package com.ym.mec.collectfee.entity;
 
 import com.thoughtworks.xstream.annotations.XStreamAlias;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -13,6 +14,7 @@ import java.util.Date;
 public class Order {
 
 	/**  */
+	@ApiModelProperty(hidden = true)
 	private Integer id;
 	
 	/** 订单号。订单流水号 */