parent
198eab375e
commit
466798d1aa
@ -0,0 +1,30 @@ |
|||||||
|
package com.ruoyi.web.controller.platform.config; |
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult; |
||||||
|
import com.ruoyi.common.enums.PlatformConfig; |
||||||
|
import com.ruoyi.common.utils.StringUtils; |
||||||
|
import com.ruoyi.system.domain.SysConfig; |
||||||
|
import com.ruoyi.system.service.ISysConfigService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import static com.ruoyi.common.core.domain.AjaxResult.success; |
||||||
|
|
||||||
|
/** |
||||||
|
* 平台设置 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/platform/config") |
||||||
|
public class PlatformConfigController { |
||||||
|
@Autowired |
||||||
|
private ISysConfigService configService; |
||||||
|
|
||||||
|
@GetMapping("{config}") |
||||||
|
public AjaxResult config(@PathVariable PlatformConfig config) { |
||||||
|
SysConfig _config = configService.selectConfigById(config.getConfigId()); |
||||||
|
return success(StringUtils.format("{}获取成功", _config.getConfigName()), _config.getConfigValue()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.ruoyi.common.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* 平台设置 |
||||||
|
*/ |
||||||
|
public enum PlatformConfig { |
||||||
|
//用户协议
|
||||||
|
userAgreement(100L), |
||||||
|
//隐私政策
|
||||||
|
privacyPolicy(101L), |
||||||
|
//短信验证码配置
|
||||||
|
smsTime(102L); |
||||||
|
|
||||||
|
private final Long configId; |
||||||
|
|
||||||
|
PlatformConfig(Long configId) { |
||||||
|
this.configId = configId; |
||||||
|
} |
||||||
|
|
||||||
|
public Long getConfigId() { |
||||||
|
return configId; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue