[monitor] 监控增删改查接口定义

This commit is contained in:
tomsun28
2021-11-14 14:02:00 +08:00
parent 0c568d25bc
commit ed523344e4
15 changed files with 468 additions and 6 deletions

View File

@@ -19,6 +19,12 @@
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<scope>provided</scope>
</dependency>
<!-- etcd -->
<dependency>
<groupId>io.etcd</groupId>

View File

@@ -1,10 +1,14 @@
package com.usthe.common.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import static com.usthe.common.util.CommonConstants.SUCCESS;
/**
* Unified message structure definition for front and back ends
*
@@ -20,21 +24,28 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "公共消息包装")
public class Message<T> {
/**
* message body data
*/
@ApiModelProperty(value = "响应数据", position = 0)
private T data;
/**
* exception message when error happen or success message
*/
@ApiModelProperty(value = "携带消息", position = 1)
private String msg;
/**
* response code, not http code
*/
private Integer code;
@ApiModelProperty(value = "携带编码", position = 2)
private byte code = SUCCESS;
public Message(String msg) {
this.msg = msg;
}
}

View File

@@ -0,0 +1,30 @@
package com.usthe.common.util;
/**
* 公共常量
* @author tomsun28
* @date 2021/11/14 12:06
*/
public interface CommonConstants {
/**
* 成功
*/
byte SUCCESS = 0x00;
/**
* 参数校验失败
*/
byte PARAM_INVALID = 0x01;
/**
* 探测失败
*/
byte DETECT_FAILED = 0x02;
/**
* 监控不存在
*/
byte MONITOR_NOT_EXIST = 0x03;
}