|
|
@@ -0,0 +1,29 @@
|
|
|
+package com.etotem.cfc.controller.config;
|
|
|
+
|
|
|
+import com.etotem.cfc.common.Result;
|
|
|
+import com.etotem.cfc.service.SysConfigService;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/config/public")
|
|
|
+public class PublicConfigController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SysConfigService configService;
|
|
|
+
|
|
|
+ @PostMapping("/value")
|
|
|
+ public Result<String> getValue(@RequestBody Map<String, String> params) {
|
|
|
+ String key = params.get("key");
|
|
|
+ if (key == null || key.isEmpty()) {
|
|
|
+ return Result.error("key is required");
|
|
|
+ }
|
|
|
+ String value = configService.getValue(key);
|
|
|
+ return Result.success(value);
|
|
|
+ }
|
|
|
+}
|