14 changed files with 553 additions and 24 deletions
@ -0,0 +1,9 @@
|
||||
name = hy-iot-paas |
||||
version = 1.0.0 |
||||
|
||||
title = HY-IOT-PAAS |
||||
description = Hypaas IOT Platform |
||||
|
||||
application = true |
||||
|
||||
depends = hypaas-core, hypaas-web, test |
@ -0,0 +1,372 @@
|
||||
package Log; |
||||
|
||||
import com.google.common.base.MoreObjects; |
||||
import com.hypaas.auth.db.AuditableModel; |
||||
import com.hypaas.db.annotations.ActField; |
||||
import com.hypaas.db.annotations.Widget; |
||||
import java.time.LocalDateTime; |
||||
import java.util.Objects; |
||||
import javax.persistence.Basic; |
||||
import javax.persistence.Cacheable; |
||||
import javax.persistence.Column; |
||||
import javax.persistence.Entity; |
||||
import javax.persistence.FetchType; |
||||
import javax.persistence.GeneratedValue; |
||||
import javax.persistence.GenerationType; |
||||
import javax.persistence.Id; |
||||
import javax.persistence.Inheritance; |
||||
import javax.persistence.InheritanceType; |
||||
import javax.persistence.SequenceGenerator; |
||||
import javax.persistence.Table; |
||||
import module.AlarmLevel; |
||||
import module.OperateType; |
||||
import module.UserAuth; |
||||
import org.hibernate.annotations.Type; |
||||
|
||||
@Entity |
||||
@Cacheable(false) |
||||
@Table(name = "sys_log") |
||||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE) |
||||
public class LogEntity extends AuditableModel { |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_log_SEQ") |
||||
@SequenceGenerator(name = "sys_log_SEQ", sequenceName = "sys_log_SEQ", allocationSize = 1) |
||||
private Long id; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "CONTENT") |
||||
@ActField(isJudg = false) |
||||
private String content; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "DEPT", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String dept; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "EXMSG", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String exceptionMessage; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "EXSTACK", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String exceptionStackTrace; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "EXTYPE", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String exceptionType; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "HASHVALUE", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private Long hashValue; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "LEVELDESC", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String levelDesc; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Basic |
||||
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType") |
||||
@Column(name = "LEVELNUM") |
||||
private AlarmLevel levelNum; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "MODULE") |
||||
@ActField(isJudg = false) |
||||
private String module; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "OBJECTNAME") |
||||
@ActField(isJudg = false) |
||||
private String objectName; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Basic |
||||
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType") |
||||
@Column(name = "OPTYPE") |
||||
private OperateType opType; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "PROGRAM", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String program; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "RESULT", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private Integer result; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "RESULTDESC", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String resultDesc; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "STATUS", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private Integer status; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "TIME", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private LocalDateTime time; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Basic |
||||
@Type(type = "com.hypaas.db.hibernate.type.ValueEnumType") |
||||
@Column(name = "USERAUTH") |
||||
private UserAuth userAuth; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "USERAUTHDESC", nullable = true) |
||||
@ActField(isJudg = false) |
||||
private String userAuthDesc; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@Column(name = "USERID") |
||||
@ActField(isJudg = false) |
||||
private String userId; |
||||
|
||||
@Widget(massUpdate = false, copyable = true) |
||||
@ActField(isJudg = false) |
||||
private String address; |
||||
|
||||
@Widget(selection = "secret.level.things") |
||||
private String secretLevel; |
||||
|
||||
@Widget(title = "Attributes") |
||||
@Basic(fetch = FetchType.LAZY) |
||||
@Type(type = "json") |
||||
private String attrs; |
||||
|
||||
public LogEntity() {} |
||||
|
||||
@Override |
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
@Override |
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getContent() { |
||||
return content; |
||||
} |
||||
|
||||
public void setContent(String content) { |
||||
this.content = content; |
||||
} |
||||
|
||||
public String getDept() { |
||||
return dept; |
||||
} |
||||
|
||||
public void setDept(String dept) { |
||||
this.dept = dept; |
||||
} |
||||
|
||||
public String getExceptionMessage() { |
||||
return exceptionMessage; |
||||
} |
||||
|
||||
public void setExceptionMessage(String exceptionMessage) { |
||||
this.exceptionMessage = exceptionMessage; |
||||
} |
||||
|
||||
public String getExceptionStackTrace() { |
||||
return exceptionStackTrace; |
||||
} |
||||
|
||||
public void setExceptionStackTrace(String exceptionStackTrace) { |
||||
this.exceptionStackTrace = exceptionStackTrace; |
||||
} |
||||
|
||||
public String getExceptionType() { |
||||
return exceptionType; |
||||
} |
||||
|
||||
public void setExceptionType(String exceptionType) { |
||||
this.exceptionType = exceptionType; |
||||
} |
||||
|
||||
public Long getHashValue() { |
||||
return hashValue; |
||||
} |
||||
|
||||
public void setHashValue(Long hashValue) { |
||||
this.hashValue = hashValue; |
||||
} |
||||
|
||||
public String getLevelDesc() { |
||||
return levelDesc; |
||||
} |
||||
|
||||
public void setLevelDesc(String levelDesc) { |
||||
this.levelDesc = levelDesc; |
||||
} |
||||
|
||||
public AlarmLevel getLevelNum() { |
||||
return levelNum; |
||||
} |
||||
|
||||
public void setLevelNum(AlarmLevel levelNum) { |
||||
this.levelNum = levelNum; |
||||
} |
||||
|
||||
public String getModule() { |
||||
return module; |
||||
} |
||||
|
||||
public void setModule(String module) { |
||||
this.module = module; |
||||
} |
||||
|
||||
public String getObjectName() { |
||||
return objectName; |
||||
} |
||||
|
||||
public void setObjectName(String objectName) { |
||||
this.objectName = objectName; |
||||
} |
||||
|
||||
public OperateType getOpType() { |
||||
return opType; |
||||
} |
||||
|
||||
public void setOpType(OperateType opType) { |
||||
this.opType = opType; |
||||
} |
||||
|
||||
public String getProgram() { |
||||
return program; |
||||
} |
||||
|
||||
public void setProgram(String program) { |
||||
this.program = program; |
||||
} |
||||
|
||||
public Integer getResult() { |
||||
return result; |
||||
} |
||||
|
||||
public void setResult(Integer result) { |
||||
this.result = result; |
||||
} |
||||
|
||||
public String getResultDesc() { |
||||
return resultDesc; |
||||
} |
||||
|
||||
public void setResultDesc(String resultDesc) { |
||||
this.resultDesc = resultDesc; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public LocalDateTime getTime() { |
||||
return time; |
||||
} |
||||
|
||||
public void setTime(LocalDateTime time) { |
||||
this.time = time; |
||||
} |
||||
|
||||
public UserAuth getUserAuth() { |
||||
return userAuth; |
||||
} |
||||
|
||||
public void setUserAuth(UserAuth userAuth) { |
||||
this.userAuth = userAuth; |
||||
} |
||||
|
||||
public String getUserAuthDesc() { |
||||
return userAuthDesc; |
||||
} |
||||
|
||||
public void setUserAuthDesc(String userAuthDesc) { |
||||
this.userAuthDesc = userAuthDesc; |
||||
} |
||||
|
||||
public String getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(String userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getAddress() { |
||||
return address; |
||||
} |
||||
|
||||
public void setAddress(String address) { |
||||
this.address = address; |
||||
} |
||||
|
||||
public String getSecretLevel() { |
||||
return secretLevel; |
||||
} |
||||
|
||||
public void setSecretLevel(String secretLevel) { |
||||
this.secretLevel = secretLevel; |
||||
} |
||||
|
||||
public String getAttrs() { |
||||
return attrs; |
||||
} |
||||
|
||||
public void setAttrs(String attrs) { |
||||
this.attrs = attrs; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object obj) { |
||||
if (obj == null) return false; |
||||
if (this == obj) return true; |
||||
if (!(obj instanceof LogEntity)) return false; |
||||
|
||||
final LogEntity other = (LogEntity) obj; |
||||
if (this.getId() != null || other.getId() != null) { |
||||
return Objects.equals(this.getId(), other.getId()); |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
return 31; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return MoreObjects.toStringHelper(this) |
||||
.add("id", getId()) |
||||
.add("content", getContent()) |
||||
.add("dept", getDept()) |
||||
.add("exceptionMessage", getExceptionMessage()) |
||||
.add("exceptionStackTrace", getExceptionStackTrace()) |
||||
.add("exceptionType", getExceptionType()) |
||||
.add("hashValue", getHashValue()) |
||||
.add("levelDesc", getLevelDesc()) |
||||
.add("levelNum", getLevelNum()) |
||||
.add("module", getModule()) |
||||
.add("objectName", getObjectName()) |
||||
.add("opType", getOpType()) |
||||
.omitNullValues() |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package Log.repo; |
||||
|
||||
import Log.LogEntity; |
||||
import com.hypaas.db.JpaRepository; |
||||
|
||||
public class LogEntityRepository extends JpaRepository<LogEntity> { |
||||
|
||||
public LogEntityRepository() { |
||||
super(LogEntity.class); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package module; |
||||
|
||||
import com.hypaas.db.ValueEnum; |
||||
import java.util.Objects; |
||||
|
||||
public enum AlarmLevel implements ValueEnum<Integer> { |
||||
P0(1), |
||||
|
||||
P1(2), |
||||
|
||||
P2(4), |
||||
|
||||
P3(8), |
||||
|
||||
P4(16), |
||||
|
||||
P5(32); |
||||
|
||||
private final Integer value; |
||||
|
||||
private AlarmLevel(Integer value) { |
||||
this.value = Objects.requireNonNull(value); |
||||
} |
||||
|
||||
@Override |
||||
public Integer getValue() { |
||||
return value; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
package module; |
||||
|
||||
import com.hypaas.db.ValueEnum; |
||||
import java.util.Objects; |
||||
|
||||
public enum Module implements ValueEnum<String> { |
||||
WMM("处理器管理模块"), |
||||
|
||||
SMM("存储器管理模块"), |
||||
|
||||
DEMM("设备管理模块"), |
||||
|
||||
DMM("文件管理模块"); |
||||
|
||||
private final String value; |
||||
|
||||
private Module(String value) { |
||||
this.value = Objects.requireNonNull(value); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package module; |
||||
|
||||
import com.hypaas.db.ValueEnum; |
||||
import com.hypaas.db.annotations.Widget; |
||||
import java.util.Objects; |
||||
|
||||
public enum OperateType implements ValueEnum<String> { |
||||
@Widget(title = "登录") |
||||
Login("Login"), |
||||
|
||||
@Widget(title = "退出") |
||||
Exit("Exit"), |
||||
|
||||
@Widget(title = "新建") |
||||
New("New"), |
||||
|
||||
@Widget(title = "修改") |
||||
Update("Update"), |
||||
|
||||
@Widget(title = "删除") |
||||
Delete("Delete"), |
||||
|
||||
@Widget(title = "查询") |
||||
Select("Select"), |
||||
|
||||
@Widget(title = "批量导入") |
||||
BatchImport("BatchImport"), |
||||
|
||||
@Widget(title = "批量导出") |
||||
BatchExport("BatchExport"); |
||||
|
||||
private final String value; |
||||
|
||||
private OperateType(String value) { |
||||
this.value = Objects.requireNonNull(value); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
package module; |
||||
|
||||
import com.hypaas.db.ValueEnum; |
||||
import com.hypaas.db.annotations.Widget; |
||||
import java.util.Objects; |
||||
|
||||
public enum UserAuth implements ValueEnum<String> { |
||||
@Widget(title = "系统管理员") |
||||
SystemManageUser("0"), |
||||
|
||||
@Widget(title = "安全保密员") |
||||
SecurityUser("1"), |
||||
|
||||
@Widget(title = "安全审计员") |
||||
SecurityAuditUser("2"), |
||||
|
||||
@Widget(title = "业务用户") |
||||
ServiceUser("3"); |
||||
|
||||
private final String value; |
||||
|
||||
private UserAuth(String value) { |
||||
this.value = Objects.requireNonNull(value); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
} |
@ -0,0 +1,7 @@
|
||||
name = test |
||||
version = 1.0.0 |
||||
|
||||
title = test |
||||
description = |
||||
|
||||
depends = hypaas-core |
@ -1,3 +1,5 @@
|
||||
interfaceList: |
||||
- "/ws/register/register/face" |
||||
- "/ws/register/login/face" |
||||
- "/ws/register/login/face" |
||||
- "/ws/eventCenter/user/saveUser" |
||||
- "/ws/eventCenter/user/deleteUser" |
Loading…
Reference in new issue