mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
5.1
This commit is contained in:
@@ -84,6 +84,25 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<!-- 文档推送 -->
|
||||
<plugin>
|
||||
<groupId>com.ly.smart-doc</groupId>
|
||||
<artifactId>smart-doc-maven-plugin</artifactId>
|
||||
<version>3.0.9</version>
|
||||
<configuration>
|
||||
<!--指定生成文档的使用的配置文件-->
|
||||
<configFile>./src/main/resources/smart-doc.json</configFile>
|
||||
<!--指定项目名称-->
|
||||
<projectName>${project.artifactId}</projectName>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-service-support</artifactId>
|
||||
<version>5.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
1
sop-example/example-payment/push-doc.sh
Normal file
1
sop-example/example-payment/push-doc.sh
Normal file
@@ -0,0 +1 @@
|
||||
mvn -Dfile.encoding=UTF-8 -Dcheckstyle.skip=true smart-doc:torna-rpc
|
@@ -5,29 +5,32 @@ import com.gitee.sop.payment.open.req.PayTradeWapPayRequest;
|
||||
import com.gitee.sop.payment.open.resp.PayOrderSearchResponse;
|
||||
import com.gitee.sop.payment.open.resp.PayTradeWapPayResponse;
|
||||
import com.gitee.sop.support.annotation.Open;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* 支付接口
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@Api("支付接口")
|
||||
public interface OpenPayment {
|
||||
|
||||
@ApiOperation(
|
||||
value = "手机网站支付接口",
|
||||
notes = "该接口是页面跳转接口,用于生成用户访问跳转链接。" +
|
||||
"请在服务端执行SDK中pageExecute方法,读取响应中的body()结果。" +
|
||||
"该结果用于跳转到页面,返回到用户浏览器渲染或重定向跳转到页面。" +
|
||||
"具体使用方法请参考 <a href=\"https://torna.cn\" target=\"_blank\">接入指南</a>"
|
||||
)
|
||||
/**
|
||||
* 手机网站支付接口
|
||||
*
|
||||
* @apiNote 该接口是页面跳转接口,用于生成用户访问跳转链接。
|
||||
* 请在服务端执行SDK中pageExecute方法,读取响应中的body()结果。
|
||||
* 该结果用于跳转到页面,返回到用户浏览器渲染或重定向跳转到页面。
|
||||
* 具体使用方法请参考 <a href="https://torna.cn" target="_blank">接入指南</a>
|
||||
*/
|
||||
@Open("pay.trade.wap.pay")
|
||||
PayTradeWapPayResponse tradeWapPay(PayTradeWapPayRequest request);
|
||||
|
||||
|
||||
@ApiOperation(value = "订单查询接口")
|
||||
/**
|
||||
* 订单查询接口
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Open("pay.order.search")
|
||||
PayOrderSearchResponse orderSearch(PayOrderSearchRequest request);
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.gitee.sop.payment.open.req;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
@@ -19,81 +18,93 @@ import java.util.List;
|
||||
public class PayTradeWapPayRequest {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "商户网站唯一订单号", required = true, example = "70501111111S001111119")
|
||||
/**
|
||||
* 商户网站唯一订单号
|
||||
*
|
||||
* @mock 70501111111S001111119
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@NotBlank(message = "商户网站唯一订单号必填")
|
||||
private String outTradeNo;
|
||||
|
||||
@ApiModelProperty(value = "订单总金额.单位为元,精确到小数点后两位,取值范围:[0.01,100000000] ",
|
||||
required = true, example = "9.00")
|
||||
/**
|
||||
* 订单总金额.单位为元,精确到小数点后两位,取值范围:[0.01,100000000]
|
||||
*
|
||||
* @mock 9.00
|
||||
*/
|
||||
@NotNull(message = "订单总金额不能为空")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "订单标题。注意:不可使用特殊字符,如 /,=,& 等。",
|
||||
required = true,
|
||||
example = "大乐透"
|
||||
)
|
||||
/**
|
||||
* 订单标题。注意:不可使用特殊字符,如 /,=,& 等。
|
||||
*
|
||||
* @mock 大乐透
|
||||
*/
|
||||
@Length(max = 256)
|
||||
@NotBlank(message = "订单标题不能为空")
|
||||
private String subject;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "销售产品码,商家和支付平台签约的产品码。手机网站支付为:QUICK_WAP_WAY",
|
||||
required = true,
|
||||
example = "QUICK_WAP_WAY"
|
||||
)
|
||||
/**
|
||||
* 销售产品码,商家和支付平台签约的产品码。手机网站支付为:QUICK_WAP_WAY
|
||||
*
|
||||
* @mock QUICK_WAP_WAY
|
||||
*/
|
||||
@NotBlank(message = "销售产品码不能为空")
|
||||
@Length(max = 64)
|
||||
private String productCode;
|
||||
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "针对用户授权接口,获取用户相关数据时,用于标识用户授权关系",
|
||||
example = "appopenBb64d181d0146481ab6a762c00714cC27"
|
||||
)
|
||||
/**
|
||||
* 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系
|
||||
*
|
||||
* @mock appopenBb64d181d0146481ab6a762c00714cC27
|
||||
*/
|
||||
@Length(max = 40)
|
||||
private String authToken;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "用户付款中途退出返回商户网站的地址",
|
||||
example = "http://www.taobao.com/product/113714.html"
|
||||
)
|
||||
/**
|
||||
* 用户付款中途退出返回商户网站的地址
|
||||
*
|
||||
* @mock http://www.taobao.com/product/113714.html
|
||||
*/
|
||||
@Length(max = 400)
|
||||
private String quit_url;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "订单包含的商品列表信息,json格式,其它说明详见商品明细说明"
|
||||
)
|
||||
/**
|
||||
* 订单包含的商品列表信息,json格式,其它说明详见商品明细说明
|
||||
*/
|
||||
private List<GoodsDetail> goodsDetail;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "绝对超时时间,格式为yyyy-MM-dd HH:mm:ss。超时时间范围:1m~15d。",
|
||||
example = "2016-12-31 10:05:00"
|
||||
)
|
||||
/**
|
||||
* 绝对超时时间,格式为yyyy-MM-dd HH:mm:ss。超时时间范围:1m~15d。
|
||||
*
|
||||
* @mock 2016-12-31 10:05:00
|
||||
*/
|
||||
@Length(max = 32)
|
||||
private String timeExpire;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商户传入业务信息,具体值要和支付平台约定,应用于安全,营销等参数直传场景,格式为json格式",
|
||||
example = "{\"mc_create_trade_ip\":\"127.0.0.1\"}"
|
||||
)
|
||||
/**
|
||||
* 商户传入业务信息,具体值要和支付平台约定,应用于安全,营销等参数直传场景,格式为json格式
|
||||
*
|
||||
* @mock {"mc_create_trade_ip":"127.0.0.1"}
|
||||
*/
|
||||
@Length(max = 512)
|
||||
private String businessParams;
|
||||
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付平台只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付平台。",
|
||||
example = "merchantBizType%3d3C%26merchantBizNo%3d2016010101111"
|
||||
)
|
||||
/**
|
||||
* 公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付平台只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付平台。
|
||||
*
|
||||
* @mock merchantBizType%3d3C%26merchantBizNo%3d2016010101111
|
||||
*/
|
||||
@Length(max = 512)
|
||||
private String passbackParams;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商户原始订单号,最大长度限制32位",
|
||||
example = "{\"mc_create_trade_ip\":\"127.0.0.1\"}"
|
||||
)
|
||||
/**
|
||||
* 商户原始订单号,最大长度限制32位
|
||||
*
|
||||
* @mock {"mc_create_trade_ip":"127.0.0.1"}
|
||||
*/
|
||||
@Length(max = 32)
|
||||
private String merchantOrderNo;
|
||||
|
||||
@@ -101,73 +112,78 @@ public class PayTradeWapPayRequest {
|
||||
|
||||
@Data
|
||||
public static class GoodsDetail {
|
||||
@ApiModelProperty(
|
||||
value = "商品的编号",
|
||||
required = true,
|
||||
example = "apple-01"
|
||||
)
|
||||
/**
|
||||
* 商品的编号
|
||||
*
|
||||
* @mock apple-01
|
||||
*/
|
||||
@NotBlank
|
||||
@Length(max = 64)
|
||||
private String goodsId;
|
||||
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品名称",
|
||||
required = true,
|
||||
example = "ipad"
|
||||
)
|
||||
/**
|
||||
* 商品名称
|
||||
*
|
||||
* @mock ipad
|
||||
*/
|
||||
@NotBlank
|
||||
@Length(max = 256)
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品数量",
|
||||
required = true,
|
||||
example = "1"
|
||||
)
|
||||
/**
|
||||
* 商品数量
|
||||
*
|
||||
* @mock 1
|
||||
*/
|
||||
@NotNull
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品单价,单位为元",
|
||||
required = true,
|
||||
example = "2000"
|
||||
)
|
||||
/**
|
||||
* 商品单价,单位为元
|
||||
*
|
||||
* @mock 2000
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "支付平台定义的统一商品编号",
|
||||
example = "20010001"
|
||||
)
|
||||
/**
|
||||
* 支付平台定义的统一商品编号
|
||||
*
|
||||
* @mock 20010001
|
||||
*/
|
||||
@Length(max = 32)
|
||||
private String alipayGoodsId;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品类目",
|
||||
example = "34543238"
|
||||
)
|
||||
/**
|
||||
* 商品类目
|
||||
*
|
||||
* @mock 34543238
|
||||
*/
|
||||
@Length(max = 24)
|
||||
private String goodsCategory;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品类目树,从商品类目根节点到叶子节点的类目id组成,类目id值使用|分割",
|
||||
example = "124868003|126232002|126252004"
|
||||
)
|
||||
/**
|
||||
* 商品类目树,从商品类目根节点到叶子节点的类目id组成,类目id值使用|分割
|
||||
*
|
||||
* @mock 124868003|126232002|126252004
|
||||
*/
|
||||
@Length(max = 128)
|
||||
private String categoriesTree;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品描述信息",
|
||||
example = "特价手机"
|
||||
)
|
||||
/**
|
||||
* 商品描述信息
|
||||
*
|
||||
* @mock 特价手机
|
||||
*/
|
||||
@Length(max = 1000)
|
||||
private String body;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商品的展示地址",
|
||||
example = "http://www.alipay.com/xxx.jpg"
|
||||
)
|
||||
/**
|
||||
* 商品的展示地址
|
||||
*
|
||||
* @mock http://www.alipay.com/xxx.jpg
|
||||
*/
|
||||
@Length(max = 400)
|
||||
private String showUrl;
|
||||
|
||||
|
@@ -1,19 +1,21 @@
|
||||
package com.gitee.sop.payment.open.resp;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class PayTradeWapPayResponse {
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "用于跳转支付平台页面的信息,POST和GET方法生成内容不同:使用POST方法执行,结果为html form表单,在浏览器渲染即可;使用GET方法会得到支付平台URL,需要打开或重定向到该URL。建议使用POST方式。具体使用方法请参考",
|
||||
required = true,
|
||||
example = "请参考响应示例"
|
||||
)
|
||||
/**
|
||||
* 用于跳转支付平台页面的信息,POST和GET方法生成内容不同:使用POST方法执行,结果为html form表单,在浏览器渲染即可<br>使用GET方法会得到支付平台URL,需要打开或重定向到该URL。建议使用POST方式。
|
||||
*
|
||||
* @mock 请参考响应示例
|
||||
*/
|
||||
@NotNull
|
||||
private String pageRedirectionData;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"framework": "sop",
|
||||
"outPath": "target/doc",
|
||||
"projectName": "项目",
|
||||
"packageFilters": "com.gitee.sop.payment.open.*",
|
||||
"openUrl": "http://localhost:7700/api", // torna服务器地址
|
||||
"appToken": "34ff76952462413982d21219cf099d46", // torna应用token
|
||||
"debugEnvName":"本地环境",
|
||||
"debugEnvUrl":"http://127.0.0.1:8081",
|
||||
"tornaDebug": true,
|
||||
"replace": true,
|
||||
"showValidation": false
|
||||
}
|
Reference in New Issue
Block a user