修改接口定义,增加了退款接口
diff --git a/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/ErrorResponse.java b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/ErrorResponse.java
new file mode 100644
index 0000000..6a239b0
--- /dev/null
+++ b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/ErrorResponse.java
@@ -0,0 +1,106 @@
+package com.supwisdom.dlpay.payapi.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.jackson.nullable.JsonNullable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+/**
+ * ErrorResponse
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2020-03-16T21:13:31.022+08:00[Asia/Shanghai]")
+
+public class ErrorResponse   {
+  @JsonProperty("code")
+  private String code;
+
+  @JsonProperty("message")
+  private String message;
+
+  public ErrorResponse code(String code) {
+    this.code = code;
+    return this;
+  }
+
+  /**
+   * Get code
+   * @return code
+  */
+  @ApiModelProperty(value = "")
+
+
+  public String getCode() {
+    return code;
+  }
+
+  public void setCode(String code) {
+    this.code = code;
+  }
+
+  public ErrorResponse message(String message) {
+    this.message = message;
+    return this;
+  }
+
+  /**
+   * Get message
+   * @return message
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+
+  @Override
+  public boolean equals(java.lang.Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    ErrorResponse errorResponse = (ErrorResponse) o;
+    return Objects.equals(this.code, errorResponse.code) &&
+        Objects.equals(this.message, errorResponse.message);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(code, message);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("class ErrorResponse {\n");
+    
+    sb.append("    code: ").append(toIndentedString(code)).append("\n");
+    sb.append("    message: ").append(toIndentedString(message)).append("\n");
+    sb.append("}");
+    return sb.toString();
+  }
+
+  /**
+   * Convert the given object to string with each line indented by 4 spaces
+   * (except the first line).
+   */
+  private String toIndentedString(java.lang.Object o) {
+    if (o == null) {
+      return "null";
+    }
+    return o.toString().replace("\n", "\n    ");
+  }
+}
+
diff --git a/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundRequest.java b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundRequest.java
new file mode 100644
index 0000000..95d3245
--- /dev/null
+++ b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundRequest.java
@@ -0,0 +1,185 @@
+package com.supwisdom.dlpay.payapi.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.jackson.nullable.JsonNullable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+/**
+ * RefundRequest
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2020-03-16T21:13:31.022+08:00[Asia/Shanghai]")
+
+public class RefundRequest   {
+  @JsonProperty("billno")
+  private String billno;
+
+  @JsonProperty("transDate")
+  private String transDate;
+
+  @JsonProperty("transTime")
+  private String transTime;
+
+  @JsonProperty("refno")
+  private String refno;
+
+  @JsonProperty("amount")
+  private Integer amount;
+
+  public RefundRequest billno(String billno) {
+    this.billno = billno;
+    return this;
+  }
+
+  /**
+   * Get billno
+   * @return billno
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+@Pattern(regexp="[0-9]*") @Size(min=16) 
+  public String getBillno() {
+    return billno;
+  }
+
+  public void setBillno(String billno) {
+    this.billno = billno;
+  }
+
+  public RefundRequest transDate(String transDate) {
+    this.transDate = transDate;
+    return this;
+  }
+
+  /**
+   * Get transDate
+   * @return transDate
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+@Pattern(regexp="[0-9]*") @Size(min=8,max=8) 
+  public String getTransDate() {
+    return transDate;
+  }
+
+  public void setTransDate(String transDate) {
+    this.transDate = transDate;
+  }
+
+  public RefundRequest transTime(String transTime) {
+    this.transTime = transTime;
+    return this;
+  }
+
+  /**
+   * Get transTime
+   * @return transTime
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+@Pattern(regexp="[0-9]*") @Size(min=6,max=6) 
+  public String getTransTime() {
+    return transTime;
+  }
+
+  public void setTransTime(String transTime) {
+    this.transTime = transTime;
+  }
+
+  public RefundRequest refno(String refno) {
+    this.refno = refno;
+    return this;
+  }
+
+  /**
+   * Get refno
+   * @return refno
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+@Pattern(regexp="[0-9]*") @Size(min=16) 
+  public String getRefno() {
+    return refno;
+  }
+
+  public void setRefno(String refno) {
+    this.refno = refno;
+  }
+
+  public RefundRequest amount(Integer amount) {
+    this.amount = amount;
+    return this;
+  }
+
+  /**
+   * Get amount
+   * @return amount
+  */
+  @ApiModelProperty(required = true, value = "")
+  @NotNull
+
+
+  public Integer getAmount() {
+    return amount;
+  }
+
+  public void setAmount(Integer amount) {
+    this.amount = amount;
+  }
+
+
+  @Override
+  public boolean equals(java.lang.Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    RefundRequest refundRequest = (RefundRequest) o;
+    return Objects.equals(this.billno, refundRequest.billno) &&
+        Objects.equals(this.transDate, refundRequest.transDate) &&
+        Objects.equals(this.transTime, refundRequest.transTime) &&
+        Objects.equals(this.refno, refundRequest.refno) &&
+        Objects.equals(this.amount, refundRequest.amount);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(billno, transDate, transTime, refno, amount);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("class RefundRequest {\n");
+    
+    sb.append("    billno: ").append(toIndentedString(billno)).append("\n");
+    sb.append("    transDate: ").append(toIndentedString(transDate)).append("\n");
+    sb.append("    transTime: ").append(toIndentedString(transTime)).append("\n");
+    sb.append("    refno: ").append(toIndentedString(refno)).append("\n");
+    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
+    sb.append("}");
+    return sb.toString();
+  }
+
+  /**
+   * Convert the given object to string with each line indented by 4 spaces
+   * (except the first line).
+   */
+  private String toIndentedString(java.lang.Object o) {
+    if (o == null) {
+      return "null";
+    }
+    return o.toString().replace("\n", "\n    ");
+  }
+}
+
diff --git a/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundResponse.java b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundResponse.java
new file mode 100644
index 0000000..0853573
--- /dev/null
+++ b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/RefundResponse.java
@@ -0,0 +1,182 @@
+package com.supwisdom.dlpay.payapi.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.supwisdom.dlpay.payapi.model.TransResult;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.jackson.nullable.JsonNullable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+/**
+ * RefundResponse
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2020-03-16T21:13:31.022+08:00[Asia/Shanghai]")
+
+public class RefundResponse   {
+  @JsonProperty("billno")
+  private String billno;
+
+  @JsonProperty("hostDate")
+  private String hostDate;
+
+  @JsonProperty("hostTime")
+  private String hostTime;
+
+  @JsonProperty("refno")
+  private String refno;
+
+  @JsonProperty("result")
+  private TransResult result;
+
+  public RefundResponse billno(String billno) {
+    this.billno = billno;
+    return this;
+  }
+
+  /**
+   * Get billno
+   * @return billno
+  */
+  @ApiModelProperty(value = "")
+
+@Pattern(regexp="[0-9]*") @Size(min=16) 
+  public String getBillno() {
+    return billno;
+  }
+
+  public void setBillno(String billno) {
+    this.billno = billno;
+  }
+
+  public RefundResponse hostDate(String hostDate) {
+    this.hostDate = hostDate;
+    return this;
+  }
+
+  /**
+   * Get hostDate
+   * @return hostDate
+  */
+  @ApiModelProperty(value = "")
+
+@Pattern(regexp="[0-9]*") @Size(min=8,max=8) 
+  public String getHostDate() {
+    return hostDate;
+  }
+
+  public void setHostDate(String hostDate) {
+    this.hostDate = hostDate;
+  }
+
+  public RefundResponse hostTime(String hostTime) {
+    this.hostTime = hostTime;
+    return this;
+  }
+
+  /**
+   * Get hostTime
+   * @return hostTime
+  */
+  @ApiModelProperty(value = "")
+
+@Pattern(regexp="[0-9]*") @Size(min=6,max=6) 
+  public String getHostTime() {
+    return hostTime;
+  }
+
+  public void setHostTime(String hostTime) {
+    this.hostTime = hostTime;
+  }
+
+  public RefundResponse refno(String refno) {
+    this.refno = refno;
+    return this;
+  }
+
+  /**
+   * Get refno
+   * @return refno
+  */
+  @ApiModelProperty(value = "")
+
+@Pattern(regexp="[0-9]*") @Size(min=16) 
+  public String getRefno() {
+    return refno;
+  }
+
+  public void setRefno(String refno) {
+    this.refno = refno;
+  }
+
+  public RefundResponse result(TransResult result) {
+    this.result = result;
+    return this;
+  }
+
+  /**
+   * Get result
+   * @return result
+  */
+  @ApiModelProperty(value = "")
+
+  @Valid
+
+  public TransResult getResult() {
+    return result;
+  }
+
+  public void setResult(TransResult result) {
+    this.result = result;
+  }
+
+
+  @Override
+  public boolean equals(java.lang.Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    RefundResponse refundResponse = (RefundResponse) o;
+    return Objects.equals(this.billno, refundResponse.billno) &&
+        Objects.equals(this.hostDate, refundResponse.hostDate) &&
+        Objects.equals(this.hostTime, refundResponse.hostTime) &&
+        Objects.equals(this.refno, refundResponse.refno) &&
+        Objects.equals(this.result, refundResponse.result);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(billno, hostDate, hostTime, refno, result);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("class RefundResponse {\n");
+    
+    sb.append("    billno: ").append(toIndentedString(billno)).append("\n");
+    sb.append("    hostDate: ").append(toIndentedString(hostDate)).append("\n");
+    sb.append("    hostTime: ").append(toIndentedString(hostTime)).append("\n");
+    sb.append("    refno: ").append(toIndentedString(refno)).append("\n");
+    sb.append("    result: ").append(toIndentedString(result)).append("\n");
+    sb.append("}");
+    return sb.toString();
+  }
+
+  /**
+   * Convert the given object to string with each line indented by 4 spaces
+   * (except the first line).
+   */
+  private String toIndentedString(java.lang.Object o) {
+    if (o == null) {
+      return "null";
+    }
+    return o.toString().replace("\n", "\n    ");
+  }
+}
+
diff --git a/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/TransResult.java b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/TransResult.java
new file mode 100644
index 0000000..ef33e03
--- /dev/null
+++ b/payapi-common/src/main/java/com/supwisdom/dlpay/payapi/model/TransResult.java
@@ -0,0 +1,46 @@
+package com.supwisdom.dlpay.payapi.model;
+
+import java.util.Objects;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.openapitools.jackson.nullable.JsonNullable;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+/**
+ * Gets or Sets TransResult
+ */
+public enum TransResult {
+  
+  SUCCESS("success"),
+  
+  FAILED("failed"),
+  
+  ALREADY_SUCCESS("already_success"),
+  
+  REQUIRE_QUERY("require_query");
+
+  private String value;
+
+  TransResult(String value) {
+    this.value = value;
+  }
+
+  @Override
+  @JsonValue
+  public String toString() {
+    return String.valueOf(value);
+  }
+
+  @JsonCreator
+  public static TransResult fromValue(String value) {
+    for (TransResult b : TransResult.values()) {
+      if (b.value.equals(value)) {
+        return b;
+      }
+    }
+    throw new IllegalArgumentException("Unexpected value '" + value + "'");
+  }
+}
+
diff --git a/payapi-spec/consumeapi.yaml b/payapi-spec/consumeapi.yaml
index 1aa2630..80df543 100644
--- a/payapi-spec/consumeapi.yaml
+++ b/payapi-spec/consumeapi.yaml
@@ -1,17 +1,5 @@
 components:
   schemas:
