Commit d1ac8610535b4bdd655c86ba4c95a5ffbde8e362

Authored by huanggang
1 parent 39319fa3

assistant mutiple environment support

assistant-boot/src/main/resources/application-dev.properties
@@ -36,8 +36,8 @@ spring.servlet.multipart.file-size-threshold=20MB @@ -36,8 +36,8 @@ spring.servlet.multipart.file-size-threshold=20MB
36 dfs.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo= 36 dfs.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo=
37 dfs.public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL0bQQa0F+XYtY0D21Ifi7uaTMK4Ovx/f11+6gVO3bBgP8soEAB+wGG/36R0NRkA6JVNy1YGLdyBON0GnC6NPTMCAwEAAQ== 37 dfs.public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL0bQQa0F+XYtY0D21Ifi7uaTMK4Ovx/f11+6gVO3bBgP8soEAB+wGG/36R0NRkA6JVNy1YGLdyBON0GnC6NPTMCAwEAAQ==
38 dfs.oss.uri=https://oss-cn-hangzhou.aliyuncs.com 38 dfs.oss.uri=https://oss-cn-hangzhou.aliyuncs.com
39 -dfs.oss.access-key-id=LTAI5tS2xUrriUfti9pvDTwM  
40 -dfs.oss.access-key-secret=NIa9FQMDc5zSAtvfOeOK4J1dp7aotg 39 +dfs.oss.access-key-id=LTAI5tRiMbdaVfND45TBFatu
  40 +dfs.oss.access-key-secret=zP2P1i0MLiOBDKO6naQZRy4Ls70cEf
41 41
42 #Sms configuration 42 #Sms configuration
43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo= 43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo=
assistant-boot/src/main/resources/application-prod.properties
@@ -35,9 +35,9 @@ spring.servlet.multipart.max-request-size=100MB @@ -35,9 +35,9 @@ spring.servlet.multipart.max-request-size=100MB
35 spring.servlet.multipart.file-size-threshold=20MB 35 spring.servlet.multipart.file-size-threshold=20MB
36 dfs.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo= 36 dfs.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo=
37 dfs.public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL0bQQa0F+XYtY0D21Ifi7uaTMK4Ovx/f11+6gVO3bBgP8soEAB+wGG/36R0NRkA6JVNy1YGLdyBON0GnC6NPTMCAwEAAQ== 37 dfs.public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL0bQQa0F+XYtY0D21Ifi7uaTMK4Ovx/f11+6gVO3bBgP8soEAB+wGG/36R0NRkA6JVNy1YGLdyBON0GnC6NPTMCAwEAAQ==
38 -dfs.oss.uri=https://oss-cn-hangzhou.aliyuncs.com  
39 -dfs.oss.access-key-id=LTAI5tS2xUrriUfti9pvDTwM  
40 -dfs.oss.access-key-secret=NIa9FQMDc5zSAtvfOeOK4J1dp7aotg 38 +dfs.oss.uri=https://oss-cn-beijing-internal.aliyuncs.com
  39 +dfs.oss.access-key-id=LTAI5tRiMbdaVfND45TBFatu
  40 +dfs.oss.access-key-secret=zP2P1i0MLiOBDKO6naQZRy4Ls70cEf
41 41
42 #Sms configuration 42 #Sms configuration
43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo= 43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo=
assistant-boot/src/main/resources/application-test.properties
@@ -36,8 +36,8 @@ spring.servlet.multipart.file-size-threshold=20MB @@ -36,8 +36,8 @@ spring.servlet.multipart.file-size-threshold=20MB
36 dfs.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6A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AJBAL0bQQa0F+XYtY0D21Ifi7uaTMK4Ovx/f11+6gVO3bBgP8soEAB+wGG/36R0NRkA6JVNy1YGLdyBON0GnC6NPTMCAwEAAQ==
38 dfs.oss.uri=https://oss-cn-hangzhou.aliyuncs.com 38 dfs.oss.uri=https://oss-cn-hangzhou.aliyuncs.com
39 -dfs.oss.access-key-id=LTAI5tS2xUrriUfti9pvDTwM  
40 -dfs.oss.access-key-secret=NIa9FQMDc5zSAtvfOeOK4J1dp7aotg 39 +dfs.oss.access-key-id=LTAI5tRiMbdaVfND45TBFatu
  40 +dfs.oss.access-key-secret=zP2P1i0MLiOBDKO6naQZRy4Ls70cEf
41 41
42 #Sms configuration 42 #Sms configuration
43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo= 43 sms.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAvRtBBrQX5di1jQPbUh+Lu5pMwrg6/H9/XX7qBU7dsGA/yygQAH7AYb/fpHQ1GQDolU3LVgYt3IE43QacLo09MwIDAQABAkAJ8U5kb8e0U2J+CmIJedRZO0GtX+MeD1uX51iCNJqYvbI/tKAgqd9ulc07it7tW0vGhDDj+WaVLp1R5D7bgRcpAiEA6Vc1xjoMYmT+OL+DZfipOeMTUwEePCg0Eq8DnVtalgsCIQDPeGSQ+lVijjNTEF7swM6rH5Ofa1E+ry5VRAw1ywI2eQIgdNFuYIErNg9tnqdydxiYUBy4zfNfWaqe90ObQao8naUCIQComhNIClgXZq5pA3XQ+wM458llFaaJxX1mx40QrjDXKQIgB+x7Fz2MT/GdIUhN6s1Rpfb5IIAR51ztiVEJlJ+wpdo=
assistant-boot/src/main/resources/bootstrap.properties
1 -server.port=8080 1 +server.port=8680
2 server.servlet.context-path=/ 2 server.servlet.context-path=/
3 server.servlet.encoding.charset=UTF-8 3 server.servlet.encoding.charset=UTF-8
4 server.servlet.encoding.force=true 4 server.servlet.encoding.force=true
5 5
6 -spring.profiles.active=dev  
7 -spring.application.name=uap-service  
8 \ No newline at end of file 6 \ No newline at end of file
  7 +spring.profiles.active=prod
  8 +spring.application.name=assistant-service
