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() 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 { 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) { 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; } 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); 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 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 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); 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; }