-    ErrorResponse:
-      type: object
-      title: 请求错误
-      required:
-        - message
-      properties:
-        code:
-          type: string
-          title: 错误码
-        message:
-          type: string
-          title: 错误信息
     QrcodePayInitRequest:
       type: object
       title: QrCode请求初始化
@@ -97,12 +85,47 @@
           title: 交易描述
         result:
           title: 交易结果
-          type: string
-          enum:
-            - success
-            - require_query
-            - already_success
-            - failed
+          $ref: 'definitions.yaml#/components/schemas/TransResult'
+    RefundRequest:
+      type: object
+      title: 退款申请
+      required:
+        - billno
+        - transDate
+        - transTime
+        - refno
+        - amount
+      properties:
+        billno:
+          title: 退款申请订单号
+          $ref: 'definitions.yaml#/components/schemas/Refno'
+        transDate:
+          $ref: 'definitions.yaml#/components/schemas/TransDate'
+        transTime:
+          $ref: 'definitions.yaml#/components/schemas/TransTime'
+        refno:
+          title: 退款申请原始订单交易参考号
+          $ref: 'definitions.yaml#/components/schemas/Refno'
+        amount:
+          type: integer
+          title: 退款金额, 正式
+    RefundResponse:
+      type: object
+      title: 退款申请应答
+      properties:
+        billno:
+          title: 退款申请订单号
+          $ref: 'definitions.yaml#/components/schemas/Refno'
+        hostDate:
+          $ref: 'definitions.yaml#/components/schemas/TransDate'
+        hostTime:
+          $ref: 'definitions.yaml#/components/schemas/TransTime'
+        refno:
+          title: 退款申请原始订单交易参考号
+          $ref: 'definitions.yaml#/components/schemas/Refno'
+        result:
+          title: 退款处理结果
+          $ref: 'definitions.yaml#/components/schemas/TransResult'
 
   paths:
     qrcodePayInit:
