Browse Source

[manager]调整API监控类型参数位置

tomsun28 4 years ago
parent
commit
41d79ff81e

+ 0 - 2
collector/src/main/java/com/usthe/collector/collect/http/HttpCollectImpl.java

@@ -299,8 +299,6 @@ public class HttpCollectImpl extends AbstractCollect {
             return null;
         }
 
-        String contentType = null;
-
         // params
         Map<String, String> params = httpProtocol.getParams();
         if (params != null && !params.isEmpty()) {

+ 4 - 5
common/src/main/java/com/usthe/common/entity/job/Job.java

@@ -2,8 +2,8 @@ package com.usthe.common.entity.job;
 
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.google.gson.Gson;
 import com.usthe.common.entity.message.CollectRep;
+import com.usthe.common.util.GsonUtil;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -182,10 +182,9 @@ public class Job {
         responseDataTemp.add(metricsData);
     }
 
-    private static final Gson GSON = new Gson();
-
-    public Job clone(){
+    @Override
+    public Job clone() {
         // 深度克隆
-        return GSON.fromJson(GSON.toJsonTree(this), Job.class);
+        return GsonUtil.fromJson(GsonUtil.toJson(this), Job.class);
     }
 }

+ 12 - 9
manager/src/main/resources/define/param/api.yml

@@ -16,6 +16,7 @@ param:
     # 当type为number时,用range表示范围
     range: '[0,65535]'
     required: true
+    defaultValue: 80
   - field: uri
     name: 相对路径
     type: text
@@ -37,10 +38,11 @@ param:
         value: PUT
       - label: DELETE请求
         value: DELETE
-  - field: contentType
-    name: Content-Type
-    type: text
-    required: false
+  - field: ssl
+    name: 启用HTTPS
+    # 当type为boolean时,前端用switch展示开关
+    type: boolean
+    required: true
   - field: username
     name: 用户名
     type: text
@@ -51,12 +53,13 @@ param:
     name: 密码
     type: password
     required: false
-  - field: ssl
-    name: 启用HTTPS
-    # 当type为boolean时,前端用switch展示开关
-    type: boolean
-    required: true
+  - field: contentType
+    name: Content-Type
+    type: text
+    placeholder: '请求BODY资源类型'
+    required: false
   - field: payload
     name: 请求BODY
     type: textarea
+    placeholder: 'POST PUT请求时有效'
     required: false