From 41d79ff81e16c3c02e2b82e2986d8bfda0479161 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 12 Feb 2022 17:07:48 +0800 Subject: [PATCH] =?UTF-8?q?[manager]=E8=B0=83=E6=95=B4API=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E7=B1=BB=E5=9E=8B=E5=8F=82=E6=95=B0=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collect/http/HttpCollectImpl.java | 2 -- .../java/com/usthe/common/entity/job/Job.java | 9 ++++---- .../src/main/resources/define/param/api.yml | 21 +++++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/collector/src/main/java/com/usthe/collector/collect/http/HttpCollectImpl.java b/collector/src/main/java/com/usthe/collector/collect/http/HttpCollectImpl.java index 3f53196..769a31f 100644 --- a/collector/src/main/java/com/usthe/collector/collect/http/HttpCollectImpl.java +++ b/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 params = httpProtocol.getParams(); if (params != null && !params.isEmpty()) { diff --git a/common/src/main/java/com/usthe/common/entity/job/Job.java b/common/src/main/java/com/usthe/common/entity/job/Job.java index fd15b2e..2c79f85 100644 --- a/common/src/main/java/com/usthe/common/entity/job/Job.java +++ b/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); } } diff --git a/manager/src/main/resources/define/param/api.yml b/manager/src/main/resources/define/param/api.yml index 0ffc494..77a008e 100644 --- a/manager/src/main/resources/define/param/api.yml +++ b/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