Browse Source

提交对象管理

master
VIVIMAN 3 years ago
parent
commit
d2cb3e086a
  1. 33
      src/main/java/com/insigma/entry/Cp.java
  2. 41
      src/main/java/com/insigma/entry/Db.java
  3. 16
      src/main/java/com/insigma/entry/IndexObj.java
  4. 37
      src/main/java/com/insigma/entry/Mw.java
  5. 23
      src/main/java/com/insigma/service/Computer.java
  6. 43
      src/main/java/com/insigma/service/Database.java
  7. 32
      src/main/java/com/insigma/service/Middleware.java
  8. 0
      src/main/java/com/insigma/service/impl/.keepgit
  9. 32
      src/main/java/com/insigma/service/impl/CuWindows.java

33
src/main/java/com/insigma/entry/Cp.java

@ -0,0 +1,33 @@
package com.insigma.entry;
import lombok.AllArgsConstructor;
/**
* (Cp 枚举) 计算机 枚举
*
* @author zhangxianwei
* @since 21:32 2022/4/17
*/
@AllArgsConstructor
public enum Cp {
/**
* PC计算机
*/
WINDOWS("windows", "PC计算机"),
/**
* 国产PC
*/
LINUX("linux", "国产PC");
private final String name;
private final String info;
public String getName() {
return name;
}
public String getInfo() {
return info;
}
}

41
src/main/java/com/insigma/entry/Db.java

@ -0,0 +1,41 @@
package com.insigma.entry;
import lombok.AllArgsConstructor;
/**
* (Db 枚举) 数据库 枚举
*
* @author zhangxianwei
* @since 21:35 2022/4/17
*/
@AllArgsConstructor
public enum Db {
/**
* mysql数据库
*/
MYSQL("mysql", "MySQL数据库"),
/**
* Dm数据库
*/
DM("dm", "Dm数据库"),
/**
* KingBase数据库
*/
KingBase("kingbase", "KingBase数据库"),
/**
* Oracle数据库
*/
ORACLE("oracle", "Oracle数据库");
private final String name;
private final String info;
public String getName() {
return name;
}
public String getInfo() {
return info;
}
}

16
src/main/java/com/insigma/entry/IndexObj.java

@ -0,0 +1,16 @@
package com.insigma.entry;
import lombok.Data;
/**
* (IndexObj )
*
* @author zhangxianwei
* @since 21:29 2022/4/17
*/
@Data
public class IndexObj {
private String tab;
private String idx;
}

37
src/main/java/com/insigma/entry/Mw.java

@ -0,0 +1,37 @@
package com.insigma.entry;
import lombok.AllArgsConstructor;
/**
* (Mw 枚举) 中间件 枚举
*
* @author zhangxianwei
* @since 21:38 2022/4/17
*/
@AllArgsConstructor
public enum Mw {
/**
* tomcat中间件
*/
TOMCAT("tomcat", "Tomcat中间件"),
/**
* TongWeb中间件
*/
TONGWEB("tongweb", "TongWeb中间件"),
/**
* Apusic中间件
*/
APUSIC("apusic", "Apusic中间件");
private final String name;
private final String info;
public String getName() {
return name;
}
public String getInfo() {
return info;
}
}

23
src/main/java/com/insigma/service/Computer.java

@ -0,0 +1,23 @@
package com.insigma.service;
import org.springframework.util.Assert;
/**
* (Computer 计算机 接口)
*
* @author zhangxianwei
* @since 2022/4/17 21:07
*/
public interface Computer extends Middleware, Database {
/***
* 执行 脚本程序
* @param shell 执行脚本
* @return
*/
default boolean runShell(String shell) {
Assert.notNull(shell, "未检测到要执行脚本!");
System.out.printf("执行脚本:%s,但是未检测到实现应用调用此方法!%n", shell);
return false;
}
}

43
src/main/java/com/insigma/service/Database.java

@ -0,0 +1,43 @@
package com.insigma.service;
import com.insigma.entry.IndexObj;
import org.springframework.util.Assert;
import java.util.List;
/**
* (Db 接口)
*
* @author zhangxianwei
* @since 2022/4/17 21:09
*/
public interface Database {
/***
* 清除 应用 缓存
* @param index 索引对象列表
* @return
*/
default boolean rebuildIndex(List<IndexObj> index) {
Assert.isNull(index, "未检测到索引对象列表!");
System.out.println(String.format("设置出参数:%s,但是未检测到实现应用调用此方法!", index.stream().getClass()));
return false;
}
/***
* 设置 数据库 大小
* @param size 设置大小值
* @return
*/
default boolean setDbSize(int size) {
System.out.printf("设置出参数:%d,但是未检测到实现应用调用此方法!", size);
return false;
}
/***
* 清除 应用 缓存
* @return
*/
default boolean cleanDbCache() {
System.out.println("进行缓存清除,但是未检测到实现应用调用此方法!");
return false;
}
}

32
src/main/java/com/insigma/service/Middleware.java

@ -0,0 +1,32 @@
package com.insigma.service;
import com.insigma.entry.IndexObj;
import java.util.List;
/**
* (Middleware 接口)
*
* @author zhangxianwei
* @since 2022/4/17 21:10
*/
public interface Middleware {
/***
* 清除 应用 缓存
* @return
*/
default boolean cleanMwCache() {
System.out.printf("清除缓存,但是未检测到实现应用调用此方法!");
return false;
}
/***
* 设置 应用 大小
* @param size 设置大小值
* @return
*/
default boolean setMwSize(int size) {
System.out.printf("设置应用参数:%d,但是未检测到实现应用调用此方法!", size);
return false;
}
}

0
src/main/java/com/insigma/service/impl/.keepgit

32
src/main/java/com/insigma/service/impl/CuWindows.java

@ -0,0 +1,32 @@
package com.insigma.service.impl;
import com.insigma.entry.IndexObj;
import com.insigma.service.Computer;
import java.util.List;
/**
* (CuWindows )
*
* @author zhangxianwei
* @since 23:30 2022/4/17
*/
public class CuWindows implements Computer {
@Override
public boolean rebuildIndex(List<IndexObj> index) {
return false;
}
@Override
public boolean setDbSize(int size) {
System.out.printf("设置出参数:%d,但是未检测到实现应用调用此方法!", size);
return false;
}
@Override
public boolean cleanDbCache() {
System.out.println("进行缓存清除,但是未检测到实现应用调用此方法!");
return false;
}
}
Loading…
Cancel
Save