| @@ -0,0 +1,41 @@ | |||||
| package com.iformall.controller; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.common.SysConfigConstant; | |||||
| import com.iformall.domain.po.SysConfig; | |||||
| import com.iformall.service.SysConfigService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("api/sysConfig") | |||||
| public class SysConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private SysConfigService sysConfigService; | |||||
| @ApiOperation("详情接口") | |||||
| @GetMapping("getByKey") | |||||
| @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true)}) | |||||
| public ResultData detail(String key) { | |||||
| SysConfig sysConfig = sysConfigService.getByKey(key, getTenantInfo()); | |||||
| if (null == sysConfig || StringUtils.isBlank(sysConfig.getConfigItemValue())) { | |||||
| return new ResultData(""); | |||||
| } | |||||
| return new ResultData(sysConfig.getConfigItemValue()); | |||||
| } | |||||
| } | |||||