@@ -130,7 +153,8 @@
             description: 请求错误
             content:
               application/json:
-                $ref: '#/components/schemas/ErrorResponse'
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
     qrcodePayConfirm:
       parameters:
         - $ref: definitions.yaml#/components/headers/TenantId
@@ -155,12 +179,14 @@
             description: 交易正忙,稍后重试
             content:
               application/json:
-                $ref: '#/components/schemas/ErrorResponse'
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
           'default':
             description: 交易失败
             content:
               application/json:
-                $ref: '#/components/schemas/ErrorResponse'
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
     qrcodePayQuery:
       parameters:
         - $ref: 'definitions.yaml#/components/headers/TenantId'
@@ -181,10 +207,77 @@
             description: 查询成功
             content:
               application/json:
-                $ref: '#/components/schemas/QrcodePayConfirmResponse'
+                schema:
+                  $ref: '#/components/schemas/QrcodePayConfirmResponse'
           'default':
             description: 查询失败
             content:
               application/json:
-                $ref: '#/components/schemas/ErrorResponse'
-
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+    refund:
+      parameters:
+        - $ref: 'definitions.yaml#/components/headers/TenantId'
+      post:
+        description: 退款交易
+        tags:
+          - pos
+        operationId: refund
+        requestBody:
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/RefundRequest'
+        responses:
+          '200':
+            description: 退款申请成功,等待查询
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/RefundResponse'
+          '409':
+            description: 退款申请失败,订单号已存在或正在退款中
+            content:
+              application/json:
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+          default:
+            description: 退款申请失败
+            content:
+              application/json:
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+    refundQuery:
+      parameters:
+        - $ref: 'definitions.yaml#/components/headers/TenantId'
+        - name: billno
+          in: path
+          description: 退款订单号
+          required: true
+          schema:
+            type: string
+            title: 退款订单号
+      get:
+        description: 退款申请查询
+        tags:
+          - pos
+        operationId: refundQuery
+        responses:
+          '200':
+            description: 退款申请查询成功
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/RefundResponse'
+          '404':
+            description: 退款申请订单不存在
+            content:
+              application/json:
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
+          default:
+            description: 退款申请失败
+            content:
+              application/json:
+                schema:
+                  $ref: 'definitions.yaml#/components/schemas/ErrorResponse'
diff --git a/payapi-spec/definitions.yaml b/payapi-spec/definitions.yaml
index fea5324..89e374d 100644
--- a/payapi-spec/definitions.yaml
+++ b/payapi-spec/definitions.yaml
@@ -10,6 +10,18 @@
 
 
   schemas:
+    ErrorResponse:
+      type: object
+      title: 请求错误
+      required:
+        - message
+      properties:
+        code:
+          type: string
+          title: 错误码
+        message:
+          type: string
+          title: 错误信息
     TransDate:
       type: string
       title: 交易日期
@@ -38,3 +50,10 @@
         - plain
         - base64
         - hex
+    TransResult:
+      type: string
+      enum:
+        - success
+        - failed
+        - already_success
+        - require_query
diff --git a/payapi-spec/payapi-spec.yaml b/payapi-spec/payapi-spec.yaml
index 1b432bc..0c8efe9 100644
--- a/payapi-spec/payapi-spec.yaml
+++ b/payapi-spec/payapi-spec.yaml
@@ -11,3 +11,7 @@
     $ref: consumeapi.yaml#/components/paths/qrcodePayConfirm
   /consume/qrcode/query/{refno}:
     $ref: consumeapi.yaml#/components/paths/qrcodePayQuery
+  /consume/refund:
+    $ref: consumeapi.yaml#/components/paths/refund
+  /consume/refund/query/{billno}:
+    $ref: consumeapi.yaml#/components/paths/refundQuery