init web
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.sunyard.chsm.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/16
|
||||
*/
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public class PageQuery {
|
||||
|
||||
public static final int MAX_PAGE_SIZE = 200;
|
||||
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
private int pageNumber = 1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private int pageSize = 10;
|
||||
|
||||
|
||||
public PageQuery(int pageNum, int pageSize) {
|
||||
this.pageNumber = pageNum;
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public void setPageNumber(int pageNum) {
|
||||
this.pageNumber = Math.max(1, pageNum);
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = Math.min(MAX_PAGE_SIZE, Math.max(1, pageSize));
|
||||
}
|
||||
|
||||
public int getOffset() {
|
||||
return pageSize * (pageNumber - 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.sunyard.chsm.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/17
|
||||
*/
|
||||
@Data
|
||||
public class R<T> {
|
||||
|
||||
/**
|
||||
* 成功标志
|
||||
*/
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 失败消息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 返回代码 200-代表成功,
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
private long timestamp = System.currentTimeMillis();
|
||||
|
||||
/**
|
||||
* 结果对象
|
||||
*/
|
||||
private T result;
|
||||
|
||||
|
||||
public static <T> R<T> ok() {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(true);
|
||||
r.setMessage("success");
|
||||
r.setCode(200);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(String msg) {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(true);
|
||||
r.setMessage(msg);
|
||||
r.setCode(200);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static <T> R<T> data(T value) {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(true);
|
||||
r.setResult(value);
|
||||
r.setCode(200);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static <T> R<T> data(T value, String msg) {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(true);
|
||||
r.setResult(value);
|
||||
r.setMessage(msg);
|
||||
r.setCode(200);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static <T> R<T> error(String msg) {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(false);
|
||||
r.setMessage(msg);
|
||||
r.setCode(500);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static <T> R<T> error(int code, String msg) {
|
||||
R<T> r = new R<>();
|
||||
r.setSuccess(false);
|
||||
r.setMessage(msg);
|
||||
r.setCode(code);
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/15
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_crypto_service")
|
||||
public class CryptoService {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long deviceGroupId;
|
||||
private String deviceGroupName;
|
||||
private String status;
|
||||
private Long creatorId;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/15
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_crypto_service_api")
|
||||
public class CryptoServiceApi {
|
||||
|
||||
private Long id;
|
||||
private Long cryptoServiceId;
|
||||
private String apiGroup;
|
||||
private String apiCode;
|
||||
private String apiName;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/17
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_device")
|
||||
public class Device {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String serviceIp;
|
||||
private Integer servicePort;
|
||||
private String manageIp;
|
||||
private Integer managePort;
|
||||
private String manufacturer;
|
||||
private String manufacturerModel;
|
||||
private String accessCredentials;
|
||||
|
||||
private Long groupId;
|
||||
private String groupName;
|
||||
private Integer weight;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/17
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_device_group")
|
||||
public class DeviceGroup {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_key_info")
|
||||
public class KeyInfo {
|
||||
|
||||
private Long id;
|
||||
private Long applicationId;
|
||||
private Long keyTemplateId;
|
||||
private String code;
|
||||
private String keyType;
|
||||
private String keyAlg;
|
||||
private Integer keyLength;
|
||||
private Integer keyUsage;
|
||||
private String checkAlg;
|
||||
private String checkValue;
|
||||
private String status;
|
||||
private LocalDateTime effectiveTime;
|
||||
private LocalDateTime expiredTime;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_key_record")
|
||||
public class KeyRecord {
|
||||
|
||||
private Long id;
|
||||
private Long keyId;
|
||||
|
||||
private String keyIndex;
|
||||
private String keyData;
|
||||
private String pubKey;
|
||||
private String checkAlg;
|
||||
private String checkValue;
|
||||
private LocalDateTime effectiveTime;
|
||||
private LocalDateTime expiredTime;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_key_template")
|
||||
public class KeyTemplate {
|
||||
|
||||
private Long id;
|
||||
private String code;
|
||||
private String name;
|
||||
private String keyType;
|
||||
private String keyAlg;
|
||||
private Integer keyLength;
|
||||
private Integer keyUsage;
|
||||
private String checkAlg;
|
||||
private Integer validTime;
|
||||
private String validUnit;
|
||||
private Integer startAfterCreateTime;
|
||||
private String startAfterCreateUnit;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user