添加翻译模块
This commit is contained in:
65
tashow-module/tashow-module-translate/pom.xml
Normal file
65
tashow-module/tashow-module-translate/pom.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-module</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>tashow-module-translate</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Registry 注册中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Config 配置中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-rpc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-data-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-env</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-infra-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.tashow.cloud.translate;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用服务启动类
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
public class TranslateServerApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(TranslateServerApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.tashow.cloud.translate.controller;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
package com.tashow.cloud.translate.dal.dataobject;
|
||||||
|
// 数据库对象
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.tashow.cloud.translate.dal;
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.tashow.cloud.translate.security.config;
|
||||||
|
|
||||||
|
import com.tashow.cloud.infraapi.enums.ApiConstants;
|
||||||
|
import com.tashow.cloud.security.security.config.AuthorizeRequestsCustomizer;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Infra 模块的 Security 配置
|
||||||
|
*/
|
||||||
|
@Configuration(proxyBeanMethods = false, value = "infraSecurityConfiguration")
|
||||||
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
|
@Value("${spring.boot.admin.context-path:''}")
|
||||||
|
private String adminSeverContextPath;
|
||||||
|
|
||||||
|
@Bean("infraAuthorizeRequestsCustomizer")
|
||||||
|
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||||
|
return new AuthorizeRequestsCustomizer() {
|
||||||
|
@Override
|
||||||
|
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||||
|
// Spring Boot Actuator 的安全配置
|
||||||
|
registry.requestMatchers("/actuator").permitAll()
|
||||||
|
.requestMatchers("/actuator/**").permitAll();
|
||||||
|
// Druid 监控
|
||||||
|
registry.requestMatchers("/druid/**").permitAll();
|
||||||
|
// Spring Boot Admin Server 的安全配置
|
||||||
|
registry.requestMatchers(adminSeverContextPath).permitAll()
|
||||||
|
.requestMatchers(adminSeverContextPath + "/**").permitAll();
|
||||||
|
// 文件读取
|
||||||
|
registry.requestMatchers(buildAdminApi("/infra/file/*/get/**")).permitAll();
|
||||||
|
|
||||||
|
// TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案
|
||||||
|
// RPC 服务的安全配置
|
||||||
|
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 占位
|
||||||
|
*/
|
||||||
|
package com.tashow.cloud.translate.security.core;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.tashow.cloud.translate.service.feishu;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.tashow.cloud.translate.service;
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 43.139.42.137:8848 # Nacos 服务器地址
|
||||||
|
username: nacos # Nacos 账号
|
||||||
|
password: nacos # Nacos 密码
|
||||||
|
discovery: # 【配置中心】配置项
|
||||||
|
namespace: 5c8b8fe6-9a89-4ae3-975e-ef3bf560ff82 # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
config: # 【注册中心】配置项
|
||||||
|
namespace: 5c8b8fe6-9a89-4ae3-975e-ef3bf560ff82 # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
server:
|
||||||
|
port: 48086
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: translate-server
|
||||||
|
profiles:
|
||||||
|
active: local
|
||||||
|
config:
|
||||||
|
import:
|
||||||
|
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||||
|
- optional:nacos:application.yaml # 加载【Nacos】的配置
|
||||||
|
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||||
Reference in New Issue
Block a user