parent
7fbb96b0f0
commit
b728e66282
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.infra.api.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.service.config.ConfigService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class ConfigApiImpl implements ConfigApi {
|
||||
|
||||
@Resource
|
||||
private ConfigService configService;
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getConfigValueByKey(String key) {
|
||||
ConfigDO config = configService.getConfigByKey(key);
|
||||
return success(config != null ? config.getValue() : null);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +1,12 @@
|
||||
package cn.iocoder.yudao.module.system.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class})
|
||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue