Fix some team project bugs

This commit is contained in:
JiaJu Zhuang
2023-09-09 14:35:45 +08:00
parent 53e25c863b
commit 40a079bd93
7 changed files with 75 additions and 6 deletions

View File

@ -2,18 +2,19 @@
* Alipay.com Inc.
* Copyright (c) 2004-2022 All Rights Reserved.
*/
package ai.chat2db.server.web.api.controller;
package ai.chat2db.server.web.api.controller.system;
import ai.chat2db.server.domain.core.cache.CacheManage;
import ai.chat2db.server.tools.base.wrapper.result.DataResult;
import ai.chat2db.server.tools.common.config.Chat2dbProperties;
import ai.chat2db.server.tools.common.util.I18nUtils;
import ai.chat2db.server.tools.common.model.ConfigJson;
import ai.chat2db.server.tools.common.util.ConfigUtils;
import ai.chat2db.server.web.api.controller.system.vo.SystemVO;
import ai.chat2db.spi.ssh.SSHManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -39,8 +40,11 @@ public class SystemController {
* @return
*/
@GetMapping
public DataResult<String> get() {
return DataResult.of("success");
public DataResult<SystemVO> get() {
ConfigJson configJson = ConfigUtils.getConfig();
return DataResult.of(SystemVO.builder()
.systemUuid(configJson.getSystemUuid())
.build());
}
/**

View File

@ -0,0 +1,22 @@
package ai.chat2db.server.web.api.controller.system.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* system
*
* @author Jiaju Zhuang
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SystemVO {
/**
* The unique ID of the system
*/
private String systemUuid;
}