[manager] 监控参数接口修改,jar启动修复

This commit is contained in:
tomsun28
2021-11-30 22:18:03 +08:00
parent 090e6e8c16
commit fad9367f81
5 changed files with 23 additions and 7 deletions

View File

@@ -8,8 +8,8 @@
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manager</artifactId>
<packaging>jar</packaging>
<properties>
<mysql.version>8.0.16</mysql.version>
@@ -94,4 +94,21 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.13</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -34,7 +34,7 @@ public class AppController {
@ApiOperation(value = "查询监控类型的参数结构", notes = "根据app查询指定监控类型的需要输入参数的结构")
public ResponseEntity<Message<List<ParamDefine>>> queryAppParamDefines(
@ApiParam(value = "监控类型名称", example = "api") @PathVariable("app") String app) {
List<ParamDefine> paramDefines = appService.getAppParamDefines(app);
List<ParamDefine> paramDefines = appService.getAppParamDefines(app.toLowerCase());
return ResponseEntity.ok(new Message<>(paramDefines));
}

View File

@@ -72,7 +72,7 @@ public class AppServiceImpl implements AppService, CommandLineRunner {
if (appFile.exists()) {
try (FileInputStream fileInputStream = new FileInputStream(appFile)) {
Job app = yaml.loadAs(fileInputStream, Job.class);
appDefines.put(app.getApp(), app);
appDefines.put(app.getApp().toLowerCase(), app);
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new IOException(e);
@@ -91,7 +91,7 @@ public class AppServiceImpl implements AppService, CommandLineRunner {
if (appFile.exists()) {
try (FileInputStream fileInputStream = new FileInputStream(appFile)) {
ParamDefineDto paramDefine = yaml.loadAs(fileInputStream, ParamDefineDto.class);
paramDefines.put(paramDefine.getApp(), paramDefine.getParam());
paramDefines.put(paramDefine.getApp().toLowerCase(), paramDefine.getParam());
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new IOException(e);

View File

@@ -18,8 +18,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.validation.ConstraintViolationException;
import javax.validation.ValidationException;
import java.lang.reflect.Field;
import static com.usthe.common.util.CommonConstants.DETECT_FAILED;

View File

@@ -28,7 +28,8 @@ param:
required: false
- field: ssl
name: 启动SSL
type: radio
type: boolean
required: false
# 当type为boolean时,前端用switch展示开关
# 当type为radio单选框,checkbox复选框时,option表示可选项值列表
option: Yes,No