修改了一些bug
parent
237833717a
commit
50159ad57e
|
|
@ -22,6 +22,11 @@
|
|||
</dependency>
|
||||
|
||||
<!-- Spring Boot 配置所需依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@
|
|||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
|
|
|
|||
|
|
@ -54,3 +54,5 @@ knife4j:
|
|||
# 聚合 Swagger 文档
|
||||
gateway:
|
||||
enable: true
|
||||
|
||||
debug: true
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ spring:
|
|||
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
main:
|
||||
web-application-type: reactive
|
||||
server:
|
||||
port: 48080
|
||||
|
||||
|
|
@ -12,3 +13,5 @@ server:
|
|||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,24 @@
|
|||
package cn.iocoder.yudao.module.infra.api.db;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.db.dto.DataSourceConfigRespDTO;
|
||||
import cn.iocoder.yudao.module.infra.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 数据源配置 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 数据源配置")
|
||||
public interface DataSourceConfigServiceApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/datasource";
|
||||
|
||||
/**
|
||||
* 获得数据源配置
|
||||
|
|
@ -15,6 +26,9 @@ public interface DataSourceConfigServiceApi {
|
|||
* @param id 编号
|
||||
* @return 数据源配置
|
||||
*/
|
||||
DataSourceConfigRespDTO getDataSourceConfig(Long id);
|
||||
@GetMapping(PREFIX + "/datasource-config")
|
||||
@Operation(summary = "获得数据源信息")
|
||||
@Parameter(name = "id", description = "数据源编号", required = true, example = "1024")
|
||||
CommonResult<DataSourceConfigRespDTO> getDataSourceConfig(@RequestParam("id")Long id);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,35 @@
|
|||
package cn.iocoder.yudao.module.infra.api.db;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.db.dto.DataSourceConfigRespDTO;
|
||||
import cn.iocoder.yudao.module.infra.convert.db.DataSourceConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.module.system.enums.ApiConstants.VERSION;
|
||||
|
||||
/**
|
||||
* 数据源配置 API 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@DubboService(version = VERSION) // 提供 Dubbo RPC 接口,给 Dubbo Consumer 调用
|
||||
@Validated
|
||||
public class DataSourceConfigServiceApiImpl implements DataSourceConfigServiceApi {
|
||||
|
||||
@Resource
|
||||
private DataSourceConfigService dataSourceConfigService;
|
||||
|
||||
@Override
|
||||
public DataSourceConfigRespDTO getDataSourceConfig(Long id) {
|
||||
return DataSourceConfigConvert.INSTANCE.convert02(dataSourceConfigService.getDataSourceConfig(id));
|
||||
public CommonResult<DataSourceConfigRespDTO> getDataSourceConfig(Long id) {
|
||||
return success(DataSourceConfigConvert.INSTANCE.convert02(dataSourceConfigService.getDataSourceConfig(id)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,5 +31,8 @@ public interface TenantApi {
|
|||
* @param tenantId 租户编号
|
||||
* @return 数据源配置
|
||||
*/
|
||||
CommonResult<TenantDataSourceConfigRespDTO> getTenantDataSourceConfig(Long tenantId);
|
||||
@GetMapping(PREFIX + "/tenant-datasource-config")
|
||||
@Operation(summary = "获得租户数据源信息")
|
||||
@Parameter(name = "tenantId", description = "租户编号", required = true, example = "1024")
|
||||
CommonResult<TenantDataSourceConfigRespDTO> getTenantDataSourceConfig(@RequestParam("tenantId")Long tenantId);
|
||||
}
|
||||
|
|
@ -46,6 +46,6 @@ public class TenantApiImpl implements TenantApi {
|
|||
}
|
||||
// 获得租户的数据源配置
|
||||
return success(TenantConvert.INSTANCE.convert(
|
||||
dataSourceConfigServiceApi.getDataSourceConfig(tenant.getDataSourceConfigId())));
|
||||
dataSourceConfigServiceApi.getDataSourceConfig(tenant.getDataSourceConfigId()).getData()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package cn.iocoder.yudao.module.system.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.api.db.DataSourceConfigServiceApi;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = FileApi.class)
|
||||
@EnableFeignClients(clients = {FileApi.class, DataSourceConfigServiceApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,12 +154,16 @@ yudao:
|
|||
enable: true
|
||||
ignore-urls:
|
||||
- /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
|
||||
- /admin-api/system/captcha/get-image # 获取图片验证码,和租户无关
|
||||
- /admin-api/system/captcha/get # 获取图片验证码,和租户无关
|
||||
- /admin-api/system/captcha/check # 校验图片验证码,和租户无关
|
||||
- /admin-api/infra/file/*/get/** # 获取图片,和租户无关
|
||||
- /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
|
||||
- /admin-api/pay/notify/callback/* # 支付回调通知,不携带租户编号
|
||||
- /jmreport/* # 积木报表,无法携带租户编号
|
||||
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
|
||||
- /rpc-api/system/tenant/valid # 防止递归。避免调用 /rpc-api/system/tenant/valid 接口时,又去触发 /rpc-api/system/tenant/valid 去校验
|
||||
- /rpc-api/system/tenant/id-list # 获得租户列表的时候,无需传递租户编号
|
||||
- /rpc-api/system/tenant/tenant-datasource-config # 获得获得租户数据源信息,无需传递租户编号
|
||||
- /rpc-api/system/error-code/* # 错误码的自动创建与下载的接口,无法带上租户编号
|
||||
- /rpc-api/system/oauth2/token/check # 访问令牌校验时,无需传递租户编号;主要解决上传文件的场景,前端不会传递 tenant-id!
|
||||
ignore-tables:
|
||||
|
|
@ -178,6 +182,40 @@ yudao:
|
|||
- system_mail_template
|
||||
- system_mail_log
|
||||
- system_notify_template
|
||||
- infra_codegen_column
|
||||
- infra_codegen_table
|
||||
- infra_test_demo
|
||||
- infra_config
|
||||
- infra_file_config
|
||||
- infra_file
|
||||
- infra_file_content
|
||||
- infra_job
|
||||
- infra_job_log
|
||||
- infra_job_log
|
||||
- infra_data_source_config
|
||||
- jimu_dict
|
||||
- jimu_dict_item
|
||||
- jimu_report
|
||||
- jimu_report_data_source
|
||||
- jimu_report_db
|
||||
- jimu_report_db_field
|
||||
- jimu_report_db_param
|
||||
- jimu_report_link
|
||||
- jimu_report_map
|
||||
- jimu_report_share
|
||||
- rep_demo_dxtj
|
||||
- rep_demo_employee
|
||||
- rep_demo_gongsi
|
||||
- rep_demo_jianpiao
|
||||
- tmp_report_data_1
|
||||
- tmp_report_data_income
|
||||
ignore-caches:
|
||||
- permission_menu_ids
|
||||
- oauth_client
|
||||
- notify_template
|
||||
- mail_account
|
||||
- mail_template
|
||||
- sms_template
|
||||
sms-code: # 短信验证码相关的配置项
|
||||
expire-times: 10m
|
||||
send-frequency: 1m
|
||||
|
|
|
|||
Loading…
Reference in New Issue