package com.iailab.module.infra.api.config; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.module.infra.dal.dataobject.config.ConfigDO; import com.iailab.module.infra.service.config.ConfigService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import static com.iailab.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated public class ConfigApiImpl implements ConfigApi { @Resource private ConfigService configService; @Override public CommonResult getConfigValueByKey(String key) { ConfigDO config = configService.getConfigByKey(key); return success(config != null ? config.getValue() : null); } }