From a6ac90e29e513b80b7ad881da8e319338021ef8b Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Thu, 25 Sep 2025 22:41:40 +0800
Subject: [PATCH] 生产环境配置
---
oying-system/src/main/java/com/oying/modules/security/config/WeiXinProperties.java | 2 --
oying-system/src/main/resources/config/application-dev.yml | 12 ++++++------
oying-tools/src/main/java/com/oying/service/impl/BucketStorageServiceImpl.java | 7 +++++--
oying-tools/src/main/java/com/oying/utils/ObsProperties.java | 1 -
oying-system/src/main/resources/config/application-prod.yml | 12 ++++++------
oying-generator/src/main/java/com/oying/rest/GeneratorController.java | 8 +++-----
oying-common/src/main/java/com/oying/utils/RedisUtils.java | 6 +++---
oying-system/src/main/java/com/oying/modules/security/service/WeiXinService.java | 6 +++---
oying-common/src/main/java/com/oying/config/webConfig/SwaggerConfig.java | 1 -
9 files changed, 26 insertions(+), 29 deletions(-)
diff --git a/oying-common/src/main/java/com/oying/config/webConfig/SwaggerConfig.java b/oying-common/src/main/java/com/oying/config/webConfig/SwaggerConfig.java
index f0eca0d..d3d3001 100644
--- a/oying-common/src/main/java/com/oying/config/webConfig/SwaggerConfig.java
+++ b/oying-common/src/main/java/com/oying/config/webConfig/SwaggerConfig.java
@@ -103,7 +103,6 @@
.map(url -> escapedApiPath + url) // 拼接API路径
.collect(Collectors.joining("|"));
String regExp = "^(?!" + pattern + ").*$";
- System.out.println("regExp: " + regExp);
return SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o->o.requestMappingPattern()
diff --git a/oying-common/src/main/java/com/oying/utils/RedisUtils.java b/oying-common/src/main/java/com/oying/utils/RedisUtils.java
index 6140508..eb0b2a4 100644
--- a/oying-common/src/main/java/com/oying/utils/RedisUtils.java
+++ b/oying-common/src/main/java/com/oying/utils/RedisUtils.java
@@ -24,8 +24,8 @@
@SuppressWarnings({"unchecked", "all"})
public class RedisUtils {
private static final Logger log = LoggerFactory.getLogger(RedisUtils.class);
- @Value("${wx.enabled}")
- private Boolean wxEnabled;
+ @Value("${oying.enabled}")
+ private Boolean oyingEnabled;
private static final String T = "T-";
private static final String OY = "OY-";
private RedisTemplate<Object, Object> redisTemplate;
@@ -55,7 +55,7 @@
} else {
sb.append(incrementStr);
}
- if (wxEnabled) {
+ if (oyingEnabled) {
// 生产环境
return OY + sb.toString();
} else {
diff --git a/oying-generator/src/main/java/com/oying/rest/GeneratorController.java b/oying-generator/src/main/java/com/oying/rest/GeneratorController.java
index a693983..e18487b 100644
--- a/oying-generator/src/main/java/com/oying/rest/GeneratorController.java
+++ b/oying-generator/src/main/java/com/oying/rest/GeneratorController.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.oying.domain.ColumnInfo;
-import com.oying.domain.dto.TableInfo;
import com.oying.service.GenConfigService;
import com.oying.service.GeneratorService;
import com.oying.utils.R;
@@ -10,7 +9,6 @@
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import com.oying.exception.BadRequestException;
-import com.oying.utils.PageResult;
import com.oying.utils.PageUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
@@ -34,8 +32,8 @@
private final GeneratorService generatorService;
private final GenConfigService genConfigService;
- @Value("${generator.enabled}")
- private Boolean generatorEnabled;
+ @Value("${oying.enabled}")
+ private Boolean oyingEnabled;
@ApiOperation("查询数据库数据")
@GetMapping(value = "/tables")
@@ -69,7 +67,7 @@
@ApiOperation("生成代码")
@PostMapping(value = "/{tableName}/{type}")
public ResponseEntity<Object> generatorCode(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response) {
- if (!generatorEnabled && type == 0) {
+ if (!oyingEnabled && type == 0) {
throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!");
}
switch (type) {
diff --git a/oying-system/src/main/java/com/oying/modules/security/config/WeiXinProperties.java b/oying-system/src/main/java/com/oying/modules/security/config/WeiXinProperties.java
index 23fb1a7..0709f53 100644
--- a/oying-system/src/main/java/com/oying/modules/security/config/WeiXinProperties.java
+++ b/oying-system/src/main/java/com/oying/modules/security/config/WeiXinProperties.java
@@ -30,6 +30,4 @@
private String getPhoneNumber;
/*POST 该接口用于发送订阅消息。*/
private String sendMessage;
- /* 是否生产环境*/
- private boolean enabled;
}
diff --git a/oying-system/src/main/java/com/oying/modules/security/service/WeiXinService.java b/oying-system/src/main/java/com/oying/modules/security/service/WeiXinService.java
index 5b2cc7c..7d5c7f5 100644
--- a/oying-system/src/main/java/com/oying/modules/security/service/WeiXinService.java
+++ b/oying-system/src/main/java/com/oying/modules/security/service/WeiXinService.java
@@ -26,8 +26,8 @@
private WeiXinProperties weiXinProperties;
@Resource
private RedisUtils redisUtils;
- @Value("${wx.enabled}")
- private Boolean wxEnabled;
+ @Value("${oying.enabled}")
+ private Boolean oyingEnabled;
@Resource
private UserSubscribeService subscribeService;
@Resource
@@ -144,7 +144,7 @@
*/
public void sendMessage(Map<String, Object> data, String openid, String templateId, String page) {
JSONObject jsonObject = new JSONObject();
- if (wxEnabled) {
+ if (oyingEnabled) {
String url = weiXinProperties.getSendMessage();
url = url.replace("{accessToken}", getStableAccessToken());
Map<String, Object> map = getSendMessageDto(data, openid, templateId, page);
diff --git a/oying-system/src/main/resources/config/application-dev.yml b/oying-system/src/main/resources/config/application-dev.yml
index 02717a3..394d288 100644
--- a/oying-system/src/main/resources/config/application-dev.yml
+++ b/oying-system/src/main/resources/config/application-dev.yml
@@ -94,8 +94,8 @@
# 续期时间范围,默认1小时,单位毫秒
renew: 3600000
-#是否允许生成代码,生产环境设置为false
-generator:
+#生产环境设置为false
+oying:
enabled: true
#是否开启 swagger-ui
@@ -124,8 +124,6 @@
#微信配置
wx:
- # 测试环境
- enabled: true
# AppID
app-id: wx2273296a5569cbad
# AppSecret
@@ -174,8 +172,6 @@
refund-url: http://api.o-ying.cn:8088/oying/api/swiftPass/returnNotify
obs:
- # 测试环境
- enabled: true
access_key_id: HPUATJYFVPO6DABSVEKA
access_key_secret: 8TQG5wnLID3MsUPsJjmZ31LtKlgyvFFUDvXnI9nm
bucket: o-ying
@@ -186,3 +182,7 @@
url-send-msg-batch: https://118.178.116.15:8443/winnerrxd/api/trigger/SendBatchMsg
user-code: CQLYSXYJ
user-pass: lych1205!
+
+# 支付类型
+pay:
+ type: HWC
diff --git a/oying-system/src/main/resources/config/application-prod.yml b/oying-system/src/main/resources/config/application-prod.yml
index 6bfc2f9..8fbe4d2 100644
--- a/oying-system/src/main/resources/config/application-prod.yml
+++ b/oying-system/src/main/resources/config/application-prod.yml
@@ -98,8 +98,8 @@
# 续期时间范围,默认 1小时,这里单位毫秒
renew: 3600000
-#是否允许生成代码,生产环境设置为false
-generator:
+#生产环境设置为false
+oying:
enabled: false
#如果生产环境要开启swagger,需要配置请求地址
@@ -135,8 +135,6 @@
#微信配置
wx:
- # 测试环境
- enabled: false
# AppID
app-id: wx2273296a5569cbad
# AppSecret
@@ -189,8 +187,6 @@
refund-url: https://o-ying.cn/oying/api/swiftPass/returnNotify
obs:
- # 测试环境
- enabled: false
access_key_id: HPUATJYFVPO6DABSVEKA
access_key_secret: 8TQG5wnLID3MsUPsJjmZ31LtKlgyvFFUDvXnI9nm
bucket: o-ying
@@ -201,3 +197,7 @@
url-send-msg-batch: https://118.178.116.15:8443/winnerrxd/api/trigger/SendBatchMsg
user-code: CQLYSXYJ
user-pass: lych1205!
+
+# 支付类型
+pay:
+ type: HWC2
diff --git a/oying-tools/src/main/java/com/oying/service/impl/BucketStorageServiceImpl.java b/oying-tools/src/main/java/com/oying/service/impl/BucketStorageServiceImpl.java
index 7ac8038..3d13bca 100644
--- a/oying-tools/src/main/java/com/oying/service/impl/BucketStorageServiceImpl.java
+++ b/oying-tools/src/main/java/com/oying/service/impl/BucketStorageServiceImpl.java
@@ -14,6 +14,7 @@
import com.oying.service.BucketStorageService;
import com.oying.domain.dto.BucketStorageQueryCriteria;
import com.oying.mapper.BucketStorageMapper;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +40,8 @@
private final BucketStorageMapper bucketStorageMapper;
private final ObsProperties properties;
private final FileProperties fileProperties;
+ @Value("${oying.enabled}")
+ private Boolean oyingEnabled;
@Override
public PageResult<BucketStorage> queryAll(BucketStorageQueryCriteria criteria, Page<Object> page) {
@@ -58,7 +61,7 @@
String type = FileUtil.getFileType(suffix);
String reaName = System.currentTimeMillis() + "." + suffix;
String objectKey = type + "/" + reaName;
- if (properties.getEnabled()) {
+ if (oyingEnabled) {
objectKey = "test/" +objectKey;
}
PutObjectResult result = ObsUtils.putObject(properties, file, objectKey, AccessControlList.REST_CANNED_PUBLIC_READ);
@@ -86,7 +89,7 @@
String type = FileUtil.getFileType(suffix);
String reaName = IdUtil.getSnowflake(1, 1).nextId() + "." + suffix;
String objectKey = type + "/" + reaName;
- if (properties.getEnabled()) {
+ if (oyingEnabled) {
objectKey = "test/" +objectKey;
}
PutObjectResult result = ObsUtils.putObject(properties, FileUtil.toFile(file), objectKey, AccessControlList.REST_CANNED_PUBLIC_READ);
diff --git a/oying-tools/src/main/java/com/oying/utils/ObsProperties.java b/oying-tools/src/main/java/com/oying/utils/ObsProperties.java
index bdd8e8c..c6e0724 100644
--- a/oying-tools/src/main/java/com/oying/utils/ObsProperties.java
+++ b/oying-tools/src/main/java/com/oying/utils/ObsProperties.java
@@ -18,5 +18,4 @@
private String accessKeySecret;
private String bucket;
private String endpoint;
- private Boolean enabled;
}
--
Gitblit v1.9.3