From 5cd37aea45c5a4229b497b0ab544eccfb98cb626 Mon Sep 17 00:00:00 2001 From: D <3066417822@qq.com> Date: Wed, 27 Mar 2024 15:15:21 +0800 Subject: [PATCH] update --- .../web/controller/tool/TestController.java | 8 ++-- .../ruoyi/common/core/domain/BaseEntity.java | 11 ++++++ .../java/com/ruoyi/common/core/domain/R.java | 7 ++++ .../src/main/resources/vm/java/domain.java.vm | 2 +- .../ruoyi/oauth/common/domain/OauthUser.java | 38 +++++++++---------- .../com/ruoyi/online/domain/OnlineMb.java | 28 +++++++------- .../java/com/ruoyi/pay/domain/PayInvoice.java | 16 ++++---- .../java/com/ruoyi/pay/domain/PayOrder.java | 18 ++++----- .../pay/sqb/controller/SQBController.java | 9 +++-- 9 files changed, 79 insertions(+), 58 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java index 9374694..d613d1e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java @@ -108,16 +108,16 @@ public class TestController extends BaseController @Schema(description = "用户实体") class UserEntity { - @Schema(defaultValue = "用户ID") + @Schema(title = "用户ID") private Integer userId; - @Schema(defaultValue = "用户名称") + @Schema(title = "用户名称") private String username; - @Schema(defaultValue = "用户密码") + @Schema(title = "用户密码") private String password; - @Schema(defaultValue = "用户手机") + @Schema(title = "用户手机") private String mobile; public UserEntity() diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 15bf66b..ae75994 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -4,41 +4,52 @@ import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; + import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; + /** * Entity基类 * * @author ruoyi */ +@Schema(title = "基类") public class BaseEntity implements Serializable { private static final long serialVersionUID = 1L; /** 搜索值 */ + @Schema(title = "搜索值") @JsonIgnore private String searchValue; /** 创建者 */ + @Schema(title = "创建者") private String createBy; /** 创建时间 */ + @Schema(title = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 更新者 */ + @Schema(title = "更新者") private String updateBy; /** 更新时间 */ + @Schema(title = "更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** 备注 */ + @Schema(title = "备注") private String remark; /** 请求参数 */ + @Schema(title = "请求参数") @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map params; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index ef15802..e6af133 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -1,13 +1,17 @@ package com.ruoyi.common.core.domain; import java.io.Serializable; + import com.ruoyi.common.constant.HttpStatus; +import io.swagger.v3.oas.annotations.media.Schema; + /** * 响应信息主体 * * @author ruoyi */ +@Schema(title = "响应信息主体") public class R implements Serializable { private static final long serialVersionUID = 1L; @@ -18,10 +22,13 @@ public class R implements Serializable /** 失败 */ public static final int FAIL = HttpStatus.ERROR; + @Schema(title = "响应码") private int code; + @Schema(title = "响应信息") private String msg; + @Schema(title = "响应数据") private T data; public static R ok() diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index 2d7adb5..8022a2b 100644 --- a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -34,7 +34,7 @@ public class ${ClassName} extends ${Entity} #foreach ($column in $columns) #if(!$table.isSuperColumn($column.javaField)) /** $column.columnComment */ - @Schema(defaultValue = "$column.columnComment") + @Schema(title = "$column.columnComment") #if($column.list) #set($parentheseIndex=$column.columnComment.indexOf("(")) #if($parentheseIndex != -1) diff --git a/ruoyi-oauth/ruoyi-oauth-common/src/main/java/com/ruoyi/oauth/common/domain/OauthUser.java b/ruoyi-oauth/ruoyi-oauth-common/src/main/java/com/ruoyi/oauth/common/domain/OauthUser.java index 7198cc5..61a9052 100644 --- a/ruoyi-oauth/ruoyi-oauth-common/src/main/java/com/ruoyi/oauth/common/domain/OauthUser.java +++ b/ruoyi-oauth/ruoyi-oauth-common/src/main/java/com/ruoyi/oauth/common/domain/OauthUser.java @@ -19,98 +19,98 @@ public class OauthUser extends BaseEntity { private static final long serialVersionUID = 1L; /** 主键 */ - @Schema(defaultValue = "主键") + @Schema(title = "主键") private Long id; /** 第三方系统的唯一ID,详细解释请参考:名词解释 */ - @Schema(defaultValue = "第三方系统的唯一ID,详细解释请参考:名词解释") + @Schema(title = "第三方系统的唯一ID,详细解释请参考:名词解释") @Excel(name = "第三方系统的唯一ID,详细解释请参考:名词解释") private String uuid; /** 用户ID */ - @Schema(defaultValue = "用户ID") + @Schema(title = "用户ID") @Excel(name = "用户ID") private Long userId; /** * 第三方用户来源,可选值:GITHUB、GITEE、QQ,更多请参考:AuthDefaultSource.java(opens new window) */ - @Schema(defaultValue = "第三方用户来源,可选值:GITHUB、GITEE、QQ,更多请参考:AuthDefaultSource.java(opens new window)") + @Schema(title = "第三方用户来源,可选值:GITHUB、GITEE、QQ,更多请参考:AuthDefaultSource.java(opens new window)") @Excel(name = "第三方用户来源,可选值:GITHUB、GITEE、QQ,更多请参考:AuthDefaultSource.java(opens new window)") private String source; /** 用户的授权令牌 */ - @Schema(defaultValue = "用户的授权令牌") + @Schema(title = "用户的授权令牌") @Excel(name = "用户的授权令牌") private String accessToken; /** 第三方用户的授权令牌的有效期,部分平台可能没有 */ - @Schema(defaultValue = "第三方用户的授权令牌的有效期,部分平台可能没有") + @Schema(title = "第三方用户的授权令牌的有效期,部分平台可能没有") @Excel(name = "第三方用户的授权令牌的有效期,部分平台可能没有") private Long expireIn; /** 刷新令牌,部分平台可能没有 */ - @Schema(defaultValue = "刷新令牌,部分平台可能没有") + @Schema(title = "刷新令牌,部分平台可能没有") @Excel(name = "刷新令牌,部分平台可能没有") private String refreshToken; /** 第三方用户的 open id,部分平台可能没有 */ - @Schema(defaultValue = "第三方用户的 open id,部分平台可能没有") + @Schema(title = "第三方用户的 open id,部分平台可能没有") @Excel(name = "第三方用户的 open id,部分平台可能没有") private String openId; /** 第三方用户的 ID,部分平台可能没有 */ - @Schema(defaultValue = "第三方用户的 ID,部分平台可能没有") + @Schema(title = "第三方用户的 ID,部分平台可能没有") @Excel(name = "第三方用户的 ID,部分平台可能没有") private String uid; /** 个别平台的授权信息,部分平台可能没有 */ - @Schema(defaultValue = "个别平台的授权信息,部分平台可能没有") + @Schema(title = "个别平台的授权信息,部分平台可能没有") @Excel(name = "个别平台的授权信息,部分平台可能没有") private String accessCode; /** 第三方用户的 union id,部分平台可能没有 */ - @Schema(defaultValue = "第三方用户的 union id,部分平台可能没有") + @Schema(title = "第三方用户的 union id,部分平台可能没有") @Excel(name = "第三方用户的 union id,部分平台可能没有") private String unionId; /** 第三方用户授予的权限,部分平台可能没有 */ - @Schema(defaultValue = "第三方用户授予的权限,部分平台可能没有") + @Schema(title = "第三方用户授予的权限,部分平台可能没有") @Excel(name = "第三方用户授予的权限,部分平台可能没有") private String scope; /** 个别平台的授权信息,部分平台可能没有 */ - @Schema(defaultValue = "个别平台的授权信息,部分平台可能没有") + @Schema(title = "个别平台的授权信息,部分平台可能没有") @Excel(name = "个别平台的授权信息,部分平台可能没有") private String tokenType; /** id token,部分平台可能没有 */ - @Schema(defaultValue = "id token,部分平台可能没有") + @Schema(title = "id token,部分平台可能没有") @Excel(name = "id token,部分平台可能没有") private String idToken; /** 小米平台用户的附带属性,部分平台可能没有 */ - @Schema(defaultValue = "小米平台用户的附带属性,部分平台可能没有") + @Schema(title = "小米平台用户的附带属性,部分平台可能没有") @Excel(name = "小米平台用户的附带属性,部分平台可能没有") private String macAlgorithm; /** 小米平台用户的附带属性,部分平台可能没有 */ - @Schema(defaultValue = "小米平台用户的附带属性,部分平台可能没有") + @Schema(title = "小米平台用户的附带属性,部分平台可能没有") @Excel(name = "小米平台用户的附带属性,部分平台可能没有") private String macKey; /** 用户的授权code,部分平台可能没有 */ - @Schema(defaultValue = "用户的授权code,部分平台可能没有") + @Schema(title = "用户的授权code,部分平台可能没有") @Excel(name = "用户的授权code,部分平台可能没有") private String code; /** Twitter平台用户的附带属性,部分平台可能没有 */ - @Schema(defaultValue = "Twitter平台用户的附带属性,部分平台可能没有") + @Schema(title = "Twitter平台用户的附带属性,部分平台可能没有") @Excel(name = "Twitter平台用户的附带属性,部分平台可能没有") private String oauthToken; /** Twitter平台用户的附带属性,部分平台可能没有 */ - @Schema(defaultValue = "Twitter平台用户的附带属性,部分平台可能没有") + @Schema(title = "Twitter平台用户的附带属性,部分平台可能没有") @Excel(name = "Twitter平台用户的附带属性,部分平台可能没有") private String oauthTokenSecret; diff --git a/ruoyi-online/src/main/java/com/ruoyi/online/domain/OnlineMb.java b/ruoyi-online/src/main/java/com/ruoyi/online/domain/OnlineMb.java index 9f2e350..857555f 100644 --- a/ruoyi-online/src/main/java/com/ruoyi/online/domain/OnlineMb.java +++ b/ruoyi-online/src/main/java/com/ruoyi/online/domain/OnlineMb.java @@ -19,71 +19,71 @@ public class OnlineMb extends BaseEntity { private static final long serialVersionUID = 1L; /** 主键 */ - @Schema(defaultValue = "主键") + @Schema(title = "主键") private Long mbId; /** 标签名 */ - @Schema(defaultValue = "标签名") + @Schema(title = "标签名") @Excel(name = "标签名") private String tag; /** 标签id */ - @Schema(defaultValue = "标签id") + @Schema(title = "标签id") @Excel(name = "标签id") private String tagId; /** 参数类型 */ - @Schema(defaultValue = "参数类型") + @Schema(title = "参数类型") @Excel(name = "参数类型") private String parameterType; /** 结果类型 */ - @Schema(defaultValue = "结果类型") + @Schema(title = "结果类型") @Excel(name = "结果类型") private String resultMap; /** sql语句 */ - @Schema(defaultValue = "sql语句") + @Schema(title = "sql语句") @Excel(name = "sql语句") private String sql; /** 请求路径 */ - @Schema(defaultValue = "请求路径") + @Schema(title = "请求路径") @Excel(name = "请求路径") private String path; /** 请求方式 */ - @Schema(defaultValue = "请求方式") + @Schema(title = "请求方式") @Excel(name = "请求方式") private String method; /** 响应类型 */ - @Schema(defaultValue = "响应类型") + @Schema(title = "响应类型") @Excel(name = "响应类型") private String resultType; /** 执行器 */ - @Schema(defaultValue = "执行器") + @Schema(title = "执行器") @Excel(name = "执行器") private String actuator; /** 是否需要userId */ - @Schema(defaultValue = "是否需要userId") + @Schema(title = "是否需要userId") @Excel(name = "是否需要userId") private String userId; /** 是否需要deptId */ - @Schema(defaultValue = "是否需要deptId") + @Schema(title = "是否需要deptId") @Excel(name = "是否需要deptId") private String deptId; /** 许可类型 */ - @Schema(defaultValue = "许可类型") + @Schema(title = "许可类型") @Excel(name = "许可类型") private String permissionType; /** 许可值 */ - @Schema(defaultValue = "许可值") + @Schema(title = "许可值") @Excel(name = "许可值") private String permissionValue; diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java index 439b132..cdd6986 100644 --- a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java @@ -19,41 +19,41 @@ public class PayInvoice extends BaseEntity { private static final long serialVersionUID = 1L; /** 发票id */ - @Schema(defaultValue = "发票id") + @Schema(title = "发票id") private Long invoiceId; /** 订单号 */ - @Schema(defaultValue = "订单号") + @Schema(title = "订单号") @Excel(name = "订单号") private String orderNumber; /** 发票类型 */ - @Schema(defaultValue = "发票类型") + @Schema(title = "发票类型") @Excel(name = "发票类型") private String invoiceType; /** 发票抬头 */ - @Schema(defaultValue = "发票抬头") + @Schema(title = "发票抬头") @Excel(name = "发票抬头") private String invoiceHeader; /** 纳税人识别号 */ - @Schema(defaultValue = "纳税人识别号") + @Schema(title = "纳税人识别号") @Excel(name = "纳税人识别号") private String invoiceNumber; /** 收票人手机号 */ - @Schema(defaultValue = "收票人手机号") + @Schema(title = "收票人手机号") @Excel(name = "收票人手机号") private String invoicePhone; /** 收票人邮箱 */ - @Schema(defaultValue = "收票人邮箱") + @Schema(title = "收票人邮箱") @Excel(name = "收票人邮箱") private String invoiceEmail; /** 发票备注 */ - @Schema(defaultValue = "发票备注") + @Schema(title = "发票备注") @Excel(name = "发票备注") private String invoiceRemark; diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java index 59c796a..70992f0 100644 --- a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java @@ -14,46 +14,46 @@ import io.swagger.v3.oas.annotations.media.Schema; * @author ruoyi * @date 2024-02-15 */ -@Schema(description = "订单对象") +@Schema(title = "订单对象") public class PayOrder extends BaseEntity { private static final long serialVersionUID = 1L; /** 订单ID */ - @Schema(defaultValue = "订单ID") + @Schema(title = "订单ID") private Long orderId; /** 用户id */ - @Schema(defaultValue = "用户id") + @Schema(title = "用户id") @Excel(name = "用户id") private Long userId; /** 订单号 */ - @Schema(defaultValue = "订单号") + @Schema(title = "订单号") @Excel(name = "订单号") private String orderNumber; /** 订单状态 */ - @Schema(defaultValue = "订单状态") + @Schema(title = "订单状态") @Excel(name = "订单状态") private String orderStatus; /** 订单总金额 */ - @Schema(defaultValue = "订单总金额") + @Schema(title = "订单总金额") @Excel(name = "订单总金额") private String totalAmount; /** 订单内容 */ - @Schema(defaultValue = "订单内容") + @Schema(title = "订单内容") @Excel(name = "订单内容") private String orderContent; /** 订单备注 */ - @Schema(defaultValue = "订单备注") + @Schema(title = "订单备注") @Excel(name = "订单备注") private String orderRemark; /** 负载信息 */ - @Schema(defaultValue = "负载信息") + @Schema(title = "负载信息") @Excel(name = "负载信息") private String orderMessage; diff --git a/ruoyi-pay/ruoyi-pay-sqb/src/main/java/com/ruoyi/pay/sqb/controller/SQBController.java b/ruoyi-pay/ruoyi-pay-sqb/src/main/java/com/ruoyi/pay/sqb/controller/SQBController.java index 9566cb4..1a1cbd2 100644 --- a/ruoyi-pay/ruoyi-pay-sqb/src/main/java/com/ruoyi/pay/sqb/controller/SQBController.java +++ b/ruoyi-pay/ruoyi-pay-sqb/src/main/java/com/ruoyi/pay/sqb/controller/SQBController.java @@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.R; import com.ruoyi.pay.domain.PayOrder; import com.ruoyi.pay.service.IPayOrderService; import com.ruoyi.pay.sqb.service.Impl.SQBServiceImpl; @@ -33,14 +34,16 @@ public class SQBController extends BaseController { }) @PostMapping("/payUrl") @Anonymous - public AjaxResult payUrl(@RequestParam("id") String orderNumber) throws Exception { + public R payUrl(@RequestParam("id") String orderNumber) throws Exception { PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber); String url = sqbServiceImpl.payUrl(payOrder); - AjaxResult ajaxResult = new AjaxResult(200, url, "操作成功"); - return ajaxResult; + return R.ok(url); } @Operation(summary = "查询支付状态") + @Parameters(value = { + @Parameter(name = "id", description = "订单号", required = true) +}) @PostMapping("/query") @Anonymous public AjaxResult query(@RequestParam("id") String orderNumber) throws Exception {