新增系统配置api接口

This commit is contained in:
none
2023-03-09 16:34:32 +08:00
parent c85467f62f
commit aabd41ce01
6 changed files with 37 additions and 10 deletions

View File

@@ -4,13 +4,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.playedu.api.config.MinioConfig;
import xyz.playedu.api.PlayEduBackendThreadLocal;
import xyz.playedu.api.service.ImageCaptchaService;
import xyz.playedu.api.types.ImageCaptchaResult;
import xyz.playedu.api.types.JsonResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/backend/v1/system")
@@ -19,9 +20,6 @@ public class SystemController {
@Autowired
private ImageCaptchaService imageCaptchaService;
@Autowired
private MinioConfig minioConfig;
@GetMapping("/image-captcha")
public JsonResponse imageCaptcha() throws IOException {
ImageCaptchaResult imageCaptchaResult = imageCaptchaService.generate();
@@ -35,8 +33,7 @@ public class SystemController {
@GetMapping("/config")
public JsonResponse config() {
HashMap<String, Object> data = new HashMap<>();
data.put("minio_endpoint", minioConfig.getEndPoint());
Map<String, String> data = PlayEduBackendThreadLocal.getConfig();
return JsonResponse.data(data);
}