9 \ No newline at end of file 9 \ No newline at end of file
assistant-dfs/src/main/java/com/diligrp/assistant/dfs/DfsConfiguration.java
@@ -28,7 +28,7 @@ public class DfsConfiguration { @@ -28,7 +28,7 @@ public class DfsConfiguration {
28 DfsProperties.Oss oss = properties.getOss(); 28 DfsProperties.Oss oss = properties.getOss();
29 if (oss != null) { 29 if (oss != null) {
30 // 可利用数据库进行通道配置, 前期并没有必要 30 // 可利用数据库进行通道配置, 前期并没有必要
31 - DfsPipeline pipeline = new OssPipeline(1, "OSS文件存储服务", oss.getUri(), 31 + DfsPipeline pipeline = new OssPipeline(10, "OSS文件存储服务", oss.getUri(),
32 oss.getAccessKeyId(), oss.getAccessKeySecret()); 32 oss.getAccessKeyId(), oss.getAccessKeySecret());
33 pipelineManager.registerPipeline(pipeline); 33 pipelineManager.registerPipeline(pipeline);
34 } 34 }
assistant-dfs/src/main/java/com/diligrp/assistant/dfs/controller/FileRepositoryController.java
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestHeader; @@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestHeader;
17 import org.springframework.web.bind.annotation.RequestMapping; 17 import org.springframework.web.bind.annotation.RequestMapping;
18 import org.springframework.web.bind.annotation.RestController; 18 import org.springframework.web.bind.annotation.RestController;
19 19
  20 +import java.time.LocalDateTime;
  21 +
20 @RestController 22 @RestController
21 @RequestMapping(value = "/dfs") 23 @RequestMapping(value = "/dfs")
22 public class FileRepositoryController { 24 public class FileRepositoryController {
@@ -34,7 +36,8 @@ public class FileRepositoryController { @@ -34,7 +36,8 @@ public class FileRepositoryController {
34 36
35 DfsAccessToken accessToken = new DfsAccessToken(request.getPipeline(), RandomUtils.randomUUID(false)); 37 DfsAccessToken accessToken = new DfsAccessToken(request.getPipeline(), RandomUtils.randomUUID(false));
36 FileRepository repository = FileRepository.builder().repositoryId(accessToken.getRepositoryId()) 38 FileRepository repository = FileRepository.builder().repositoryId(accessToken.getRepositoryId())
37 - .name(request.getName()).pipeline(request.getPipeline()).description(request.getDescription()).build(); 39 + .name(request.getName()).pipeline(request.getPipeline()).description(request.getDescription())
  40 + .createdTime(LocalDateTime.now()).build();
38 fileRepositoryService.createFileRepository(accessToken, repository); 41 fileRepositoryService.createFileRepository(accessToken, repository);
39 return Message.success(accessToken.toString(dfsProperties.getPrivateKey())); 42 return Message.success(accessToken.toString(dfsProperties.getPrivateKey()));
40 } 43 }
scripts/assistant-data.sql
  1 +USE dili_assistant;
  2 +-- 短信模板ID
1 INSERT INTO uid_sequence_key (`key`, `name`, `value`, `step`, `pattern`, `expired_on`, `version`) 3 INSERT INTO uid_sequence_key (`key`, `name`, `value`, `step`, `pattern`, `expired_on`, `version`)
2 -VALUES ('SMS_TEMPLATE_KEY', 'SMS消息模版ID', 1, 1, 'SMS%d{yyyyMMdd}%n{4}', '2024-06-05', 0)  
3 \ No newline at end of file 4 \ No newline at end of file
  5 +VALUES ('SMS_TEMPLATE_KEY', 'SMS消息模版ID', 1, 1, 'SMS%d{yyyyMMdd}%n{4}', '2024-06-05', 0)
  6 +
  7 +INSERT INTO `sms_template`(`template_id`, `pipeline`, `type`, `name`, `content`, `state`, `description`, `out_template_id`, `created_time`, `modified_time`)
  8 +VALUES ('SMS202408080001', 20, 0, '商户注册短信模板', '验证码:${code},电子结算商户版注册验证码10分钟内有效。如非本人操作,请忽略本短信。', 2, '电子结算商户版注册验证码短信模板', NULL, '2024-08-08 17:31:55', '2024-08-08 17:55:29');
  9 +
  10 +-- DFS文件服务
  11 +INSERT INTO `dfs_file_repository`(`repository_id`, `name`, `pipeline`, `description`, `created_time`) VALUES ('29ad2204ca8248daa5b09be73dc26926', '商户版电子结算存储空间', 10, '存储商户版电子结算所有使用的图片-非生产环境', '2024-08-20 10:43:05');
  12 +INSERT INTO `dfs_file_repository`(`repository_id`, `name`, `pipeline`, `description`, `created_time`) VALUES ('fa6f828deae94f45a615b73790116699', '商户版电子结算存储空间', 10, '存储商户版电子结算所有使用的图片-生产环境', '2024-08-20 10:43:05');