diff --git a/.fastRequest/config/fastRequestCurrentProjectConfig.json b/.fastRequest/config/fastRequestCurrentProjectConfig.json
new file mode 100644
index 0000000..a1ecd01
--- /dev/null
+++ b/.fastRequest/config/fastRequestCurrentProjectConfig.json
@@ -0,0 +1,33 @@
+{
+ "apiDocTemplate":"#if (${namingPolicy}=='byDoc')\n$H1 ${methodDescription}\n#else\n$H1 $!{methodName}\n\n$H3 Method description\n\n```\n$!{methodDescription}\n```\n#end\n\n> URL: $!{url}\n>\n> Origin Url: $!{originUrl}\n>\n> Type: $!{methodType}\n\n\n$H3 Request headers\n\n|Header Name| Header Value|\n|---------|------|\n#foreach( $h in ${headerList})\n|$h.type|$h.value|\n#end\n\n$H3 Parameters\n\n$H5 Path parameters\n\n| Parameter | Type | Value | Description |\n|---------|------|------|------------|\n#foreach( $node in ${pathKeyValueList})\n|$node.key|$!{node.type}|$!{node.value}|$!{node.comment}|\n#end\n\n\n$H5 URL parameters\n\n|Required| Parameter | Type | Value | Description |\n|---------|---------|------|------|------------|\n#foreach( $node in ${urlParamsKeyValueList})\n|$!{node.enabled}|$!{node.key}|$!{node.type}|$!{node.value}|$!{node.comment}|\n#end\n\n\n$H5 Body parameters\n\n$H6 JSON\n\n```\n${jsonParam}\n```\n\n$H6 JSON document\n\n```\n${jsonParamDocument}\n```\n\n\n$H5 Form URL-Encoded\n|Required| Parameter | Type | Value | Description |\n|---------|---------|------|------|------------|\n#foreach( $node in ${urlEncodedKeyValueList})\n|$!{node.enabled}|$!{node.key}|$!{node.type}|$!{node.value}|$!{node.comment}|\n#end\n\n\n$H5 Multipart\n|Required | Parameter | Type | Value | Description |\n|---------|---------|------|------|------------|\n#foreach( $node in ${multipartKeyValueList})\n|$!{node.enabled}|$!{node.key}|$!{node.type}|$!{node.value}|$!{node.comment}|\n#end\n\n\n$H3 Response\n\n$H5 Response example\n\n```\n$!{responseExample}\n```\n\n$H5 Response document\n```\n$!{returnDocument}\n```\n\n\n",
+ "apifoxSetting":{
+ "domain":"https://api.apifox.com",
+ "syncAfterSave":false
+ },
+ "dataList":[],
+ "envList":[],
+ "headerList":[],
+ "ignoreParseFieldList":[],
+ "maxDescriptionLength":-1,
+ "pmCollectionId":"",
+ "postScript":"",
+ "preScript":"",
+ "projectList":[],
+ "syncModel":{
+ "branch":"master",
+ "domain":"https://github.com",
+ "enabled":false,
+ "gitToken":"",
+ "namingPolicy":"byDoc",
+ "owner":"",
+ "repo":"",
+ "repoUrl":"",
+ "syncAfterRun":false,
+ "type":"github"
+ },
+ "syncPmAfterSave":false,
+ "urlEncodedKeyValueList":[],
+ "urlParamsKeyValueList":[],
+ "urlSuffix":"",
+ "workspaceId":""
+}
\ No newline at end of file
diff --git a/.fastRequest/config/fastRequestCurrentProjectEnvironment.json b/.fastRequest/config/fastRequestCurrentProjectEnvironment.json
new file mode 100644
index 0000000..9759716
--- /dev/null
+++ b/.fastRequest/config/fastRequestCurrentProjectEnvironment.json
@@ -0,0 +1,6 @@
+{
+ "apifoxRelationMap":{},
+ "apifoxServerMap":{},
+ "environment":{},
+ "pmRelationMap":{}
+}
\ No newline at end of file
diff --git a/dillon-dependencies/pom.xml b/dillon-dependencies/pom.xml
index 40b5076..4959ea9 100644
--- a/dillon-dependencies/pom.xml
+++ b/dillon-dependencies/pom.xml
@@ -77,12 +77,11 @@
2.12.2
4.6.0
- 3.5
+ 3.5.2
1.5.3
2.5.1
- 13.3
@@ -653,44 +652,7 @@
${jfreechart.version}
-
-
- io.github.openfeign
- feign-core
- ${openfeign.version}
-
-
- io.github.openfeign
- feign-okhttp
- ${openfeign.version}
-
-
- io.github.openfeign
- feign-ribbon
- ${openfeign.version}
-
-
- io.github.openfeign
- feign-gson
- ${openfeign.version}
-
-
- io.github.openfeign
- feign-jackson
- ${openfeign.version}
-
-
- io.github.openfeign
- feign-slf4j
- ${openfeign.version}
-
-
-
- io.github.openfeign
- feign-form
- ${openfeign.version}
-
diff --git a/dillon-framework/dillon-spring-boot-starter-security/src/main/java/com/lw/dillon/admin/framework/security/core/filter/TokenAuthenticationFilter.java b/dillon-framework/dillon-spring-boot-starter-security/src/main/java/com/lw/dillon/admin/framework/security/core/filter/TokenAuthenticationFilter.java
index 53b6703..caa0f56 100644
--- a/dillon-framework/dillon-spring-boot-starter-security/src/main/java/com/lw/dillon/admin/framework/security/core/filter/TokenAuthenticationFilter.java
+++ b/dillon-framework/dillon-spring-boot-starter-security/src/main/java/com/lw/dillon/admin/framework/security/core/filter/TokenAuthenticationFilter.java
@@ -75,7 +75,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
return null;
}
// 用户类型不匹配,无权限
- // 注意:只有 /admin-api/* 和 /app-api/* 有 userType,才需要比对用户类型
+ // 注意:只有 /* 和 /app-api/* 有 userType,才需要比对用户类型
// 类似 WebSocket 的 /ws/* 连接地址,是不需要比对用户类型的
if (userType != null
&& ObjectUtil.notEqual(accessToken.getUserType(), userType)) {
diff --git a/dillon-framework/dillon-spring-boot-starter-web/src/main/java/com/lw/dillon/admin/framework/swagger/config/DillonSwaggerAutoConfiguration.java b/dillon-framework/dillon-spring-boot-starter-web/src/main/java/com/lw/dillon/admin/framework/swagger/config/DillonSwaggerAutoConfiguration.java
index ce8a015..94f3459 100644
--- a/dillon-framework/dillon-spring-boot-starter-web/src/main/java/com/lw/dillon/admin/framework/swagger/config/DillonSwaggerAutoConfiguration.java
+++ b/dillon-framework/dillon-spring-boot-starter-web/src/main/java/com/lw/dillon/admin/framework/swagger/config/DillonSwaggerAutoConfiguration.java
@@ -117,7 +117,7 @@ public class DillonSwaggerAutoConfiguration {
public static GroupedOpenApi buildGroupedOpenApi(String group, String path) {
return GroupedOpenApi.builder()
.group(group)
- .pathsToMatch("/admin-api/" + path + "/**", "/app-api/" + path + "/**")
+ .pathsToMatch("/" + path + "/**", "/app-api/" + path + "/**")
.addOperationCustomizer((operation, handlerMethod) -> operation
.addParametersItem(buildTenantHeaderParameter())
.addParametersItem(buildSecurityHeaderParameter()))
diff --git a/dillon-module-infra/dillon-module-infra-biz/src/main/java/com/lw/dillon/admin/module/infra/framework/file/core/client/AbstractFileClient.java b/dillon-module-infra/dillon-module-infra-biz/src/main/java/com/lw/dillon/admin/module/infra/framework/file/core/client/AbstractFileClient.java
index e292d3e..764de71 100644
--- a/dillon-module-infra/dillon-module-infra-biz/src/main/java/com/lw/dillon/admin/module/infra/framework/file/core/client/AbstractFileClient.java
+++ b/dillon-module-infra/dillon-module-infra-biz/src/main/java/com/lw/dillon/admin/module/infra/framework/file/core/client/AbstractFileClient.java
@@ -63,7 +63,7 @@ public abstract class AbstractFileClient implem
* @return URL 访问地址
*/
protected String formatFileUrl(String domain, String path) {
- return StrUtil.format("{}/admin-api/infra/file/{}/get/{}", domain, getId(), path);
+ return StrUtil.format("{}/infra/file/{}/get/{}", domain, getId(), path);
}
}
diff --git a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/controller/admin/tenant/TenantController.http b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/controller/admin/tenant/TenantController.http
index a4d5173..be07225 100644
--- a/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/controller/admin/tenant/TenantController.http
+++ b/dillon-module-system/dillon-module-system-biz/src/main/java/com/lw/dillon/admin/module/system/controller/admin/tenant/TenantController.http
@@ -1,7 +1,7 @@
-### 获取租户编号 /admin-api/system/get-id-by-name
+### 获取租户编号 /system/get-id-by-name
GET {{baseUrl}}/system/tenant/get-id-by-name?name=芋道源码
-### 创建租户 /admin-api/system/tenant/create
+### 创建租户 /system/tenant/create
POST {{baseUrl}}/system/tenant/create
Content-Type: application/json
Authorization: Bearer {{token}}
diff --git a/dillon-server/src/main/java/com/lw/dillon/admin/server/controller/DefaultController.java b/dillon-server/src/main/java/com/lw/dillon/admin/server/controller/DefaultController.java
index f3ded50..9d8d640 100644
--- a/dillon-server/src/main/java/com/lw/dillon/admin/server/controller/DefaultController.java
+++ b/dillon-server/src/main/java/com/lw/dillon/admin/server/controller/DefaultController.java
@@ -15,45 +15,45 @@ import static com.lw.dillon.admin.framework.common.exception.enums.GlobalErrorCo
@RestController
public class DefaultController {
- @RequestMapping("/admin-api/bpm/**")
+ @RequestMapping("/bpm/**")
public CommonResult bpm404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[工作流模块 dillon-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]");
}
- @RequestMapping("/admin-api/mp/**")
+ @RequestMapping("/mp/**")
public CommonResult mp404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[微信公众号 dillon-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]");
}
- @RequestMapping(value = {"/admin-api/product/**", // 商品中心
- "/admin-api/trade/**", // 交易中心
- "/admin-api/promotion/**"}) // 营销中心
+ @RequestMapping(value = {"/product/**", // 商品中心
+ "/trade/**", // 交易中心
+ "/promotion/**"}) // 营销中心
public CommonResult mall404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[商城系统 dillon-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]");
}
- @RequestMapping("/admin-api/erp/**")
+ @RequestMapping("/erp/**")
public CommonResult erp404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[ERP 模块 dillon-module-erp - 已禁用][参考 https://doc.iocoder.cn/erp/build/ 开启]");
}
- @RequestMapping("/admin-api/crm/**")
+ @RequestMapping("/crm/**")
public CommonResult crm404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[CRM 模块 dillon-module-crm - 已禁用][参考 https://doc.iocoder.cn/crm/build/ 开启]");
}
- @RequestMapping(value = {"/admin-api/report/**"})
+ @RequestMapping(value = {"/report/**"})
public CommonResult report404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[报表模块 dillon-module-report - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]");
}
- @RequestMapping(value = {"/admin-api/pay/**"})
+ @RequestMapping(value = {"/pay/**"})
public CommonResult pay404() {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[支付模块 dillon-module-pay - 已禁用][参考 https://doc.iocoder.cn/pay/build/ 开启]");
diff --git a/dillon-server/src/main/resources/application-dev.yaml b/dillon-server/src/main/resources/application-dev.yaml
index 2b63d01..dbfc7f0 100644
--- a/dillon-server/src/main/resources/application-dev.yaml
+++ b/dillon-server/src/main/resources/application-dev.yaml
@@ -170,8 +170,8 @@ dillon:
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
pay:
- order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
- refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
+ order-notify-url: http://yunai.natapp1.cc/pay/notify/order # 支付渠道的【支付】回调地址
+ refund-notify-url: http://yunai.natapp1.cc/pay/notify/refund # 支付渠道的【退款】回调地址
demo: true # 开启演示模式
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
diff --git a/dillon-server/src/main/resources/application-local.yaml b/dillon-server/src/main/resources/application-local.yaml
index b105204..96cf431 100644
--- a/dillon-server/src/main/resources/application-local.yaml
+++ b/dillon-server/src/main/resources/application-local.yaml
@@ -215,8 +215,8 @@ dillon:
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
pay:
- order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
- refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
+ order-notify-url: http://yunai.natapp1.cc/pay/notify/order # 支付渠道的【支付】回调地址
+ refund-notify-url: http://yunai.natapp1.cc/pay/notify/refund # 支付渠道的【退款】回调地址
access-log: # 访问日志的配置项
enable: false
demo: false # 关闭演示模式
diff --git a/dillon-server/src/main/resources/application.yaml b/dillon-server/src/main/resources/application.yaml
index d037e9f..a178ab1 100644
--- a/dillon-server/src/main/resources/application.yaml
+++ b/dillon-server/src/main/resources/application.yaml
@@ -153,7 +153,7 @@ dillon:
url: http://dashboard.dillon.iocoder.cn # Admin 管理后台 UI 的地址
security:
permit-all_urls:
- - /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
+ - /mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
websocket:
enable: true # websocket的开关
path: /infra/ws # 路径
@@ -184,15 +184,15 @@ dillon:
tenant: # 多租户相关配置项
enable: false
ignore-urls:
- - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
- - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
- - /admin-api/system/captcha/get # 获取图片验证码,和租户无关
- - /admin-api/system/captcha/check # 校验图片验证码,和租户无关
- - /admin-api/infra/file/*/get/** # 获取图片,和租户无关
- - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
- - /admin-api/pay/notify/** # 支付回调通知,不携带租户编号
+ - /system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
+ - /system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
+ - /system/captcha/get # 获取图片验证码,和租户无关
+ - /system/captcha/check # 校验图片验证码,和租户无关
+ - /infra/file/*/get/** # 获取图片,和租户无关
+ - /system/sms/callback/* # 短信回调接口,无法带上租户编号
+ - /pay/notify/** # 支付回调通知,不携带租户编号
- /jmreport/* # 积木报表,无法携带租户编号
- - /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
+ - /mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
ignore-tables:
- system_tenant
- system_tenant_package
diff --git a/dillon-ui/dillon-ui-common/pom.xml b/dillon-ui/dillon-ui-common/pom.xml
index a0dff6c..c3c8a8e 100644
--- a/dillon-ui/dillon-ui-common/pom.xml
+++ b/dillon-ui/dillon-ui-common/pom.xml
@@ -20,37 +20,56 @@
8
8
UTF-8
+ 13.5
+
io.github.openfeign
feign-core
+ ${openfeign.version}
+
io.github.openfeign
feign-okhttp
+ ${openfeign.version}
io.github.openfeign
feign-ribbon
+ ${openfeign.version}
io.github.openfeign
feign-gson
+ ${openfeign.version}
io.github.openfeign
feign-jackson
+ ${openfeign.version}
io.github.openfeign
feign-slf4j
+ ${openfeign.version}
- io.github.openfeign.form
+ io.github.openfeign
+ feign-hystrix
+ ${openfeign.version}
+
+
+ io.github.openfeign
feign-form
- 3.8.0
+ ${openfeign.version}
+
+
+ com.netflix.ribbon
+ ribbon-httpclient
+ 2.7.18
io.github.openfeign.form
@@ -82,6 +101,7 @@
2.1.0-jdk8-snapshot
compile
+
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiAccessLogFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiAccessLogFeign.java
index 8383e72..2fe428e 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiAccessLogFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiAccessLogFeign.java
@@ -13,7 +13,7 @@ public interface ApiAccessLogFeign extends BaseFeignApi {
// "获得API 访问日志分页")
- @RequestLine("GET /admin-api/infra/api-access-log/page")
+ @RequestLine("GET /infra/api-access-log/page")
CommonResult> getApiAccessLogPage(@QueryMap Map pageReqVO);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiErrorLogFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiErrorLogFeign.java
index a629002..98acb92 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiErrorLogFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/apilog/ApiErrorLogFeign.java
@@ -15,12 +15,12 @@ public interface ApiErrorLogFeign extends BaseFeignApi {
// "更新 API 错误日志的状态")
- @RequestLine("PUT /admin-api/infra/api-error-log/update-status?id={id}&processStatus={processStatus}")
+ @RequestLine("PUT /infra/api-error-log/update-status?id={id}&processStatus={processStatus}")
CommonResult updateApiErrorLogProcess(@Param("id") Long id,
@Param("processStatus") Integer processStatus);
// "获得 API 错误日志分页")
- @RequestLine("GET /admin-api/infra/api-error-log/page")
+ @RequestLine("GET /infra/api-error-log/page")
CommonResult> getApiErrorLogPage(@QueryMap Map pageReqVO);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java
index 93f2870..72a644b 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/config/ConfigFeign.java
@@ -14,32 +14,32 @@ import java.util.Map;
public interface ConfigFeign extends BaseFeignApi {
//"创建参数配置")
- @RequestLine("POST /admin-api/infra/config/create")
+ @RequestLine("POST /infra/config/create")
public CommonResult createConfig(ConfigSaveReqVO createReqVO);
//"修改参数配置")
- @RequestLine("PUT /admin-api/infra/config/update")
+ @RequestLine("PUT /infra/config/update")
public CommonResult updateConfig(ConfigSaveReqVO updateReqVO);
//"删除参数配置")
- @RequestLine("DELETE /admin-api/infra/config/delete?id={id}")
+ @RequestLine("DELETE /infra/config/delete?id={id}")
public CommonResult deleteConfig(@Param("id") Long id);
//"获得参数配置")
- @RequestLine("GET /admin-api/infra/config/get?id={id}")
+ @RequestLine("GET /infra/config/get?id={id}")
public CommonResult getConfig(@Param("id") Long id);
//"根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
- @RequestLine("GET /admin-api/infra/config/get-value-by-key?key={key}")
+ @RequestLine("GET /infra/config/get-value-by-key?key={key}")
public CommonResult getConfigKey(@Param("key") String key);
//"根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
- @RequestLine("GET /admin-api/infra/config/get-by-key?key={key}")
+ @RequestLine("GET /infra/config/get-by-key?key={key}")
public CommonResult getConfig(@Param("key") String key);
//"获取参数配置分页")
- @RequestLine("GET /admin-api/infra/config/page")
+ @RequestLine("GET /infra/config/page")
public CommonResult> getConfigPage(@QueryMap Map pageReqVO);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileConfigFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileConfigFeign.java
index 759d86b..585ad0b 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileConfigFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileConfigFeign.java
@@ -14,30 +14,30 @@ import java.util.Map;
public interface FileConfigFeign extends BaseFeignApi {
//"创建文件配置")
- @RequestLine("POST /admin-api/infra/file-config/create")
+ @RequestLine("POST /infra/file-config/create")
CommonResult createFileConfig( FileConfigSaveReqVO createReqVO);
//"更新文件配置")
- @RequestLine("PUT /admin-api/infra/file-config/update")
+ @RequestLine("PUT /infra/file-config/update")
CommonResult updateFileConfig( FileConfigSaveReqVO updateReqVO);
//"更新文件配置为 Master")
- @RequestLine("PUT /admin-api/infra/file-config/update-master?id={id}")
+ @RequestLine("PUT /infra/file-config/update-master?id={id}")
CommonResult updateFileConfigMaster(@Param("id") Long id);
//"删除文件配置")
- @RequestLine("DELETE /admin-api/infra/file-config/delete?id={id}")
+ @RequestLine("DELETE /infra/file-config/delete?id={id}")
CommonResult deleteFileConfig(@Param("id") Long id);
//"获得文件配置")
- @RequestLine("GET /admin-api/infra/file-config/get?id={id}")
+ @RequestLine("GET /infra/file-config/get?id={id}")
CommonResult getFileConfig(@Param("id") Long id);
//"获得文件配置分页")
- @RequestLine("GET /admin-api/infra/file-config/page")
+ @RequestLine("GET /infra/file-config/page")
CommonResult> getFileConfigPage(@QueryMap Map map);
//"测试文件配置是否正确")
- @RequestLine("GET /admin-api/infra/file-config/test?id={id}")
+ @RequestLine("GET /infra/file-config/test?id={id}")
CommonResult testFileConfig(@Param("id") Long id) throws Exception;
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileFeign.java
index 71247de..105200a 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/file/FileFeign.java
@@ -18,29 +18,29 @@ public interface FileFeign extends BaseFeignApi {
// "上传文件", description = "模式一:后端上传文件")
- @RequestLine("POST /admin-api/infra/file/upload")
+ @RequestLine("POST /infra/file/upload")
@Headers("Content-Type: multipart/form-data; boundary=----WebKitFormBoundarypATHfppjzqwXomVO")
CommonResult uploadFile(@Param("path") String path, @Param("file") File file);
// "获取文件预签名地址", description = "模式二:前端上传文件:用于前端直接上传七牛、阿里云 OSS 等文件存储器")
- @RequestLine("GET /admin-api/infra/file/presigned-url?path={path}")
+ @RequestLine("GET /infra/file/presigned-url?path={path}")
CommonResult getFilePresignedUrl(@Param("path") String path);
// "创建文件", description = "模式二:前端上传文件:配合 presigned-url 接口,记录上传了上传的文件")
- @RequestLine("POST /admin-api/infra/file/create")
+ @RequestLine("POST /infra/file/create")
CommonResult createFile(FileCreateReqVO createReqVO);
// "删除文件")
- @RequestLine("DELETE /admin-api/infra/file/delete?id={id}")
+ @RequestLine("DELETE /infra/file/delete?id={id}")
CommonResult deleteFile(@Param("id") Long id);
// "下载文件")
- @RequestLine("GET /admin-api/infra/file/{configId}/get/**")
+ @RequestLine("GET /infra/file/{configId}/get/**")
void getFileContent(@Param("configId") Long configId) throws Exception;
// "获得文件分页")
- @RequestLine("GET /admin-api/infra/file/page")
+ @RequestLine("GET /infra/file/page")
CommonResult> getFilePage(@QueryMap Map pageVO);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobFeign.java
index c58b9cc..1e8c3db 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobFeign.java
@@ -17,41 +17,41 @@ public interface JobFeign extends BaseFeignApi {
// "创建定时任务")
- @RequestLine("POST /admin-api/infra/job/create")
+ @RequestLine("POST /infra/job/create")
CommonResult createJob(JobSaveReqVO createReqVO);
// "更新定时任务")
- @RequestLine("PUT /admin-api/infra/job/update")
+ @RequestLine("PUT /infra/job/update")
CommonResult updateJob(JobSaveReqVO updateReqVO);
// "更新定时任务的状态")
- @RequestLine("PUT /admin-api/infra/job/update-status?id={id}&status={status}")
+ @RequestLine("PUT /infra/job/update-status?id={id}&status={status}")
CommonResult updateJobStatus(@Param("id") Long id, @Param("status") Integer status);
// "删除定时任务")
- @RequestLine("DELETE /admin-api/infra/job/delete?id={id}")
+ @RequestLine("DELETE /infra/job/delete?id={id}")
CommonResult deleteJob(@Param("id") Long id);
// "触发定时任务")
- @RequestLine("PUT /admin-api/infra/job/trigger?id={id}")
+ @RequestLine("PUT /infra/job/trigger?id={id}")
CommonResult triggerJob(@Param("id") Long id);
// "同步定时任务")
- @RequestLine("POST /admin-api/infra/job/sync")
+ @RequestLine("POST /infra/job/sync")
CommonResult syncJob();
// "获得定时任务")
- @RequestLine("GET /admin-api/infra/job/get?id={id}")
+ @RequestLine("GET /infra/job/get?id={id}")
CommonResult getJob(@Param("id") Long id);
// "获得定时任务分页")
- @RequestLine("GET /admin-api/infra/job/page")
+ @RequestLine("GET /infra/job/page")
CommonResult> getJobPage(@QueryMap Map pageVO);
// "获得定时任务的下 n 次执行时间")
- @RequestLine("GET /admin-api/infra/job/get_next_times?id={id}&count={count}")
+ @RequestLine("GET /infra/job/get_next_times?id={id}&count={count}")
CommonResult> getJobNextTimes(
@Param("id") Long id,
@Param("count") Integer count);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobLogFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobLogFeign.java
index ae2f358..ef2df76 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobLogFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/job/JobLogFeign.java
@@ -14,11 +14,11 @@ public interface JobLogFeign extends BaseFeignApi {
//"获得定时任务日志")
- @RequestLine("GET /admin-api/infra/job-log/get?id={id}")
+ @RequestLine("GET /infra/job-log/get?id={id}")
CommonResult getJobLog(@Param("id") Long id);
//"获得定时任务日志分页")
- @RequestLine("GET /admin-api/infra/job-log/page")
+ @RequestLine("GET /infra/job-log/page")
CommonResult> getJobLogPage(@QueryMap Map pageVO);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/AuthFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/AuthFeign.java
index 812e5f7..2723516 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/AuthFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/AuthFeign.java
@@ -10,10 +10,10 @@ import feign.RequestLine;
public interface AuthFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/auth/login")
+ @RequestLine("POST /system/auth/login")
CommonResult login(AuthLoginReqVO authLoginReqVO);
- @RequestLine("POST /admin-api/system/auth/logout")
+ @RequestLine("POST /system/auth/logout")
CommonResult logout();
/**
@@ -21,6 +21,6 @@ public interface AuthFeign extends BaseFeignApi {
*
* @return {@link CommonResult }<{@link AuthPermissionInfoRespVO }>
*/
- @RequestLine("GET /admin-api/system/auth/get-permission-info")
+ @RequestLine("GET /system/auth/get-permission-info")
CommonResult getPermissionInfo();
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DeptFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DeptFeign.java
index 40e7e10..8c74db1 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DeptFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DeptFeign.java
@@ -15,22 +15,22 @@ import java.util.List;
public interface DeptFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/dept/create")
+ @RequestLine("POST /system/dept/create")
CommonResult createDept( DeptSaveReqVO createReqVO);
- @RequestLine("PUT /admin-api/system/dept/update")
+ @RequestLine("PUT /system/dept/update")
CommonResult updateDept( DeptSaveReqVO updateReqVO);
- @RequestLine("DELETE /admin-api/system/dept/delete?id={id}")
+ @RequestLine("DELETE /system/dept/delete?id={id}")
CommonResult deleteDept(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/dept/list")
+ @RequestLine("GET /system/dept/list")
CommonResult> getDeptList(@QueryMap DeptListReqVO reqVO);
- @RequestLine("GET /admin-api/system/dept/simple-list")
+ @RequestLine("GET /system/dept/simple-list")
CommonResult> getSimpleDeptList();
- @RequestLine("GET /admin-api/system/dept/get?id={id}")
+ @RequestLine("GET /system/dept/get?id={id}")
CommonResult getDept(@Param("id") Long id);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictDataFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictDataFeign.java
index 0636b2d..b075c03 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictDataFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictDataFeign.java
@@ -16,22 +16,22 @@ import java.util.Map;
public interface DictDataFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/dict-data/create")
+ @RequestLine("POST /system/dict-data/create")
CommonResult createDictData(DictDataSaveReqVO createReqVO);
- @RequestLine("PUT /admin-api/system/dict-data/update")
+ @RequestLine("PUT /system/dict-data/update")
CommonResult updateDictData(DictDataSaveReqVO updateReqVO);
- @RequestLine("DELETE /admin-api/system/dict-data/delete?id={id}")
+ @RequestLine("DELETE /system/dict-data/delete?id={id}")
CommonResult deleteDictData(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/dict-data/simple-list")
+ @RequestLine("GET /system/dict-data/simple-list")
CommonResult> getSimpleDictDataList();
- @RequestLine("GET /admin-api/system/dict-data/page")
+ @RequestLine("GET /system/dict-data/page")
CommonResult> getDictTypePage(@QueryMap Map map);
- @RequestLine("GET /admin-api/system/dict-data/get?id={id}")
+ @RequestLine("GET /system/dict-data/get?id={id}")
CommonResult getDictData(@Param("id") Long id);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictTypeFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictTypeFeign.java
index 6ed4f14..eba08e1 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictTypeFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/DictTypeFeign.java
@@ -17,22 +17,22 @@ import java.util.Map;
public interface DictTypeFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/dict-type/create")
+ @RequestLine("POST /system/dict-type/create")
CommonResult createDictType( DictTypeSaveReqVO createReqVO);
- @RequestLine("PUT /admin-api/system/dict-type/update")
+ @RequestLine("PUT /system/dict-type/update")
CommonResult updateDictType( DictTypeSaveReqVO updateReqVO);
- @RequestLine("DELETE /admin-api/system/dict-type/delete?id={id}")
+ @RequestLine("DELETE /system/dict-type/delete?id={id}")
CommonResult deleteDictType(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/dict-type/page")
+ @RequestLine("GET /system/dict-type/page")
CommonResult> pageDictTypes(@QueryMap Map map);
- @RequestLine("GET /admin-api/system/dict-type/get?id={id}")
+ @RequestLine("GET /system/dict-type/get?id={id}")
CommonResult getDictType(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/dict-type/simple-list")
+ @RequestLine("GET /system/dict-type/simple-list")
// 无需添加权限认证,因为前端全局都需要
CommonResult> getSimpleDictTypeList();
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/LoginLogFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/LoginLogFeign.java
index e829d58..b4498c7 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/LoginLogFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/LoginLogFeign.java
@@ -14,13 +14,13 @@ import java.util.Map;
public interface LoginLogFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/login-log/page")
+ @RequestLine("GET /system/login-log/page")
CommonResult> getLoginLogPage(@QueryMap Map map);
- @RequestLine("DELETE /admin-api/system/login-log/delete?id={id}")
+ @RequestLine("DELETE /system/login-log/delete?id={id}")
CommonResult deleteLoginLog(@Param("id") Long id);
- @RequestLine("DELETE /admin-api/system/login-log/clear")
+ @RequestLine("DELETE /system/login-log/clear")
CommonResult clearLoginLog();
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/MenuFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/MenuFeign.java
index 044e792..bcbdec4 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/MenuFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/MenuFeign.java
@@ -15,22 +15,22 @@ import java.util.List;
public interface MenuFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/menu/list")
+ @RequestLine("GET /system/menu/list")
CommonResult> getMenuList(@QueryMap MenuListReqVO reqVO);
- @RequestLine("POST /admin-api/system/menu/create")
+ @RequestLine("POST /system/menu/create")
CommonResult createMenu( MenuSaveVO createReqVO);
- @RequestLine("PUT /admin-api/system/menu/update")
+ @RequestLine("PUT /system/menu/update")
CommonResult updateMenu(MenuSaveVO updateReqVO);
- @RequestLine("DELETE /admin-api/system/menu/delete?id={id}")
+ @RequestLine("DELETE /system/menu/delete?id={id}")
CommonResult deleteMenu(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/menu/simple-list")
+ @RequestLine("GET /system/menu/simple-list")
CommonResult> getSimpleMenuList();
- @RequestLine("GET /admin-api/system/menu/get?id={id}")
+ @RequestLine("GET /system/menu/get?id={id}")
CommonResult getMenu(@Param("id") Long id);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NoticeFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NoticeFeign.java
index b7280d1..ad902e0 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NoticeFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NoticeFeign.java
@@ -15,22 +15,22 @@ import java.util.Map;
public interface NoticeFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/notice/create")
+ @RequestLine("POST /system/notice/create")
CommonResult createNotice(NoticeSaveReqVO createReqVO);
- @RequestLine("PUT /admin-api/system/notice/update")
+ @RequestLine("PUT /system/notice/update")
CommonResult updateNotice(NoticeSaveReqVO updateReqVO);
- @RequestLine("DELETE /admin-api/system/notice/delete?id={id}")
+ @RequestLine("DELETE /system/notice/delete?id={id}")
CommonResult deleteNotice(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/notice/page")
+ @RequestLine("GET /system/notice/page")
CommonResult> getNoticePage(@QueryMap Map map);
- @RequestLine("GET /admin-api/system/notice/get?id={id}")
+ @RequestLine("GET /system/notice/get?id={id}")
CommonResult getNotice(@Param("id") Long id);
- @RequestLine("POST /admin-api/system/notice/push?id={id}")
+ @RequestLine("POST /system/notice/push?id={id}")
CommonResult push(@Param("id")Long id);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyMessageFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyMessageFeign.java
index c95ffd4..9bc6b69 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyMessageFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyMessageFeign.java
@@ -17,31 +17,31 @@ public interface NotifyMessageFeign extends BaseFeignApi {
// ========== 管理所有的站内信 ==========
//获得站内信")
- @RequestLine("GET /admin-api/system/notify-message/get?id={id}")
+ @RequestLine("GET /system/notify-message/get?id={id}")
CommonResult getNotifyMessage(@Param("id") Long id);
//获得站内信分页")
- @RequestLine("GET /admin-api/system/notify-message/page")
+ @RequestLine("GET /system/notify-message/page")
CommonResult> getNotifyMessagePage(@QueryMap Map pageVO);
// ========== 查看自己的站内信 ==========
//获得我的站内信分页"
- @RequestLine("GET /admin-api/system/notify-message/my-page")
+ @RequestLine("GET /system/notify-message/my-page")
CommonResult> getMyMyNotifyMessagePage(@QueryMap Map pageVO);
//标记站内信为已读")
- @RequestLine("PUT /admin-api/system/notify-message/update-read?ids={ids}")
+ @RequestLine("PUT /system/notify-message/update-read?ids={ids}")
CommonResult updateNotifyMessageRead( @Param("ids")List ids);
//标记所有站内信为已读")
- @RequestLine("PUT /admin-api/system/notify-message/update-all-read")
+ @RequestLine("PUT /system/notify-message/update-all-read")
CommonResult updateAllNotifyMessageRead();
- @RequestLine("GET /admin-api/system/notify-message/get-unread-list?size={size}")
+ @RequestLine("GET /system/notify-message/get-unread-list?size={size}")
CommonResult> getUnreadNotifyMessageList(@Param("size") Integer size);
//获得当前用户的未读站内信数量")
- @RequestLine("GET /admin-api/system/notify-message/get-unread-count")
+ @RequestLine("GET /system/notify-message/get-unread-count")
CommonResult getUnreadNotifyMessageCount();
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyTemplateFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyTemplateFeign.java
index 648f9c5..a9dc942 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyTemplateFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/NotifyTemplateFeign.java
@@ -16,26 +16,26 @@ import java.util.Map;
@Tag(name = "管理后台 - 站内信模版")
public interface NotifyTemplateFeign extends BaseFeignApi {
//"创建站内信模版")
- @RequestLine("POST /admin-api/system/notify-template/create")
+ @RequestLine("POST /system/notify-template/create")
CommonResult createNotifyTemplate(NotifyTemplateSaveReqVO createReqVO);
//"更新站内信模版")
- @RequestLine("PUT /admin-api/system/notify-template/update")
+ @RequestLine("PUT /system/notify-template/update")
CommonResult updateNotifyTemplate(NotifyTemplateSaveReqVO updateReqVO);
//"删除站内信模版")
- @RequestLine("DELETE /admin-api/system/notify-template/delete?id={id}")
+ @RequestLine("DELETE /system/notify-template/delete?id={id}")
CommonResult deleteNotifyTemplate(@Param("id") Long id);
//"获得站内信模版")
- @RequestLine("GET /admin-api/system/notify-template/get?id={id}")
+ @RequestLine("GET /system/notify-template/get?id={id}")
CommonResult getNotifyTemplate(@Param("id") Long id);
//"获得站内信模版分页")
- @RequestLine("GET /admin-api/system/notify-template/page")
+ @RequestLine("GET /system/notify-template/page")
CommonResult> getNotifyTemplatePage(@QueryMap Map pageVO);
//"发送站内信")
- @RequestLine("POST /admin-api/system/notify-template/send-notify")
+ @RequestLine("POST /system/notify-template/send-notify")
CommonResult sendNotify(NotifyTemplateSendReqVO sendReqVO);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2ClientFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2ClientFeign.java
new file mode 100644
index 0000000..9411a38
--- /dev/null
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2ClientFeign.java
@@ -0,0 +1,37 @@
+package com.lw.ui.request.api.system;
+
+import com.lw.dillon.admin.framework.common.pojo.CommonResult;
+import com.lw.dillon.admin.framework.common.pojo.PageResult;
+import com.lw.dillon.admin.module.system.controller.admin.oauth2.vo.client.OAuth2ClientRespVO;
+import com.lw.dillon.admin.module.system.controller.admin.oauth2.vo.client.OAuth2ClientSaveReqVO;
+import com.lw.ui.request.api.BaseFeignApi;
+import feign.Param;
+import feign.QueryMap;
+import feign.RequestLine;
+
+import java.util.Map;
+
+public interface OAuth2ClientFeign extends BaseFeignApi {
+
+
+ //(summary = "创建 OAuth2 客户端")
+ @RequestLine("POST /system/oauth2-client/create")
+ CommonResult createOAuth2Client(OAuth2ClientSaveReqVO createReqVO);
+
+ //(summary = "更新 OAuth2 客户端")
+ @RequestLine("PUT /system/oauth2-client/update")
+ CommonResult updateOAuth2Client(OAuth2ClientSaveReqVO updateReqVO);
+
+ //(summary = "删除 OAuth2 客户端")
+ @RequestLine("DELETE /system/oauth2-client/delete")
+ CommonResult deleteOAuth2Client(@Param("id") Long id);
+
+ //(summary = "获得 OAuth2 客户端")
+ @RequestLine("GET /system/oauth2-client/get?id={id}")
+ CommonResult getOAuth2Client(@Param("id") Long id);
+
+ //(summary = "获得 OAuth2 客户端分页")
+ @RequestLine("GET /system/oauth2-client/page")
+ CommonResult> getOAuth2ClientPage(@QueryMap Map params);
+
+}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2TokenFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2TokenFeign.java
index f19d1ce..5e5c7bd 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2TokenFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OAuth2TokenFeign.java
@@ -13,10 +13,10 @@ import java.util.Map;
public interface OAuth2TokenFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/oauth2-token/page")
+ @RequestLine("GET /system/oauth2-token/page")
CommonResult> getAccessTokenPage(@QueryMap Map reqVO);
- @RequestLine("DELETE /admin-api/system/oauth2-token/delete?accessToken={accessToken}")
+ @RequestLine("DELETE /system/oauth2-token/delete?accessToken={accessToken}")
CommonResult deleteAccessToken(@Param("accessToken") String accessToken);
}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OperateLogFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OperateLogFeign.java
index 43396cc..1709566 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OperateLogFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/OperateLogFeign.java
@@ -14,14 +14,14 @@ import java.util.Map;
public interface OperateLogFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/operate-log/page")
+ @RequestLine("GET /system/operate-log/page")
CommonResult> pageOperateLog(@QueryMap Map map);
- @RequestLine("DELETE /admin-api/system/operate-log/delete?id={id}")
+ @RequestLine("DELETE /system/operate-log/delete?id={id}")
CommonResult deleteOperateLog(@Param("id") Long id);
- @RequestLine("DELETE /admin-api/system/operate-log/clear")
+ @RequestLine("DELETE /system/operate-log/clear")
CommonResult clearOperateLog();
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PermissionFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PermissionFeign.java
index 2dfd58e..feee163 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PermissionFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PermissionFeign.java
@@ -17,18 +17,18 @@ import java.util.Set;
*/
public interface PermissionFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/permission/list-role-menus?roleId={roleId}")
+ @RequestLine("GET /system/permission/list-role-menus?roleId={roleId}")
CommonResult> getRoleMenuList(@Param("roleId") Long roleId);
- @RequestLine("POST /admin-api/system/permission/assign-role-menu")
+ @RequestLine("POST /system/permission/assign-role-menu")
CommonResult assignRoleMenu(PermissionAssignRoleMenuReqVO reqVO);
- @RequestLine("POST /admin-api/system/permission/assign-role-data-scope")
+ @RequestLine("POST /system/permission/assign-role-data-scope")
CommonResult assignRoleDataScope(PermissionAssignRoleDataScopeReqVO reqVO);
- @RequestLine("GET /admin-api/system/permission/list-user-roles?userId={userId}")
+ @RequestLine("GET /system/permission/list-user-roles?userId={userId}")
CommonResult> listAdminRoles(@Param("userId") Long userId);
- @RequestLine("POST /admin-api/system/permission/assign-user-role")
+ @RequestLine("POST /system/permission/assign-user-role")
CommonResult assignUserRole(PermissionAssignUserRoleReqVO reqVO);
}
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PostFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PostFeign.java
index 8854970..7663b5f 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PostFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/PostFeign.java
@@ -16,22 +16,22 @@ import java.util.Map;
public interface PostFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/post/create")
+ @RequestLine("POST /system/post/create")
public CommonResult createPost(PostSaveReqVO createReqVO) ;
- @RequestLine("PUT /admin-api/system/post/update")
+ @RequestLine("PUT /system/post/update")
public CommonResult updatePost( PostSaveReqVO updateReqVO) ;
- @RequestLine("DELETE /admin-api/system/post/delete?id={id}")
+ @RequestLine("DELETE /system/post/delete?id={id}")
public CommonResult deletePost(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/post/get?id={id}")
+ @RequestLine("GET /system/post/get?id={id}")
public CommonResult getPost(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/post/simple-list")
+ @RequestLine("GET /system/post/simple-list")
public CommonResult> getSimplePostList() ;
- @RequestLine("GET /admin-api/system/post/page")
+ @RequestLine("GET /system/post/page")
public CommonResult> getPostPage(@QueryMap Map queryMap);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/RoleFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/RoleFeign.java
index 2192642..ed2cf0e 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/RoleFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/RoleFeign.java
@@ -19,26 +19,22 @@ import java.util.Map;
public interface RoleFeign extends BaseFeignApi {
- @PostMapping("/create")
- @RequestLine("POST /admin-api/system/role/create")
+ @RequestLine("POST /system/role/create")
CommonResult createRole( RoleSaveReqVO createReqVO);
- @PutMapping("/update")
- @RequestLine("PUT /admin-api/system/role/update")
+ @RequestLine("PUT /system/role/update")
CommonResult updateRole(RoleSaveReqVO updateReqVO);
- @DeleteMapping("/delete")
- @RequestLine("DELETE /admin-api/system/role/delete?id={id}")
+ @RequestLine("DELETE /system/role/delete?id={id}")
CommonResult deleteRole(@Param("id") Long id);
- @GetMapping("/get")
- @RequestLine("GET /admin-api/system/role/get?id={id}")
+ @RequestLine("GET /system/role/get?id={id}")
CommonResult getRole(@Param("id") Long id);
- @RequestLine("GET /admin-api/system/role/page")
+ @RequestLine("GET /system/role/page")
CommonResult> getRolePage(@QueryMap Map queryMay);
- @RequestLine("GET /admin-api/system/role/simple-list")
+ @RequestLine("GET /system/role/simple-list")
CommonResult> getSimpleRoleList();
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserFeign.java
index 3d39c37..74556c8 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserFeign.java
@@ -14,28 +14,28 @@ import java.util.Map;
public interface UserFeign extends BaseFeignApi {
- @RequestLine("POST /admin-api/system/user/create")
+ @RequestLine("POST /system/user/create")
CommonResult createUser(UserSaveReqVO reqVO);
- @RequestLine("PUT /admin-api/system/user/update")
+ @RequestLine("PUT /system/user/update")
CommonResult updateUser(UserSaveReqVO reqVO);
- @RequestLine("DELETE /admin-api/system/user/delete?id={id}")
+ @RequestLine("DELETE /system/user/delete?id={id}")
CommonResult deleteUser(@Param("id") Long id);
- @RequestLine("PUT /admin-api/system/user/update-password")
+ @RequestLine("PUT /system/user/update-password")
CommonResult updateUserPassword(UserUpdatePasswordReqVO reqVO);
- @RequestLine("PUT /admin-api/system/user/update-status")
+ @RequestLine("PUT /system/user/update-status")
CommonResult updateUserStatus(UserUpdateStatusReqVO reqVO);
- @RequestLine("GET /admin-api/system/user/page")
+ @RequestLine("GET /system/user/page")
CommonResult> getUserPage(@QueryMap Map queryMap);
- @RequestLine("GET /admin-api/system/user/simple-list")
+ @RequestLine("GET /system/user/simple-list")
CommonResult> getSimpleUserList();
- @RequestLine("GET /admin-api/system/user/get?id={id}")
+ @RequestLine("GET /system/user/get?id={id}")
CommonResult getUser(@Param("id") Long id);
diff --git a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserProfileFeign.java b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserProfileFeign.java
index 5bd7b64..8b0f296 100644
--- a/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserProfileFeign.java
+++ b/dillon-ui/dillon-ui-common/src/main/java/com/lw/ui/request/api/system/UserProfileFeign.java
@@ -13,18 +13,18 @@ import org.springframework.web.multipart.MultipartFile;
public interface UserProfileFeign extends BaseFeignApi {
- @RequestLine("GET /admin-api/system/user/profile/get")
+ @RequestLine("GET /system/user/profile/get")
CommonResult getUserProfile();
- @RequestLine("PUT /admin-api/system/user/profile/update")
+ @RequestLine("PUT /system/user/profile/update")
CommonResult updateUserProfile(UserProfileUpdateReqVO reqVO);
@PutMapping("/update-password")
- @RequestLine("PUT /admin-api/system/user/profile/update-password")
+ @RequestLine("PUT /system/user/profile/update-password")
CommonResult updateUserProfilePassword(UserProfileUpdatePasswordReqVO reqVO);
- @RequestLine("POST /admin-api/system/user/profile/update-avatar")
+ @RequestLine("POST /system/user/profile/update-avatar")
CommonResult updateUserAvatar(MultipartFile file) throws Exception;
}
diff --git a/dillon-ui/dillon-ui-fx/pom.xml b/dillon-ui/dillon-ui-fx/pom.xml
index 0100d85..498bc73 100644
--- a/dillon-ui/dillon-ui-fx/pom.xml
+++ b/dillon-ui/dillon-ui-fx/pom.xml
@@ -17,7 +17,7 @@
${java.version}
${java.version}
UTF-8
- 22.0.2
+ 23.0.1
1.54.4
2.0.1
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/Request.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/Request.java
index 14f88fc..66d0737 100644
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/Request.java
+++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/Request.java
@@ -1,122 +1,170 @@
-package com.lw.fx.request;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.lw.fx.request.feign.interceptor.ForwardedForInterceptor;
-import com.lw.fx.request.feign.interceptor.OkHttpInterceptor;
-import com.lw.ui.request.api.BaseFeignApi;
-import com.lw.ui.request.gson.LocalDateTimeTypeAdapter;
-import com.lw.ui.request.gson.LocalDateTypeAdapter;
-import com.lw.ui.request.gson.ZonedDateTimeTypeAdapter;
-import feign.AsyncFeign;
-import feign.Feign;
-import feign.Logger;
-import feign.Retryer;
-import feign.codec.Decoder;
-import feign.codec.Encoder;
-import feign.form.spring.SpringFormEncoder;
-import feign.gson.GsonDecoder;
-import feign.gson.GsonEncoder;
-import feign.jackson.JacksonDecoder;
-import feign.okhttp.OkHttpClient;
-import feign.querymap.BeanQueryMapEncoder;
-import feign.slf4j.Slf4jLogger;
-import okhttp3.ConnectionPool;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.ZonedDateTime;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class Request {
-
- private static final Map CONNECTORS = new ConcurrentHashMap<>();
- private static final String API_URL = "http://127.0.0.1:48080/";
- private static final int READ_TIME_OUT_MILLIS = 90000;
-
- // Gson 实例和解码器、编码器
- private static final Gson GSON = new GsonBuilder()
- .setPrettyPrinting()
- .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter())
- .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeTypeAdapter())
- .registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeTypeAdapter())
- .setDateFormat("yyyy-MM-dd HH:mm:ss")
- .create();
-
- private static final Decoder GSON_DECODER = new GsonDecoder(GSON);
- private static final Encoder GSON_ENCODER = new GsonEncoder(GSON);
-
- private static final okhttp3.OkHttpClient OK_HTTP_CLIENT = createOkHttpClient();
- private static final Feign.Builder BUILDER = createFeignBuilder();
- private static final Feign.Builder FILE_BUILDER = createFileFeignBuilder();
- private static final AsyncFeign.AsyncBuilder ASYNC_BUILDER = createAsyncFeignBuilder();
-
- private Request() {
- // 防止实例化
- }
-
- public static T connector(Class connectorClass, int readTimeOut) {
- final String key = connectorClass.getSimpleName() + readTimeOut;
- return (T) CONNECTORS.computeIfAbsent(key, k -> BUILDER.target(connectorClass, API_URL));
- }
-
- public static T connector(Class connectorClass) {
- return connector(connectorClass, READ_TIME_OUT_MILLIS);
- }
-
- public static T fileConnector(Class connectorClass) {
- return FILE_BUILDER.target(connectorClass, API_URL);
- }
-
-
- public static T asyncConnector(Class connectorClass, int readTimeOut) {
- final String key = connectorClass.getSimpleName() + readTimeOut;
- return (T) CONNECTORS.computeIfAbsent(key, k -> (BaseFeignApi) ASYNC_BUILDER.target(connectorClass, API_URL));
- }
-
- public static T asyncConnector(Class connectorClass) {
- return asyncConnector(connectorClass, READ_TIME_OUT_MILLIS);
- }
-
- private static okhttp3.OkHttpClient createOkHttpClient() {
- return new okhttp3.OkHttpClient.Builder()
- .connectionPool(new ConnectionPool())
- .addInterceptor(new OkHttpInterceptor())
- .build();
- }
-
- private static Feign.Builder createFeignBuilder() {
- return Feign.builder()
- .queryMapEncoder(new BeanQueryMapEncoder())
- .decoder(GSON_DECODER)
- .encoder(GSON_ENCODER)
- .logger(new Slf4jLogger())
- .logLevel(Logger.Level.BASIC)
- .client(new OkHttpClient(OK_HTTP_CLIENT))
- .requestInterceptor(new ForwardedForInterceptor())
- .retryer(new Retryer.Default()); // 默认重试策略
- }
-
- private static AsyncFeign.AsyncBuilder createAsyncFeignBuilder() {
- return AsyncFeign.builder()
- .queryMapEncoder(new BeanQueryMapEncoder())
- .decoder(GSON_DECODER)
- .encoder(GSON_ENCODER)
- .logger(new Slf4jLogger())
- .logLevel(Logger.Level.FULL)
- .client(new OkHttpClient(OK_HTTP_CLIENT))
- .requestInterceptor(new ForwardedForInterceptor())
- .retryer(new Retryer.Default()); // 默认重试策略
- }
-
- private static Feign.Builder createFileFeignBuilder() {
-
-
- return Feign.builder()
- .encoder(new SpringFormEncoder())
- .decoder(new JacksonDecoder())
- .requestInterceptor(new ForwardedForInterceptor());
-
- }
-}
\ No newline at end of file
+package com.lw.fx.request;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.lw.fx.request.interceptor.ForwardedForInterceptor;
+import com.lw.fx.request.interceptor.OkHttpInterceptor;
+import com.lw.fx.request.loadbalancer.PrimaryBackupRule;
+import com.lw.ui.request.api.BaseFeignApi;
+import com.lw.ui.request.gson.LocalDateTimeTypeAdapter;
+import com.lw.ui.request.gson.LocalDateTypeAdapter;
+import com.lw.ui.request.gson.ZonedDateTimeTypeAdapter;
+import com.netflix.client.ClientFactory;
+import com.netflix.client.config.IClientConfig;
+import com.netflix.config.ConfigurationManager;
+import com.netflix.loadbalancer.ILoadBalancer;
+import com.netflix.loadbalancer.ZoneAwareLoadBalancer;
+import feign.AsyncFeign;
+import feign.Feign;
+import feign.Logger;
+import feign.Retryer;
+import feign.codec.Decoder;
+import feign.codec.Encoder;
+import feign.form.spring.SpringFormEncoder;
+import feign.gson.GsonDecoder;
+import feign.gson.GsonEncoder;
+import feign.jackson.JacksonDecoder;
+import feign.okhttp.OkHttpClient;
+import feign.querymap.BeanQueryMapEncoder;
+import feign.ribbon.LBClient;
+import feign.ribbon.LBClientFactory;
+import feign.ribbon.RibbonClient;
+import feign.slf4j.Slf4jLogger;
+import okhttp3.ConnectionPool;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class Request {
+
+ private static final Map CONNECTORS = new ConcurrentHashMap<>();
+ private static final int READ_TIME_OUT_MILLIS = 90000;
+
+ // Gson 实例和解码器、编码器
+ private static final Gson GSON = new GsonBuilder()
+ .setPrettyPrinting()
+ .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter())
+ .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeTypeAdapter())
+ .registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeTypeAdapter())
+ .setDateFormat("yyyy-MM-dd HH:mm:ss")
+ .create();
+
+ private static final Decoder GSON_DECODER = new GsonDecoder(GSON);
+ private static final Encoder GSON_ENCODER = new GsonEncoder(GSON);
+
+ private static final okhttp3.OkHttpClient OK_HTTP_CLIENT = createOkHttpClient();
+ private static final Feign.Builder BUILDER = createFeignBuilder();
+ private static final Feign.Builder FILE_BUILDER = createFileFeignBuilder();
+
+ private static final AsyncFeign.AsyncBuilder ASYNC_BUILDER = createAsyncFeignBuilder();
+
+ static {
+ // 防止实例化
+ try {
+ // 手动设置 Ribbon 配置
+
+ ConfigurationManager.loadPropertiesFromResources("myService.properties");
+
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to configure Ribbon", e);
+ }
+ }
+
+ private Request() {
+
+ }
+
+ public static T connector(Class connectorClass, int readTimeOut) {
+ final String key = connectorClass.getSimpleName() + readTimeOut;
+ return (T) CONNECTORS.computeIfAbsent(key, k -> BUILDER.target(connectorClass, "http://myService"));
+ }
+
+ public static T connector(Class connectorClass) {
+ return connector(connectorClass, READ_TIME_OUT_MILLIS);
+ }
+
+
+ public static T asyncConnector(Class connectorClass, int readTimeOut) {
+ final String key = connectorClass.getSimpleName() + readTimeOut;
+ return (T) CONNECTORS.computeIfAbsent(key, k -> (BaseFeignApi) ASYNC_BUILDER.target(connectorClass, "http://myService"));
+ }
+
+ public static T asyncConnector(Class connectorClass) {
+ return asyncConnector(connectorClass, READ_TIME_OUT_MILLIS);
+ }
+
+ private static okhttp3.OkHttpClient createOkHttpClient() {
+ return new okhttp3.OkHttpClient.Builder()
+ .connectionPool(new ConnectionPool())
+ .addInterceptor(new OkHttpInterceptor())
+ .build();
+ }
+
+ private static Feign.Builder createFeignBuilder() {
+
+ return Feign.builder()
+ .queryMapEncoder(new BeanQueryMapEncoder())
+ .decoder(GSON_DECODER)
+ .encoder(GSON_ENCODER)
+ .logger(new Slf4jLogger())
+ .logLevel(Logger.Level.BASIC)
+ .client(RibbonClient.builder().delegate(new OkHttpClient(OK_HTTP_CLIENT)).lbClientFactory(new LBClientFactory() {
+ @Override
+ public LBClient create(String clientName) {
+ IClientConfig config = ClientFactory.getNamedConfig(clientName);
+
+ ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
+ ZoneAwareLoadBalancer zb = (ZoneAwareLoadBalancer) lb;
+ // 设置规则:使用 AvailabilityFilteringRule 和 ZoneAvoidanceRule 进行主备切换
+ zb.setRule(new PrimaryBackupRule());
+ LBClient lbClient = LBClient.create(lb, config);
+ return lbClient;
+ }
+ }).build())
+ .requestInterceptor(new ForwardedForInterceptor())
+ .retryer(new Retryer.Default()); // 默认重试策略
+ }
+
+ private static AsyncFeign.AsyncBuilder createAsyncFeignBuilder() {
+ return AsyncFeign.builder()
+ .queryMapEncoder(new BeanQueryMapEncoder())
+ .decoder(GSON_DECODER)
+ .encoder(GSON_ENCODER)
+ .logger(new Slf4jLogger())
+ .logLevel(Logger.Level.FULL)
+ .client(new OkHttpClient(OK_HTTP_CLIENT))
+ .requestInterceptor(new ForwardedForInterceptor())
+ .retryer(new Retryer.Default()); // 默认重试策略
+ }
+
+
+ public static T fileConnector(Class connectorClass) {
+ return FILE_BUILDER.target(connectorClass, "http://myService");
+ }
+
+ private static Feign.Builder createFileFeignBuilder() {
+
+
+ return Feign.builder()
+ .encoder(new SpringFormEncoder())
+ .decoder(new JacksonDecoder())
+ .client(RibbonClient.builder().delegate(new OkHttpClient(OK_HTTP_CLIENT)).lbClientFactory(new LBClientFactory() {
+ @Override
+ public LBClient create(String clientName) {
+ IClientConfig config = ClientFactory.getNamedConfig(clientName);
+
+ ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
+ ZoneAwareLoadBalancer zb = (ZoneAwareLoadBalancer) lb;
+ // 设置规则:使用 AvailabilityFilteringRule 和 ZoneAvoidanceRule 进行主备切换
+ zb.setRule(new PrimaryBackupRule());
+ LBClient lbClient = LBClient.create(lb, config);
+ return lbClient;
+ }
+ }).build())
+ .requestInterceptor(new ForwardedForInterceptor());
+
+ }
+}
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/FileClientConfigAdapter.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/FileClientConfigAdapter.java
deleted file mode 100644
index 7655f9d..0000000
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/FileClientConfigAdapter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.lw.fx.request.feign;
-
-import cn.hutool.core.util.StrUtil;
-import com.google.gson.*;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonWriter;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.FileClientConfig;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.db.DBFileClientConfig;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.ftp.FtpFileClientConfig;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.local.LocalFileClientConfig;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.s3.S3FileClientConfig;
-import com.lw.dillon.admin.module.infra.framework.file.core.client.sftp.SftpFileClientConfig;
-
-import java.io.IOException;
-
-// TypeAdapter 实现
-public class FileClientConfigAdapter extends TypeAdapter {
-
- @Override
- public void write(JsonWriter out, FileClientConfig value) throws IOException {
- out.beginObject();
-
- out.endObject();
- }
-
- @Override
- public FileClientConfig read(JsonReader in) throws IOException {
- JsonObject jsonObject = JsonParser.parseReader(in).getAsJsonObject();
- String className = jsonObject.get("@class").getAsString();
- className = StrUtil.subAfter(className, ".", true);
-
- switch (className) {
- case "DBFileClientConfig":
- return new Gson().fromJson(jsonObject, DBFileClientConfig.class);
- case "FtpFileClientConfig":
- return new Gson().fromJson(jsonObject, FtpFileClientConfig.class);
- case "LocalFileClientConfig":
- return new Gson().fromJson(jsonObject, LocalFileClientConfig.class);
- case "SftpFileClientConfig":
- return new Gson().fromJson(jsonObject, SftpFileClientConfig.class);
- case "S3FileClientConfig":
- return new Gson().fromJson(jsonObject, S3FileClientConfig.class);
- default:
- throw new JsonParseException("未知的 FileClientConfig 类型:" + className);
- }
- }
-}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignError.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignError.java
deleted file mode 100644
index e20f350..0000000
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignError.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.lw.fx.request.feign.decoder;
-
-public class FeignError extends RuntimeException {
- private String message; // parsed from json
-
- @Override
- public String getMessage() {
- return message;
- }
-}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignErrorDecoder.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignErrorDecoder.java
deleted file mode 100644
index 359a781..0000000
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/decoder/FeignErrorDecoder.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.lw.fx.request.feign.decoder;
-
-import feign.Response;
-import feign.codec.Decoder;
-import feign.codec.ErrorDecoder;
-
-import java.io.IOException;
-
-public class FeignErrorDecoder implements ErrorDecoder {
-
- final Decoder decoder;
- final ErrorDecoder defaultDecoder = new Default();
-
- public FeignErrorDecoder(Decoder decoder) {
- this.decoder = decoder;
- }
-
- @Override
- public Exception decode(String methodKey, Response response) {
- try {
- return (Exception) decoder.decode(response, FeignError.class);
- } catch (IOException fallbackToDefault) {
- return defaultDecoder.decode(methodKey, response);
- }
- }
-}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/ForwardedForInterceptor.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/ForwardedForInterceptor.java
deleted file mode 100644
index dde171c..0000000
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/ForwardedForInterceptor.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.lw.fx.request.feign.interceptor;
-
-import com.lw.fx.store.AppStore;
-import feign.RequestInterceptor;
-import feign.RequestTemplate;
-
-public class ForwardedForInterceptor implements RequestInterceptor {
-
- @Override
- public void apply(RequestTemplate template) {
-
- template.header("Authorization", AppStore.getToken());
-
-
- }
-}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/ForwardedForInterceptor.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/ForwardedForInterceptor.java
new file mode 100644
index 0000000..cdc4626
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/ForwardedForInterceptor.java
@@ -0,0 +1,24 @@
+package com.lw.fx.request.interceptor;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.lw.fx.store.AppStore;
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+
+public class ForwardedForInterceptor implements RequestInterceptor {
+
+ @Override
+ public void apply(RequestTemplate template) {
+
+ template.header("Authorization", "Bearer " + AppStore.getToken());
+ template.uri("/admin-api" + template.url());
+ if (ObjectUtil.isNotEmpty("1")) {
+ template.header("tenant-id", "1");
+ }else {
+ template.header("tenant-id", "1");
+ }
+// template.header("tenantName", "DKY-源码");
+
+
+ }
+}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/OkHttpInterceptor.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/OkHttpInterceptor.java
similarity index 95%
rename from dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/OkHttpInterceptor.java
rename to dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/OkHttpInterceptor.java
index ec84a7b..f155ede 100644
--- a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/feign/interceptor/OkHttpInterceptor.java
+++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/interceptor/OkHttpInterceptor.java
@@ -1,4 +1,4 @@
-package com.lw.fx.request.feign.interceptor;
+package com.lw.fx.request.interceptor;
import cn.hutool.json.JSONUtil;
import com.lw.dillon.admin.framework.common.pojo.CommonResult;
diff --git a/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/loadbalancer/PrimaryBackupRule.java b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/loadbalancer/PrimaryBackupRule.java
new file mode 100644
index 0000000..bbadc40
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/main/java/com/lw/fx/request/loadbalancer/PrimaryBackupRule.java
@@ -0,0 +1,32 @@
+package com.lw.fx.request.loadbalancer;
+
+import com.netflix.client.config.IClientConfig;
+import com.netflix.loadbalancer.AbstractLoadBalancerRule;
+import com.netflix.loadbalancer.Server;
+
+import java.util.List;
+
+public class PrimaryBackupRule extends AbstractLoadBalancerRule {
+ private int primaryIndex = 0; // 定义第一个服务为优先
+
+ @Override
+ public Server choose(Object key) {
+ List servers = getLoadBalancer().getAllServers();
+ if (servers.isEmpty()) {
+ return null;
+ }
+
+ Server primaryServer = servers.get(primaryIndex);
+ if (primaryServer.isAlive()) {
+ return primaryServer; // 优先返回第一个服务
+ } else {
+ // 主机不可用时,选择其他可用服务
+ return servers.stream().filter(Server::isAlive).skip(1).findFirst().orElse(null);
+ }
+ }
+
+ @Override
+ public void initWithNiwsConfig(IClientConfig clientConfig) {
+ // 可以配置初始化行为
+ }
+}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/main/resources/myService.properties b/dillon-ui/dillon-ui-fx/src/main/resources/myService.properties
new file mode 100644
index 0000000..f8764e2
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/main/resources/myService.properties
@@ -0,0 +1,33 @@
+# 最大重试次数(不包括第一次尝试):
+# 在同一个服务器上,重试的最大次数。默认情况下,Ribbon 会尝试向一个服务器发送请求,直到该服务器出现错误或重试次数超过这个设置的最大值。这里设置为 1,意味着最多会重试一次。
+myService.ribbon.MaxAutoRetries=1
+
+# 最大重试次数(不包括第一次服务器):
+# 在所有可用服务器中,Ribbon 会根据负载均衡策略选择下一个服务器进行请求。此项配置设置最大重试次数,默认情况下,Ribbon 会尝试重新请求下一个服务器,直到超过最大重试次数。设置为 1,表示最多在备份服务器上重试一次。
+myService.ribbon.MaxAutoRetriesNextServer=1
+
+# 是否允许对所有操作进行重试:
+# 这表示是否所有操作(如 GET、POST 等)都可以进行重试。默认为 `false`,即只在连接错误或服务器不可用时重试。设置为 `true` 时,所有请求都会尝试重试,可能用于减少服务不可用时的失败影响。
+myService.ribbon.OkToRetryOnAllOperations=true
+
+# 刷新服务器列表的间隔时间(毫秒):
+# Ribbon 会定期刷新其服务器列表,以便获取最新的可用服务器。如果使用动态服务器列表或注册中心,设置这个值来指定更新频率。设置为 2000 表示每 2 秒刷新一次服务器列表。
+myService.ribbon.ServerListRefreshInterval=200000
+
+# 连接超时(毫秒):
+# 这是 Apache HttpClient 在建立连接时的超时时间。设置为 3000,表示连接建立的最大超时为 3 秒。
+myService.ribbon.ConnectTimeout=30000
+
+# 读取超时(毫秒):
+# 这是 Apache HttpClient 在等待服务器响应时的超时时间。设置为 3000,表示读取数据的最大超时为 3 秒。
+myService.ribbon.ReadTimeout=30000
+
+# 初始服务器列表:
+# 这是 Ribbon 初始时使用的服务器列表,通常是一个以逗号分隔的服务器地址字符串。这里指定了三个服务器:`www.microsoft.com`、`www.yahoo.com`、`www.google.com`,这些服务器在负载均衡器启动时会被作为候选服务器使用。
+myService.ribbon.listOfServers=http://127.0.0.1:48080,http://127.0.0.1:48081
+
+
+# 启用 Prime 连接:
+# 这个配置控制是否启用 Ribbon 的“Prime Connections”特性。Prime 连接指的是 Ribbon 预先连接一些服务器,以提高请求的响应速度。设置为 `true` 表示启用此特性。
+myService.ribbon.EnablePrimeConnections=true
+
diff --git a/dillon-ui/dillon-ui-fx/src/test/java/CustomTitleBarWindow.java b/dillon-ui/dillon-ui-fx/src/test/java/CustomTitleBarWindow.java
new file mode 100644
index 0000000..1cfe9b8
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/test/java/CustomTitleBarWindow.java
@@ -0,0 +1,64 @@
+import com.goxr3plus.fxborderlessscene.borderless.BorderlessScene;
+import javafx.geometry.Pos;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
+import javafx.stage.Stage;
+
+public class CustomTitleBarWindow extends BorderPane {
+
+ private Stage primaryStage;
+ private HBox titleBar;
+ private Label titleLabel;
+
+
+ public CustomTitleBarWindow(Stage primaryStage) {
+ this.primaryStage = primaryStage;
+ initView();
+ }
+
+ private void initView() {
+ titleBar=new HBox();
+ titleBar.setAlignment(Pos.CENTER_LEFT);
+ titleBar.setStyle("-fx-background-color: #2C3E50; -fx-padding: 10px;");
+
+ titleLabel=new Label("Hello World");
+ titleLabel.setMaxWidth(Double.MAX_VALUE);
+ titleLabel.setStyle("-fx-text-fill: white;");
+ HBox.setHgrow(titleLabel, Priority.ALWAYS);
+ // 创建最小化按钮
+ Button minimizeButton = new Button("_");
+ minimizeButton.setOnAction(event -> {
+ if (minimizeButton.getScene() instanceof BorderlessScene) {
+ ((BorderlessScene) minimizeButton.getScene()).minimizeStage();
+ }
+ });
+ minimizeButton.setStyle("-fx-background-color: #3498DB; -fx-text-fill: white;");
+
+ // 创建最大化按钮
+ Button maximizeButton = new Button("⬜");
+ maximizeButton.setOnAction(event -> {
+ if (maximizeButton.getScene() instanceof BorderlessScene) {
+
+ ((BorderlessScene) maximizeButton.getScene()).maximizeStage();
+ }
+ });
+ maximizeButton.setStyle("-fx-background-color: #2ECC71; -fx-text-fill: white;");
+
+ // 创建关闭按钮
+ Button closeButton = new Button("X");
+ closeButton.setOnAction(event -> primaryStage.close());
+ closeButton.setStyle("-fx-background-color: #E74C3C; -fx-text-fill: white;");
+
+ // 将按钮添加到标题栏
+ titleBar.getChildren().addAll(titleLabel,minimizeButton, maximizeButton, closeButton);
+
+ this.setTop(titleBar);
+ }
+
+
+
+
+}
diff --git a/dillon-ui/dillon-ui-fx/src/test/java/MacOSBlurEffectExample.java b/dillon-ui/dillon-ui-fx/src/test/java/MacOSBlurEffectExample.java
new file mode 100644
index 0000000..04fcbb7
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/test/java/MacOSBlurEffectExample.java
@@ -0,0 +1,82 @@
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+public class MacOSBlurEffectExample extends Application {
+
+ public interface CocoaLibrary extends Library {
+ CocoaLibrary INSTANCE = Native.load("Cocoa", CocoaLibrary.class);
+
+ Pointer objc_getClass(String className);
+ Pointer sel_registerName(String selector);
+ Pointer objc_msgSend(Pointer receiver, Pointer selector);
+ Pointer objc_msgSend(Pointer receiver, Pointer selector, Pointer arg1);
+ Pointer objc_msgSend(Pointer receiver, Pointer selector, Pointer arg1, Pointer arg2);
+ }
+
+ private Pointer nsVisualEffectViewClass;
+ private Pointer nsVisualEffectView;
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage primaryStage) {
+ // 创建一个按钮
+ Button button = new Button("点击我");
+
+ // 创建一个StackPane作为根节点
+ StackPane root = new StackPane();
+ root.getChildren().add(button);
+
+ // 创建场景
+ Scene scene = new Scene(root, 600, 400);
+ primaryStage.setTitle("macOS 模糊效果示例");
+ primaryStage.setScene(scene);
+ primaryStage.show();
+
+ // 实现模糊效果
+ if (System.getProperty("os.name").toLowerCase().contains("mac")) {
+ applyBlurEffect(primaryStage);
+ }
+ }
+
+ private void applyBlurEffect(Stage stage) {
+ // 获取 NSVisualEffectView 类
+ nsVisualEffectViewClass = CocoaLibrary.INSTANCE.objc_getClass("NSVisualEffectView");
+ if (nsVisualEffectViewClass == null) {
+ System.err.println("Failed to get NSVisualEffectView class.");
+ return;
+ }
+
+ // 创建 NSVisualEffectView 的实例
+ Pointer effectView = CocoaLibrary.INSTANCE.objc_msgSend(nsVisualEffectViewClass,
+ CocoaLibrary.INSTANCE.sel_registerName("alloc"));
+ if (effectView == null) {
+ System.err.println("Failed to allocate NSVisualEffectView.");
+ return;
+ }
+
+ effectView = CocoaLibrary.INSTANCE.objc_msgSend(effectView,
+ CocoaLibrary.INSTANCE.sel_registerName("initWithFrame:"), Pointer.NULL);
+ if (effectView == null) {
+ System.err.println("Failed to initialize NSVisualEffectView.");
+ return;
+ }
+
+ // 设置模糊效果
+ CocoaLibrary.INSTANCE.objc_msgSend(effectView,
+ CocoaLibrary.INSTANCE.sel_registerName("setMaterial:"),
+ CocoaLibrary.INSTANCE.objc_msgSend(nsVisualEffectViewClass,
+ CocoaLibrary.INSTANCE.sel_registerName("materialDark")));
+
+ // 在这里将 effectView 添加到 JavaFX 的窗口中,可能需要额外处理
+ // 直接在 JavaFX 窗口中添加可能需要使用 JFXPanel 或 SWT
+ }
+}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-fx/src/test/java/Main.java b/dillon-ui/dillon-ui-fx/src/test/java/Main.java
new file mode 100644
index 0000000..c55102f
--- /dev/null
+++ b/dillon-ui/dillon-ui-fx/src/test/java/Main.java
@@ -0,0 +1,67 @@
+import javafx.application.Application;
+import javafx.geometry.Pos;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+import com.goxr3plus.fxborderlessscene.borderless.BorderlessScene;
+
+/**
+ * Testing the application to see if it works
+ *
+ * @author GOXR3PLUS
+ */
+public class Main extends Application {
+
+ @Override
+ public void start(Stage primaryStage) throws Exception {
+
+
+ CustomTitleBarWindow windowPane = new CustomTitleBarWindow(primaryStage);
+ windowPane.setCenter(new Button("我是内容"));
+
+ // Constructor using your primary stage and the root Parent of your content.
+ BorderlessScene scene = new BorderlessScene(primaryStage, StageStyle.TRANSPARENT, windowPane, 250, 250);
+ primaryStage.setScene(scene); // Set the scene to your stage and you're done!
+
+ //Close Button
+ Button removeDefaultCSS = new Button("Remove Default Corners CSS");
+ removeDefaultCSS.setOnAction(a -> scene.removeDefaultCSS());
+
+ //remove the default css style
+ scene.removeDefaultCSS();
+
+ // Maximise (on/off) and minimise the application:
+ //scene.maximizeStage();
+ //scene.minimizeStage();
+
+ // To move the window around by pressing a node:
+ scene.setMoveControl(windowPane);
+
+ // To disable resize:
+ //scene.setResizable(false);
+
+ // To switch the content during runtime:
+ //scene.setContent(yourNewParent);
+
+ // Check if maximised:
+ //Boolean bool = scene.isMaximised();
+
+ // Get windowed* size and position:
+ //scene.getWindowedSize();
+ //scene.getWindowedPosition();
+
+ //Show
+ primaryStage.setTitle("Draggable and Undecorated JavaFX Window");
+ primaryStage.show();
+
+ }
+
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+}
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/ReflectionRepaintManager.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/ReflectionRepaintManager.java
index ffdb62c..6676754 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/ReflectionRepaintManager.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/ReflectionRepaintManager.java
@@ -6,42 +6,43 @@ import javax.swing.*;
import java.awt.*;
public class ReflectionRepaintManager extends RepaintManager {
- public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
+ @Override
+ public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
- int lastDeltaX = c.getX();
- int lastDeltaY = c.getY();
+ int lastDeltaX = c.getX();
+ int lastDeltaY = c.getY();
- LookAndFeel laf = UIManager.getLookAndFeel();
- boolean isDark=false;
- if( laf instanceof FlatLaf){
- isDark = ((FlatLaf) laf).isDark();
- }
-
- if (isDark) {
- Container parent = c.getParent();
- while (parent instanceof JComponent) {
- if (!parent.isVisible()) {
- return;
- }
-
- if (parent instanceof WScrollPane) {
- x += lastDeltaX;
- y += lastDeltaY;
-
-
- lastDeltaX = lastDeltaY = 0;
-
- c = (JComponent) parent;
- }
-
- lastDeltaX += parent.getX();
- lastDeltaY += parent.getY();
-
- parent = parent.getParent();
- }
- }
-
-
- super.addDirtyRegion(c, x, y, w, h);
+ LookAndFeel laf = UIManager.getLookAndFeel();
+ boolean isDark = false;
+ if (laf instanceof FlatLaf) {
+ isDark = ((FlatLaf) laf).isDark();
}
- }
\ No newline at end of file
+
+ if (isDark) {
+ Container parent = c.getParent();
+ while (parent instanceof JComponent) {
+ if (!parent.isVisible()) {
+ return;
+ }
+
+ if (parent instanceof WScrollPane) {
+ x += lastDeltaX;
+ y += lastDeltaY;
+
+
+ lastDeltaX = lastDeltaY = 0;
+
+ c = (JComponent) parent;
+ }
+
+ lastDeltaX += parent.getX();
+ lastDeltaY += parent.getY();
+
+ parent = parent.getParent();
+ }
+ }
+
+
+ super.addDirtyRegion(c, x, y, w, h);
+ }
+}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WButton.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WButton.java
index a43d448..09a04d8 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WButton.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WButton.java
@@ -73,14 +73,16 @@ public class WButton extends JButton {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
- if (isEnabled())
+ if (isEnabled()) {
getAnimationStart().restart();
+ }
}
@Override
public void mouseExited(MouseEvent e) {
- if (isEnabled())
+ if (isEnabled()) {
getAnimationStart().restartReverse();
+ }
}
@Override
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WOptionPane.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WOptionPane.java
index 7d4bbae..986d563 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WOptionPane.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/WOptionPane.java
@@ -480,17 +480,20 @@ public class WOptionPane extends JOptionPane {
Object selectedValue = pane.getValue();
- if (selectedValue == null)
+ if (selectedValue == null) {
return CLOSED_OPTION;
+ }
if (options == null) {
- if (selectedValue instanceof Integer)
+ if (selectedValue instanceof Integer) {
return ((Integer) selectedValue).intValue();
+ }
return CLOSED_OPTION;
}
for (int counter = 0, maxCounter = options.length;
counter < maxCounter; counter++) {
- if (options[counter].equals(selectedValue))
+ if (options[counter].equals(selectedValue)) {
return counter;
+ }
}
return CLOSED_OPTION;
}
@@ -985,6 +988,7 @@ public class WOptionPane extends JOptionPane {
dialog.setLocationRelativeTo(parentComponent);
final PropertyChangeListener listener = new PropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
// Let the defaultCloseOperation handle the closing
// if the user closed the window without selecting a button
@@ -1001,15 +1005,16 @@ public class WOptionPane extends JOptionPane {
WindowAdapter adapter = new WindowAdapter() {
private boolean gotFocus = false;
+ @Override
public void windowClosing(WindowEvent we) {
setValue(null);
}
-
+ @Override
public void windowClosed(WindowEvent e) {
removePropertyChangeListener(listener);
dialog.getContentPane().removeAll();
}
-
+ @Override
public void windowGainedFocus(WindowEvent we) {
// Once window gets focus, set initial focus
if (!gotFocus) {
@@ -1021,6 +1026,7 @@ public class WOptionPane extends JOptionPane {
dialog.addWindowListener(adapter);
dialog.addWindowFocusListener(adapter);
dialog.addComponentListener(new ComponentAdapter() {
+ @Override
public void componentShown(ComponentEvent ce) {
// reset value to ensure closing works properly
setValue(JOptionPane.UNINITIALIZED_VALUE);
@@ -1032,10 +1038,12 @@ public class WOptionPane extends JOptionPane {
static Window getWindowForComponent(Component parentComponent)
throws HeadlessException {
- if (parentComponent == null)
+ if (parentComponent == null) {
return getRootFrame();
- if (parentComponent instanceof Frame || parentComponent instanceof Dialog)
+ }
+ if (parentComponent instanceof Frame || parentComponent instanceof Dialog) {
return (Window) parentComponent;
+ }
return WOptionPane.getWindowForComponent(parentComponent.getParent());
}
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/BasicCellEditor.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/BasicCellEditor.java
index 0a0b56b..ba2f340 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/BasicCellEditor.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/BasicCellEditor.java
@@ -108,8 +108,9 @@ public class BasicCellEditor extends JPanel implements CellEditor, PropertyChang
}
// Implementation of the PropertyChangeListener interface
+ @Override
public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getPropertyName().equals("ancestor")
+ if ("ancestor".equals(evt.getPropertyName())
&& evt.getNewValue() != null) {
// Added to table - notify the editor
editingStarted(editingEvent);
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/CheckHeaderCellRenderer.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/CheckHeaderCellRenderer.java
index 1d7667a..ec72512 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/CheckHeaderCellRenderer.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/components/table/renderer/CheckHeaderCellRenderer.java
@@ -19,6 +19,7 @@ public class CheckHeaderCellRenderer implements TableCellRenderer {
selectBox = new JCheckBox(tableModel.getColumnName(0));
selectBox.setSelected(false);
tableHeader.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 0) {
//获得选中列
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/Request.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/Request.java
index aabb78f..4dcc449 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/Request.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/Request.java
@@ -4,10 +4,16 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.lw.swing.request.interceptor.ForwardedForInterceptor;
import com.lw.swing.request.interceptor.OkHttpInterceptor;
+import com.lw.swing.request.loadbalancer.PrimaryBackupRule;
import com.lw.ui.request.api.BaseFeignApi;
import com.lw.ui.request.gson.LocalDateTimeTypeAdapter;
import com.lw.ui.request.gson.LocalDateTypeAdapter;
import com.lw.ui.request.gson.ZonedDateTimeTypeAdapter;
+import com.netflix.client.ClientFactory;
+import com.netflix.client.config.IClientConfig;
+import com.netflix.config.ConfigurationManager;
+import com.netflix.loadbalancer.ILoadBalancer;
+import com.netflix.loadbalancer.ZoneAwareLoadBalancer;
import feign.AsyncFeign;
import feign.Feign;
import feign.Logger;
@@ -20,6 +26,9 @@ import feign.gson.GsonEncoder;
import feign.jackson.JacksonDecoder;
import feign.okhttp.OkHttpClient;
import feign.querymap.BeanQueryMapEncoder;
+import feign.ribbon.LBClient;
+import feign.ribbon.LBClientFactory;
+import feign.ribbon.RibbonClient;
import feign.slf4j.Slf4jLogger;
import okhttp3.ConnectionPool;
@@ -29,6 +38,9 @@ import java.time.ZonedDateTime;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+/**
+ * @author wenli
+ */
public class Request {
private static final Map CONNECTORS = new ConcurrentHashMap<>();
@@ -52,13 +64,25 @@ public class Request {
private static final AsyncFeign.AsyncBuilder ASYNC_BUILDER = createAsyncFeignBuilder();
- private Request() {
+ static {
// 防止实例化
+ try {
+ // 手动设置 Ribbon 配置
+
+ ConfigurationManager.loadPropertiesFromResources("myService.properties");
+
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to configure Ribbon", e);
+ }
+ }
+
+ private Request() {
+
}
public static T connector(Class connectorClass, int readTimeOut) {
final String key = connectorClass.getSimpleName() + readTimeOut;
- return (T) CONNECTORS.computeIfAbsent(key, k -> BUILDER.target(connectorClass, System.getProperty("app.server.url")));
+ return (T) CONNECTORS.computeIfAbsent(key, k -> BUILDER.target(connectorClass, "http://myService"));
}
public static T connector(Class connectorClass) {
@@ -68,7 +92,7 @@ public class Request {
public static T asyncConnector(Class connectorClass, int readTimeOut) {
final String key = connectorClass.getSimpleName() + readTimeOut;
- return (T) CONNECTORS.computeIfAbsent(key, k -> (BaseFeignApi) ASYNC_BUILDER.target(connectorClass, System.getProperty("app.server.url")));
+ return (T) CONNECTORS.computeIfAbsent(key, k -> (BaseFeignApi) ASYNC_BUILDER.target(connectorClass, "http://myService"));
}
public static T asyncConnector(Class connectorClass) {
@@ -83,13 +107,26 @@ public class Request {
}
private static Feign.Builder createFeignBuilder() {
+
return Feign.builder()
.queryMapEncoder(new BeanQueryMapEncoder())
.decoder(GSON_DECODER)
.encoder(GSON_ENCODER)
.logger(new Slf4jLogger())
.logLevel(Logger.Level.BASIC)
- .client(new OkHttpClient(OK_HTTP_CLIENT))
+ .client(RibbonClient.builder().delegate(new OkHttpClient(OK_HTTP_CLIENT)).lbClientFactory(new LBClientFactory() {
+ @Override
+ public LBClient create(String clientName) {
+ IClientConfig config = ClientFactory.getNamedConfig(clientName);
+
+ ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
+ ZoneAwareLoadBalancer zb = (ZoneAwareLoadBalancer) lb;
+ // 设置规则:使用 AvailabilityFilteringRule 和 ZoneAvoidanceRule 进行主备切换
+ zb.setRule(new PrimaryBackupRule());
+ LBClient lbClient = LBClient.create(lb, config);
+ return lbClient;
+ }
+ }).build())
.requestInterceptor(new ForwardedForInterceptor())
.retryer(new Retryer.Default()); // 默认重试策略
}
@@ -108,7 +145,7 @@ public class Request {
public static T fileConnector(Class connectorClass) {
- return FILE_BUILDER.target(connectorClass, System.getProperty("app.server.url"));
+ return FILE_BUILDER.target(connectorClass, "http://myService");
}
private static Feign.Builder createFileFeignBuilder() {
@@ -117,6 +154,19 @@ public class Request {
return Feign.builder()
.encoder(new SpringFormEncoder())
.decoder(new JacksonDecoder())
+ .client(RibbonClient.builder().delegate(new OkHttpClient(OK_HTTP_CLIENT)).lbClientFactory(new LBClientFactory() {
+ @Override
+ public LBClient create(String clientName) {
+ IClientConfig config = ClientFactory.getNamedConfig(clientName);
+
+ ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
+ ZoneAwareLoadBalancer zb = (ZoneAwareLoadBalancer) lb;
+ // 设置规则:使用 AvailabilityFilteringRule 和 ZoneAvoidanceRule 进行主备切换
+ zb.setRule(new PrimaryBackupRule());
+ LBClient lbClient = LBClient.create(lb, config);
+ return lbClient;
+ }
+ }).build())
.requestInterceptor(new ForwardedForInterceptor());
}
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/ForwardedForInterceptor.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/ForwardedForInterceptor.java
index 159e1ac..a2856e1 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/ForwardedForInterceptor.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/ForwardedForInterceptor.java
@@ -11,6 +11,7 @@ public class ForwardedForInterceptor implements RequestInterceptor {
public void apply(RequestTemplate template) {
template.header("Authorization", "Bearer " + AppStore.getAccessToken());
+ template.uri(System.getProperty("app.server.url.prefix") + template.url());
if (ObjectUtil.isNotEmpty("1")) {
template.header("tenant-id", "1");
}else {
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/OkHttpInterceptor.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/OkHttpInterceptor.java
index efa4b15..976fb36 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/OkHttpInterceptor.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/interceptor/OkHttpInterceptor.java
@@ -22,6 +22,7 @@ public class OkHttpInterceptor implements Interceptor {
@Override
public Response intercept(@NotNull Chain chain) throws IOException {
Request originalRequest = chain.request();
+
Response response = null;
try {
response = chain.proceed(originalRequest);
@@ -76,6 +77,7 @@ public class OkHttpInterceptor implements Interceptor {
MainFrame.getInstance().showLogin();
}
+ System.err.println("-----------------"+commonResult.getMsg());
WMessage.showMessageError(MainFrame.getInstance(), commonResult.getMsg());
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/loadbalancer/PrimaryBackupRule.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/loadbalancer/PrimaryBackupRule.java
new file mode 100644
index 0000000..5cd3dc7
--- /dev/null
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/request/loadbalancer/PrimaryBackupRule.java
@@ -0,0 +1,32 @@
+package com.lw.swing.request.loadbalancer;
+
+import com.netflix.client.config.IClientConfig;
+import com.netflix.loadbalancer.AbstractLoadBalancerRule;
+import com.netflix.loadbalancer.Server;
+
+import java.util.List;
+
+public class PrimaryBackupRule extends AbstractLoadBalancerRule {
+ private int primaryIndex = 0; // 定义第一个服务为优先
+
+ @Override
+ public Server choose(Object key) {
+ List servers = getLoadBalancer().getAllServers();
+ if (servers.isEmpty()) {
+ return null;
+ }
+
+ Server primaryServer = servers.get(primaryIndex);
+ if (primaryServer.isAlive()) {
+ return primaryServer; // 优先返回第一个服务
+ } else {
+ // 主机不可用时,选择其他可用服务
+ return servers.stream().filter(Server::isAlive).skip(1).findFirst().orElse(null);
+ }
+ }
+
+ @Override
+ public void initWithNiwsConfig(IClientConfig clientConfig) {
+ // 可以配置初始化行为
+ }
+}
\ No newline at end of file
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/utils/IconLoader.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/utils/IconLoader.java
index 135bdf1..35ba04d 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/utils/IconLoader.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/utils/IconLoader.java
@@ -71,8 +71,9 @@ public class IconLoader {
private static String resolveFile(String filename) {
// iterate over each location, return on first hit
for (String path : new String[]{"", "famfam/", "fugue/"}) {
- if (IconLoader.class.getResource(path + filename) != null)
+ if (IconLoader.class.getResource(path + filename) != null) {
return path + filename;
+ }
}
// if push comes to shove, we let the calling method deal w/ the
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/MainPrefs.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/MainPrefs.java
index fa60be9..26527d7 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/MainPrefs.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/MainPrefs.java
@@ -56,9 +56,9 @@ public class MainPrefs {
public static void setupLaf(String[] args) {
// set look and feel
try {
- if (args.length > 0)
+ if (args.length > 0) {
UIManager.setLookAndFeel(args[0]);
- else {
+ } else {
String lafClassName = state.get(KEY_LAF, FlatLightLaf.class.getName());
if (IntelliJTheme.ThemeLaf.class.getName().equals(lafClassName)) {
String theme = state.get(KEY_LAF_THEME, "");
@@ -66,24 +66,29 @@ public class MainPrefs {
// IntelliJTheme.setup(IJThemesPanel.class.getResourceAsStream(IJThemesPanel.THEMES_PACKAGE + theme.substring(RESOURCE_PREFIX.length())));
} else if (theme.startsWith(FILE_PREFIX)) {
FlatLaf.setup(IntelliJTheme.createLaf(new FileInputStream(theme.substring(FILE_PREFIX.length()))));
- } else
+ } else {
FlatLightLaf.setup();
+ }
- if (!theme.isEmpty())
+ if (!theme.isEmpty()) {
UIManager.getLookAndFeelDefaults().put(THEME_UI_KEY, theme);
+ }
} else if (FlatPropertiesLaf.class.getName().equals(lafClassName)) {
String theme = state.get(KEY_LAF_THEME, "");
if (theme.startsWith(FILE_PREFIX)) {
File themeFile = new File(theme.substring(FILE_PREFIX.length()));
String themeName = StringUtils.removeTrailing(themeFile.getName(), ".properties");
FlatLaf.setup(new FlatPropertiesLaf(themeName, themeFile));
- } else
+ } else {
FlatLightLaf.setup();
+ }
- if (!theme.isEmpty())
+ if (!theme.isEmpty()) {
UIManager.getLookAndFeelDefaults().put(THEME_UI_KEY, theme);
- } else
+ }
+ } else {
UIManager.setLookAndFeel(lafClassName);
+ }
}
} catch (Throwable ex) {
LoggingFacade.INSTANCE.logSevere(null, ex);
@@ -94,8 +99,9 @@ public class MainPrefs {
// remember active look and feel
UIManager.addPropertyChangeListener(e -> {
- if ("lookAndFeel".equals(e.getPropertyName()))
+ if ("lookAndFeel".equals(e.getPropertyName())) {
state.put(KEY_LAF, UIManager.getLookAndFeel().getClass().getName());
+ }
});
}
}
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/SidePane.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/SidePane.java
index 1ed5f8d..d83c47c 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/SidePane.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/SidePane.java
@@ -253,6 +253,7 @@ public class SidePane extends WPanel implements Observer {
super(root);
}
+ @Override
public Object getChild(Object parent, int index) {
AuthPermissionInfoRespVO.MenuVO parentFile = (AuthPermissionInfoRespVO.MenuVO) parent;
List children = parentFile.getChildren();
@@ -260,6 +261,7 @@ public class SidePane extends WPanel implements Observer {
}
+ @Override
public int getChildCount(Object parent) {
if (parent instanceof AuthPermissionInfoRespVO.MenuVO) {
List children = ((AuthPermissionInfoRespVO.MenuVO) parent).getChildren();
@@ -271,6 +273,7 @@ public class SidePane extends WPanel implements Observer {
return 0;
}
+ @Override
public Class> getColumnClass(int column) {
switch (column) {
case 0:
@@ -280,14 +283,17 @@ public class SidePane extends WPanel implements Observer {
}
}
+ @Override
public int getColumnCount() {
return 1;
}
+ @Override
public String getColumnName(int column) {
return "Name";
}
+ @Override
public Object getValueAt(Object node, int column) {
if (node instanceof AuthPermissionInfoRespVO.MenuVO) {
AuthPermissionInfoRespVO.MenuVO menuVO = (AuthPermissionInfoRespVO.MenuVO) node;
@@ -307,6 +313,7 @@ public class SidePane extends WPanel implements Observer {
this.modelSupport.fireNewRoot();
}
+ @Override
public boolean isLeaf(Object node) {
if (node instanceof AuthPermissionInfoRespVO.MenuVO) {
return ((AuthPermissionInfoRespVO.MenuVO) node).getChildren() == null;
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/dept/DeptEditPane.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/dept/DeptEditPane.java
index 057b91f..f99d033 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/dept/DeptEditPane.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/dept/DeptEditPane.java
@@ -234,7 +234,7 @@ public class DeptEditPane extends JPanel {
DefaultMutableTreeNode deptRootNode = new DefaultMutableTreeNode("主类目");
// Build the tree
Map nodeMap = new HashMap<>();
- nodeMap.put(0l, deptRootNode); // Root node
+ nodeMap.put(0L, deptRootNode); // Root node
CommonResult> deptSimpleRespVOList = Request.connector(DeptFeign.class).getSimpleDeptList();
CommonResult> userSimpleRespVOList = Request.connector(UserFeign.class).getSimpleUserList();
@@ -245,7 +245,7 @@ public class DeptEditPane extends JPanel {
for (UserSimpleRespVO respVO : userSimpleRespVOList.getData()) {
leaderUsers.add(respVO);
- if (deptRespVO != null && deptRespVO.getLeaderUserId() == respVO.getId()) {
+ if (deptRespVO != null && deptRespVO.getLeaderUserId().equals(respVO.getId())) {
leaderUserSel = respVO;
}
}
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/menu/MenuEditPane.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/menu/MenuEditPane.java
index c5decf9..91a6700 100644
--- a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/menu/MenuEditPane.java
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/menu/MenuEditPane.java
@@ -361,7 +361,7 @@ public class MenuEditPane extends JPanel {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("主类目");
// Build the tree
Map nodeMap = new HashMap<>();
- nodeMap.put(0l, root); // Root node
+ nodeMap.put(0L, root); // Root node
CommonResult> menuSimpleRespVOList = Request.connector(MenuFeign.class).getSimpleMenuList();
diff --git a/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/oauth2/client/ClientFormPane.java b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/oauth2/client/ClientFormPane.java
new file mode 100644
index 0000000..a1d71fe
--- /dev/null
+++ b/dillon-ui/dillon-ui-swing/src/main/java/com/lw/swing/view/system/oauth2/client/ClientFormPane.java
@@ -0,0 +1,383 @@
+/*
+ * Created by JFormDesigner on Sun Jun 16 15:15:27 CST 2024
+ */
+
+package com.lw.swing.view.system.oauth2.client;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.lang.Editor;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.jidesoft.swing.CheckBoxList;
+import com.lw.dillon.admin.framework.common.pojo.CommonResult;
+import com.lw.dillon.admin.module.system.controller.admin.dept.vo.post.PostSimpleRespVO;
+import com.lw.dillon.admin.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO;
+import com.lw.dillon.admin.module.system.controller.admin.oauth2.vo.client.OAuth2ClientRespVO;
+import com.lw.dillon.admin.module.system.controller.admin.oauth2.vo.client.OAuth2ClientSaveReqVO;
+import com.lw.swing.components.WScrollPane;
+import com.lw.swing.request.Request;
+import com.lw.swing.store.AppStore;
+import com.lw.ui.request.api.system.OAuth2ClientFeign;
+import com.lw.ui.utils.DictTypeEnum;
+import net.miginfocom.swing.MigLayout;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+
+/**
+ * @author wenli
+ */
+public class ClientFormPane extends JPanel {
+ private Long id = null;
+ private JPopupMenu authorizedGrantTypesPopupMenu;
+ private CheckBoxList authorizedGrantTypesCheckBoxList;
+
+ public ClientFormPane() {
+ initComponents();
+ initListeners();
+ }
+
+ private void initComponents() {
+ // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off
+ // Generated using JFormDesigner non-commercial license
+ label16 = new JLabel();
+ clientIdTextField = new JTextField();
+ label17 = new JLabel();
+ secretTextField = new JTextField();
+ label18 = new JLabel();
+ nameTextField = new JTextField();
+ label19 = new JLabel();
+ logoLabel = new JLabel();
+ label20 = new JLabel();
+ scrollPane1 = new JScrollPane();
+ descriptionTextArea = new JTextArea();
+ label21 = new JLabel();
+ statusComboBox = new JComboBox();
+ label22 = new JLabel();
+ accessTokenValiditySecondsSpinner = new JSpinner();
+ label23 = new JLabel();
+ refreshTokenValiditySecondsSpinner = new JSpinner();
+ label24 = new JLabel();
+ authorizedGrantTypesComboBox = new JTextField();
+ label25 = new JLabel();
+ scopesComboBox = new JTextField();
+ label26 = new JLabel();
+ autoApproveScopesComboBox = new JTextField();
+ label27 = new JLabel();
+ redirectUrisComboBox = new JTextField();
+ label28 = new JLabel();
+ authoritiesComboBox = new JTextField();
+ label29 = new JLabel();
+ resourceIdsComboBox = new JTextField();
+ label30 = new JLabel();
+ scrollPane2 = new JScrollPane();
+ additionalInformationTextArea = new JTextArea();
+
+ //======== this ========
+ setLayout(new MigLayout(
+ "fill,hidemode 3",
+ // columns
+ "[right]" +
+ "[320:420,grow,fill]",
+ // rows
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]" +
+ "[]"));
+
+ //---- label16 ----
+ label16.setText("\u5ba2\u6237\u7aef\u7f16\u53f7");
+ add(label16, "cell 0 0");
+ add(clientIdTextField, "cell 1 0");
+
+ //---- label17 ----
+ label17.setText("\u5ba2\u6237\u7aef\u5bc6\u94a5");
+ add(label17, "cell 0 1");
+ add(secretTextField, "cell 1 1");
+
+ //---- label18 ----
+ label18.setText("\u5e94\u7528\u540d");
+ add(label18, "cell 0 2");
+ add(nameTextField, "cell 1 2");
+
+ //---- label19 ----
+ label19.setText("\u5e94\u7528\u56fe\u6807");
+ add(label19, "cell 0 3");
+
+ //---- logoLabel ----
+ logoLabel.setText("text");
+ add(logoLabel, "cell 1 3,alignx center,growx 0");
+
+ //---- label20 ----
+ label20.setText("\u5e94\u7528\u63cf\u8ff0");
+ add(label20, "cell 0 4");
+
+ //======== scrollPane1 ========
+ {
+ scrollPane1.setViewportView(descriptionTextArea);
+ }
+ add(scrollPane1, "cell 1 4");
+
+ //---- label21 ----
+ label21.setText("\u72b6\u6001");
+ add(label21, "cell 0 5");
+ add(statusComboBox, "cell 1 5");
+
+ //---- label22 ----
+ label22.setText("\u8bbf\u95ee\u4ee4\u724c\u7684\u6709\u6548\u671f");
+ add(label22, "cell 0 6");
+ add(accessTokenValiditySecondsSpinner, "cell 1 6");
+
+ //---- label23 ----
+ label23.setText("\u5237\u65b0\u4ee4\u724c\u7684\u6709\u6548\u671f");
+ add(label23, "cell 0 7");
+ add(refreshTokenValiditySecondsSpinner, "cell 1 7");
+
+ //---- label24 ----
+ label24.setText("\u6388\u6743\u7c7b\u578b");
+ add(label24, "cell 0 8");
+ add(authorizedGrantTypesComboBox, "cell 1 8");
+
+ //---- label25 ----
+ label25.setText("\u6388\u6743\u8303\u56f4");
+ add(label25, "cell 0 9");
+ add(scopesComboBox, "cell 1 9");
+
+ //---- label26 ----
+ label26.setText("\u81ea\u52a8\u6388\u6743\u8303\u56f4");
+ add(label26, "cell 0 10");
+ add(autoApproveScopesComboBox, "cell 1 10");
+
+ //---- label27 ----
+ label27.setText("\u53ef\u91cd\u5b9a\u5411\u7684 URI \u5730\u5740");
+ add(label27, "cell 0 11");
+ add(redirectUrisComboBox, "cell 1 11");
+
+ //---- label28 ----
+ label28.setText("\u6743\u9650");
+ add(label28, "cell 0 12");
+ add(authoritiesComboBox, "cell 1 12");
+
+ //---- label29 ----
+ label29.setText("\u8d44\u6e90");
+ add(label29, "cell 0 13");
+ add(resourceIdsComboBox, "cell 1 13");
+
+ //---- label30 ----
+ label30.setText("\u9644\u52a0\u4fe1\u606f");
+ add(label30, "cell 0 14");
+
+ //======== scrollPane2 ========
+ {
+ scrollPane2.setViewportView(additionalInformationTextArea);
+ }
+ add(scrollPane2, "cell 1 14");
+ // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on
+
+ authorizedGrantTypesPopupMenu = new JPopupMenu();
+ authorizedGrantTypesCheckBoxList = new CheckBoxList();
+ authorizedGrantTypesCheckBoxList.setClickInCheckBoxOnly(false);
+ authorizedGrantTypesCheckBoxList.setCellRenderer(new DefaultListCellRenderer() {
+ @Override
+ public Component getListCellRendererComponent(JList> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ if (value instanceof DictDataSimpleRespVO) {
+ value = ((DictDataSimpleRespVO) value).getLabel();
+ }
+ return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ }
+ });
+ authorizedGrantTypesCheckBoxList.setFixedCellHeight(35);
+ authorizedGrantTypesPopupMenu.add(new WScrollPane(authorizedGrantTypesCheckBoxList));
+ authorizedGrantTypesComboBox.setEditable(false);
+ statusComboBox.addItem("开启");
+ statusComboBox.addItem("关闭");
+ refreshTokenValiditySecondsSpinner.setModel(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
+ accessTokenValiditySecondsSpinner.setModel(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
+ }
+
+ private void setValue(OAuth2ClientRespVO respVO) {
+ clientIdTextField.setText(respVO.getClientId());
+ secretTextField.setText(respVO.getSecret());
+ nameTextField.setText(respVO.getName());
+ logoLabel.setText(respVO.getLogo());
+ descriptionTextArea.setText(respVO.getDescription());
+ additionalInformationTextArea.setText(respVO.getAdditionalInformation());
+ accessTokenValiditySecondsSpinner.setValue(respVO.getAccessTokenValiditySeconds() == null ? 0 : respVO.getAccessTokenValiditySeconds());
+ refreshTokenValiditySecondsSpinner.setValue(respVO.getRefreshTokenValiditySeconds() == null ? 0 : respVO.getRefreshTokenValiditySeconds());
+ statusComboBox.setSelectedIndex(ObjectUtil.defaultIfNull(respVO.getStatus(), 0));
+
+ scopesComboBox.setText(Optional.ofNullable(respVO.getScopes()).orElse(Arrays.asList()) // 如果为 null,替换为一个空 List
+ .stream().collect(Collectors.joining(",")));
+ autoApproveScopesComboBox.setText(Optional.ofNullable(respVO.getAutoApproveScopes()).orElse(Arrays.asList()) // 如果为 null,替换为一个空 List
+ .stream().collect(Collectors.joining(",")));
+ redirectUrisComboBox.setText(Optional.ofNullable(respVO.getRedirectUris()).orElse(Arrays.asList()) // 如果为 null,替换为一个空 List
+ .stream().collect(Collectors.joining(",")));
+ authoritiesComboBox.setText(Optional.ofNullable(respVO.getAuthorities()).orElse(Arrays.asList()) // 如果为 null,替换为一个空 List
+ .stream().collect(Collectors.joining(",")));
+ resourceIdsComboBox.setText(Optional.ofNullable(respVO.getResourceIds()).orElse(Arrays.asList()) // 如果为 null,替换为一个空 List
+ .stream().collect(Collectors.joining(",")));
+
+
+ }
+
+ public OAuth2ClientSaveReqVO getValue() {
+ OAuth2ClientSaveReqVO reqVO = new OAuth2ClientSaveReqVO();
+ reqVO.setId(id);
+ reqVO.setClientId(clientIdTextField.getText());
+ reqVO.setSecret(secretTextField.getText());
+ reqVO.setName(nameTextField.getText());
+ reqVO.setLogo(logoLabel.getText());
+ reqVO.setDescription(descriptionTextArea.getText());
+ reqVO.setAccessTokenValiditySeconds(Convert.toInt(accessTokenValiditySecondsSpinner.getValue()));
+ reqVO.setRefreshTokenValiditySeconds(Convert.toInt(refreshTokenValiditySecondsSpinner.getValue()));
+ reqVO.setStatus(statusComboBox.getSelectedIndex());
+ Object[] types = authorizedGrantTypesCheckBoxList.getCheckBoxListSelectedValues();
+ List stringList = Arrays.stream(types).map(Object::toString) // 转换为 String
+ .collect(Collectors.toList());
+ reqVO.setAuthorizedGrantTypes(stringList);
+
+
+ reqVO.setScopes(Optional.ofNullable(scopesComboBox.getText()).filter(s -> !s.isEmpty()).map(s -> Arrays.stream(s.split(",")).map(String::trim).collect(Collectors.toList())) //
+ .orElse(Collections.emptyList()));
+ reqVO.setAutoApproveScopes(Optional.ofNullable(autoApproveScopesComboBox.getText()).filter(s -> !s.isEmpty()).map(s -> Arrays.stream(s.split(",")).map(String::trim).collect(Collectors.toList())) //
+ .orElse(Collections.emptyList()));
+ reqVO.setRedirectUris(Optional.ofNullable(redirectUrisComboBox.getText()).filter(s -> !s.isEmpty()).map(s -> Arrays.stream(s.split(",")).map(String::trim).collect(Collectors.toList())) //
+ .orElse(Collections.emptyList()));
+ reqVO.setAuthorities(Optional.ofNullable(authoritiesComboBox.getText()).filter(s -> !s.isEmpty()).map(s -> Arrays.stream(s.split(",")).map(String::trim).collect(Collectors.toList())) //
+ .orElse(Collections.emptyList()));
+ reqVO.setResourceIds(Optional.ofNullable(resourceIdsComboBox.getText()).filter(s -> !s.isEmpty()).map(s -> Arrays.stream(s.split(",")).map(String::trim).collect(Collectors.toList())) //
+ .orElse(Collections.emptyList()));
+
+ return reqVO;
+ }
+
+ private void initListeners() {
+
+ authorizedGrantTypesComboBox.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ if (SwingUtilities.isLeftMouseButton(e)) {
+ showAuthorizedTypePopupMenu();
+ }
+ }
+ });
+ authorizedGrantTypesCheckBoxList.getCheckBoxListSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+ Object[] objects = authorizedGrantTypesCheckBoxList.getCheckBoxListSelectedValues();
+ authorizedGrantTypesComboBox.setText(ArrayUtil.join(objects, ",", new Editor