完成支付、电子面单、模板消息队列等功能
This commit is contained in:
@ -69,7 +69,7 @@ public class ConfigController {
|
||||
|
||||
@GetMapping(value = "/get-value-by-key")
|
||||
@Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
|
||||
@Parameter(name = "key", description = "参数键", required = true, example = "yunai.biz.username")
|
||||
@Parameter(name = "key", description = "参数键", required = true, example = "yshop.biz.username")
|
||||
public CommonResult<String> getConfigKey(@RequestParam("key") String key) {
|
||||
ConfigDO config = configService.getConfigByKey(key);
|
||||
if (config == null) {
|
||||
|
@ -12,7 +12,7 @@ import javax.validation.constraints.Size;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ConfigCreateReqVO extends ConfigBaseVO {
|
||||
|
||||
@Schema(description = "参数键名", required = true, example = "yunai.db.username")
|
||||
@Schema(description = "参数键名", required = true, example = "yshop.db.username")
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(max = 100, message = "参数键名长度不能超过100个字符")
|
||||
private String key;
|
||||
|
@ -15,7 +15,7 @@ public class ConfigExportReqVO {
|
||||
@Schema(description = "参数名称", example = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "参数键名,模糊匹配", example = "yunai.db.username")
|
||||
@Schema(description = "参数键名,模糊匹配", example = "yshop.db.username")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1")
|
||||
|
@ -20,7 +20,7 @@ public class ConfigPageReqVO extends PageParam {
|
||||
@Schema(description = "数据源名称,模糊匹配", example = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "参数键名,模糊匹配", example = "yunai.db.username")
|
||||
@Schema(description = "参数键名,模糊匹配", example = "yshop.db.username")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1")
|
||||
|
@ -16,7 +16,7 @@ public class ConfigRespVO extends ConfigBaseVO {
|
||||
@Schema(description = "参数配置序号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "参数键名", required = true, example = "yunai.db.username")
|
||||
@Schema(description = "参数键名", required = true, example = "yshop.db.username")
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(max = 100, message = "参数键名长度不能超过100个字符")
|
||||
private String key;
|
||||
|
@ -14,7 +14,7 @@ public class DataSourceConfigBaseVO {
|
||||
@NotNull(message = "数据源名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro")
|
||||
@Schema(description = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/yshop-pro")
|
||||
@NotNull(message = "数据源连接不能为空")
|
||||
private String url;
|
||||
|
||||
|
@ -1,45 +0,0 @@
|
||||
### 请求 /infra/file-config/create 接口 => 成功
|
||||
POST {{baseUrl}}/infra/file-config/create
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"name": "S3 - 七牛云",
|
||||
"remark": "",
|
||||
"storage": 20,
|
||||
"config": {
|
||||
"accessKey": "b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8",
|
||||
"accessSecret": "kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP",
|
||||
"bucket": "ruoyi-vue-pro",
|
||||
"endpoint": "s3-cn-south-1.qiniucs.com",
|
||||
"domain": "http://test.yshop.iocoder.cn",
|
||||
"region": "oss-cn-beijing"
|
||||
}
|
||||
}
|
||||
|
||||
### 请求 /infra/file-config/update 接口 => 成功
|
||||
PUT {{baseUrl}}/infra/file-config/update
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"name": "S3 - 七牛云",
|
||||
"remark": "",
|
||||
"config": {
|
||||
"accessKey": "b7yvuhBSAGjmtPhMFcn9iMOxUOY_I06cA_p0ZUx8",
|
||||
"accessSecret": "kXM1l5ia1RvSX3QaOEcwI3RLz3Y2rmNszWonKZtP",
|
||||
"bucket": "ruoyi-vue-pro",
|
||||
"endpoint": "s3-cn-south-1.qiniucs.com",
|
||||
"domain": "http://test.yshop.iocoder.cn",
|
||||
"region": "oss-cn-beijing"
|
||||
}
|
||||
}
|
||||
|
||||
### 请求 /infra/file-config/test 接口 => 成功
|
||||
GET {{baseUrl}}/infra/file-config/test?id=2
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
Authorization: Bearer {{token}}
|
@ -21,7 +21,7 @@ public class FileRespVO {
|
||||
@Schema(description = "原文件名", required = true, example = "yshop.jpg")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "文件 URL", required = true, example = "https://www.iocoder.cn/yshop.jpg")
|
||||
@Schema(description = "文件 URL", required = true, example = "yshop.jpg")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件MIME类型", example = "application/octet-stream")
|
||||
|
@ -1,9 +0,0 @@
|
||||
### 请求 /infra/redis/get-monitor-info 接口 => 成功
|
||||
GET {{baseUrl}}/infra/redis/get-monitor-info
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
### 请求 /infra/redis/get-key-list 接口 => 成功
|
||||
GET {{baseUrl}}/infra/redis/get-key-list
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
@ -1,19 +0,0 @@
|
||||
### 请求 /infra/test-demo/get 接口 => 成功
|
||||
GET {{baseUrl}}/infra/test-demo/get?id=106
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
### 请求 /infra/test-demo/update 接口 => 成功
|
||||
PUT {{baseUrl}}/infra/test-demo/update
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
Content-Type: application/json
|
||||
|
||||
|
||||
{
|
||||
"id": 106,
|
||||
"name": "测试",
|
||||
"status": "0",
|
||||
"type": 1,
|
||||
"category": 1
|
||||
}
|
@ -1 +0,0 @@
|
||||
<https://www.yixiang.co/Spring-Boot/MapStruct/?yshop>
|
@ -1 +0,0 @@
|
||||
<https://www.yixiang.co/Spring-Boot/Admin/?yshop>
|
@ -195,7 +195,7 @@ public class CodegenBuilder {
|
||||
}
|
||||
// url
|
||||
if (StrUtil.endWithIgnoreCase(column.getColumnName(), "url")) {
|
||||
column.setExample("https://www.iocoder.cn");
|
||||
column.setExample("https://www.yixiang.co");
|
||||
return;
|
||||
}
|
||||
// reason
|
||||
|
@ -6,7 +6,7 @@
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
文档可见:https://www.yixiang.co/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
|
@ -6,7 +6,7 @@
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
文档可见:https://www.yixiang.co/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectList2" resultType="TestDemoDO">
|
||||
|
@ -13,7 +13,7 @@ public class DefaultDatabaseQueryTest {
|
||||
public static void main(String[] args) {
|
||||
// DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:oracle:thin:@127.0.0.1:1521:xe",
|
||||
// "root", "123456").build();
|
||||
DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro",
|
||||
DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:postgresql://127.0.0.1:5432/yshop-pro",
|
||||
"root", "123456").build();
|
||||
// StrategyConfig strategyConfig = new StrategyConfig.Builder().build();
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class ConfigServiceImplTest extends BaseDbUnitTest {
|
||||
// mock 数据
|
||||
ConfigDO dbConfig = randomConfigDO(o -> { // 等会查询到
|
||||
o.setName("yshop");
|
||||
o.setConfigKey("yunai");
|
||||
o.setConfigKey("yshop");
|
||||
o.setType(ConfigTypeEnum.SYSTEM.getType());
|
||||
o.setCreateTime(buildTime(2021, 2, 1));
|
||||
});
|
||||
@ -183,7 +183,7 @@ public class ConfigServiceImplTest extends BaseDbUnitTest {
|
||||
// mock 数据
|
||||
ConfigDO dbConfig = randomConfigDO(o -> { // 等会查询到
|
||||
o.setName("yshop");
|
||||
o.setConfigKey("yunai");
|
||||
o.setConfigKey("yshop");
|
||||
o.setType(ConfigTypeEnum.SYSTEM.getType());
|
||||
o.setCreateTime(buildTime(2021, 2, 1));
|
||||
});
|
||||
|
@ -63,7 +63,7 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest {
|
||||
// mock DynamicDataSourceProperties
|
||||
when(dynamicDataSourceProperties.getPrimary()).thenReturn("primary");
|
||||
when(dynamicDataSourceProperties.getDatasource()).thenReturn(MapUtil.of("primary",
|
||||
new DataSourceProperty().setUrl("http://localhost:3306").setUsername("yunai").setPassword("tudou")));
|
||||
new DataSourceProperty().setUrl("http://localhost:3306").setUsername("yshop").setPassword("tudou")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -163,7 +163,7 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest {
|
||||
assertEquals(id, dataSourceConfig.getId());
|
||||
assertEquals("primary", dataSourceConfig.getName());
|
||||
assertEquals("http://localhost:3306", dataSourceConfig.getUrl());
|
||||
assertEquals("yunai", dataSourceConfig.getUsername());
|
||||
assertEquals("yshop", dataSourceConfig.getUsername());
|
||||
assertEquals("tudou", dataSourceConfig.getPassword());
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest {
|
||||
assertEquals(0L, dataSourceConfigList.get(0).getId());
|
||||
assertEquals("primary", dataSourceConfigList.get(0).getName());
|
||||
assertEquals("http://localhost:3306", dataSourceConfigList.get(0).getUrl());
|
||||
assertEquals("yunai", dataSourceConfigList.get(0).getUsername());
|
||||
assertEquals("yshop", dataSourceConfigList.get(0).getUsername());
|
||||
assertEquals("tudou", dataSourceConfigList.get(0).getPassword());
|
||||
// normal
|
||||
assertPojoEquals(dbDataSourceConfig, dataSourceConfigList.get(1));
|
||||
|
@ -86,8 +86,8 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest {
|
||||
@Test
|
||||
public void testCreateFileConfig_success() {
|
||||
// 准备参数
|
||||
Map<String, Object> config = MapUtil.<String, Object>builder().put("basePath", "/yunai")
|
||||
.put("domain", "https://www.iocoder.cn").build();
|
||||
Map<String, Object> config = MapUtil.<String, Object>builder().put("basePath", "/yshop")
|
||||
.put("domain", "https://www.yixiang.co").build();
|
||||
FileConfigCreateReqVO reqVO = randomPojo(FileConfigCreateReqVO.class,
|
||||
o -> o.setStorage(FileStorageEnum.LOCAL.getStorage()).setConfig(config));
|
||||
|
||||
@ -99,8 +99,8 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest {
|
||||
FileConfigDO fileConfig = fileConfigMapper.selectById(fileConfigId);
|
||||
assertPojoEquals(reqVO, fileConfig, "config");
|
||||
assertFalse(fileConfig.getMaster());
|
||||
assertEquals("/yunai", ((LocalFileClientConfig) fileConfig.getConfig()).getBasePath());
|
||||
assertEquals("https://www.iocoder.cn", ((LocalFileClientConfig) fileConfig.getConfig()).getDomain());
|
||||
assertEquals("/yshop", ((LocalFileClientConfig) fileConfig.getConfig()).getBasePath());
|
||||
assertEquals("https://www.yixiang.co", ((LocalFileClientConfig) fileConfig.getConfig()).getDomain());
|
||||
// verify 调用
|
||||
verify(fileConfigProducer).sendFileConfigRefreshMessage();
|
||||
}
|
||||
@ -237,10 +237,10 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest {
|
||||
// mock 获得 Client
|
||||
FileClient fileClient = mock(FileClient.class);
|
||||
when(fileClientFactory.getFileClient(eq(id))).thenReturn(fileClient);
|
||||
when(fileClient.upload(any(), any(), any())).thenReturn("https://www.iocoder.cn");
|
||||
when(fileClient.upload(any(), any(), any())).thenReturn("https://www.yixiang.co");
|
||||
|
||||
// 调用,并断言
|
||||
assertEquals("https://www.iocoder.cn", fileConfigService.testFileConfig(id));
|
||||
assertEquals("https://www.yixiang.co", fileConfigService.testFileConfig(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -41,7 +41,7 @@ public class FileServiceImplTest extends BaseDbUnitTest {
|
||||
public void testGetFilePage() {
|
||||
// mock 数据
|
||||
FileDO dbFile = randomPojo(FileDO.class, o -> { // 等会查询到
|
||||
o.setPath("yunai");
|
||||
o.setPath("yshop");
|
||||
o.setType("image/jpg");
|
||||
o.setCreateTime(buildTime(2021, 1, 15));
|
||||
});
|
||||
@ -58,7 +58,7 @@ public class FileServiceImplTest extends BaseDbUnitTest {
|
||||
}));
|
||||
// 准备参数
|
||||
FilePageReqVO reqVO = new FilePageReqVO();
|
||||
reqVO.setPath("yunai");
|
||||
reqVO.setPath("yshop");
|
||||
reqVO.setType("jp");
|
||||
reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 1, 10), buildTime(2021, 1, 20)}));
|
||||
|
||||
|
@ -8,7 +8,7 @@ spring:
|
||||
spring:
|
||||
# 数据源配置项
|
||||
datasource:
|
||||
name: ruoyi-vue-pro
|
||||
name: yshop-pro
|
||||
url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;NON_KEYWORDS=value; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
|
||||
driver-class-name: org.h2.Driver
|
||||
username: sa
|
||||
|
Reference in New Issue
Block a user