This commit is contained in:
959814898@qq.com
2024-05-30 09:44:52 +08:00
parent 184b40bdbf
commit c6caa39629
68 changed files with 8819 additions and 940 deletions
+6
View File
@@ -21,6 +21,12 @@
<artifactId>minio</artifactId>
<version>8.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,34 @@
package com.wyl.file.sequence;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* @author <a href="Tastill@**.cn">Tastill</a>
* @version 2019/1/24 14:55
* @description FileListener
*/
@Slf4j
public class FileListener extends FileAlterationListenerAdaptor {
/**
* @param
* @return
* @description 文件创建
* @version 2.0, 2019/1/24 14:59
* @author <a href="Tastill@**.cn">Tastill</a>
*/
@SneakyThrows
@Override
public void onFileCreate(File file) {
// String s = Files.readString(Paths.get(file.getAbsolutePath()));
// log.info("有新文件生成:" + s);
}
}
@@ -0,0 +1,22 @@
package com.wyl.file.sequence;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class FileRead {
public static void main(String[] args) throws FileNotFoundException {
File file = new File("C:\\Users\\95981\\Desktop\\2\\视频11.mp4");
InputStream inStream = new FileInputStream(file);
byte[] bs = new byte[1024];
int i = 0;
try {
while ((i = inStream.read(bs)) != -1) {
System.out.println(i);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,52 @@
package com.wyl.file.sequence;
import java.io.IOException;
import java.nio.file.*;
public class FolderWatcher {
public static void main(String[] args) throws IOException {
// 指定要监控的文件夹路径
Path folderToWatch = Paths.get("C:\\Users\\95981\\Desktop\\ai\\result");
// 创建WatchService
WatchService watchService = FileSystems.getDefault().newWatchService();
// 注册要监控的文件夹以及子文件夹
folderToWatch.register(watchService, StandardWatchEventKinds.ENTRY_CREATE);
System.out.println("Watching folder: " + folderToWatch);
// 启动无限循环以监控文件夹事件
while (true) {
WatchKey key;
try {
// 获取下一个文件系统事件
key = watchService.take();
} catch (InterruptedException e) {
return;
}
// 处理文件系统事件
for (WatchEvent<?> event : key.pollEvents()) {
WatchEvent.Kind<?> kind = event.kind();
// 获取事件发生的文件路径
Path eventPath = (Path) event.context();
Path fullPath = folderToWatch.resolve(eventPath);
if (kind == StandardWatchEventKinds.ENTRY_CREATE) {
// 处理文件新增事件
System.out.println("File created: " + fullPath);
}
}
// 重置WatchKey以便继续监控
boolean valid = key.reset();
if (!valid) {
// 如果WatchKey不再有效,退出循环
break;
}
}
}
}
@@ -0,0 +1,34 @@
package com.wyl.file.sequence;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.monitor.FileAlterationMonitor;
import org.apache.commons.io.monitor.FileAlterationObserver;
import java.util.concurrent.TimeUnit;
public class IOtest {
public static void main(String[] args) {
String rootDir = "C:\\Users\\95981\\Desktop\\ai\\result";
// 轮询间隔 5 秒
Integer time = 1;
long interval = TimeUnit.SECONDS.toMillis(time);
// 创建一个文件观察器用于处理文件的格式,
// FileFilterUtils.suffixFileFilter(".txt")
// FileAlterationObserver _observer = new FileAlterationObserver(
// rootDir,
// FileFilterUtils.and(
// FileFilterUtils.fileFileFilter()), //过滤文件格式
// null);
FileAlterationObserver observer = new FileAlterationObserver(rootDir);
observer.addListener(new FileListener()); //设置文件变化监听器
//创建文件变化监听器
FileAlterationMonitor monitor = new FileAlterationMonitor(interval, observer);
// 开始监控
try {
monitor.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -1,359 +0,0 @@
package generator.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 算法实验记录表
* @TableName abtest_experiment_algorithm
*/
@TableName(value ="abtest_experiment_algorithm")
public class AbtestExperimentAlgorithm implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 参数列表,json格式的字符串,如[{key:value},]
*/
private String parametersList;
/**
* 分流模式
*/
private String shuntType;
/**
* 版本号
*/
private Integer version;
/**
* abtest_experiment_group表中的id,关联实验状态信息
*/
private Integer abtestExperimentGroupId;
/**
* 实验细节描述
*/
private String detailsDescription;
/**
* 分流字段
*/
private String shuntKey;
/**
* 分流比例
*/
private Integer shuntProportion;
/**
* 更新时间
*/
private LocalDateTime updateTime;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 名字
*/
private String employeeName;
/**
* 工号
*/
private String employeeWorkCode;
/**
* 已删除 1 未删除 0
*/
private Integer deleted;
/**
* etl更新时间
*/
private LocalDateTime beidouEtlTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 参数列表,json格式的字符串,如[{key:value},]
*/
public String getParametersList() {
return parametersList;
}
/**
* 参数列表,json格式的字符串,如[{key:value},]
*/
public void setParametersList(String parametersList) {
this.parametersList = parametersList;
}
/**
* 分流模式
*/
public String getShuntType() {
return shuntType;
}
/**
* 分流模式
*/
public void setShuntType(String shuntType) {
this.shuntType = shuntType;
}
/**
* 版本号
*/
public Integer getVersion() {
return version;
}
/**
* 版本号
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* abtest_experiment_group表中的id,关联实验状态信息
*/
public Integer getAbtestExperimentGroupId() {
return abtestExperimentGroupId;
}
/**
* abtest_experiment_group表中的id,关联实验状态信息
*/
public void setAbtestExperimentGroupId(Integer abtestExperimentGroupId) {
this.abtestExperimentGroupId = abtestExperimentGroupId;
}
/**
* 实验细节描述
*/
public String getDetailsDescription() {
return detailsDescription;
}
/**
* 实验细节描述
*/
public void setDetailsDescription(String detailsDescription) {
this.detailsDescription = detailsDescription;
}
/**
* 分流字段
*/
public String getShuntKey() {
return shuntKey;
}
/**
* 分流字段
*/
public void setShuntKey(String shuntKey) {
this.shuntKey = shuntKey;
}
/**
* 分流比例
*/
public Integer getShuntProportion() {
return shuntProportion;
}
/**
* 分流比例
*/
public void setShuntProportion(Integer shuntProportion) {
this.shuntProportion = shuntProportion;
}
/**
* 更新时间
*/
public LocalDateTime getUpdateTime() {
return updateTime;
}
/**
* 更新时间
*/
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
/**
* 创建时间
*/
public LocalDateTime getCreateTime() {
return createTime;
}
/**
* 创建时间
*/
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
/**
* 名字
*/
public String getEmployeeName() {
return employeeName;
}
/**
* 名字
*/
public void setEmployeeName(String employeeName) {
this.employeeName = employeeName;
}
/**
* 工号
*/
public String getEmployeeWorkCode() {
return employeeWorkCode;
}
/**
* 工号
*/
public void setEmployeeWorkCode(String employeeWorkCode) {
this.employeeWorkCode = employeeWorkCode;
}
/**
* 已删除 1 未删除 0
*/
public Integer getDeleted() {
return deleted;
}
/**
* 已删除 1 未删除 0
*/
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
/**
* etl更新时间
*/
public LocalDateTime getBeidouEtlTime() {
return beidouEtlTime;
}
/**
* etl更新时间
*/
public void setBeidouEtlTime(LocalDateTime beidouEtlTime) {
this.beidouEtlTime = beidouEtlTime;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
AbtestExperimentAlgorithm other = (AbtestExperimentAlgorithm) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getParametersList() == null ? other.getParametersList() == null : this.getParametersList().equals(other.getParametersList()))
&& (this.getShuntType() == null ? other.getShuntType() == null : this.getShuntType().equals(other.getShuntType()))
&& (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
&& (this.getAbtestExperimentGroupId() == null ? other.getAbtestExperimentGroupId() == null : this.getAbtestExperimentGroupId().equals(other.getAbtestExperimentGroupId()))
&& (this.getDetailsDescription() == null ? other.getDetailsDescription() == null : this.getDetailsDescription().equals(other.getDetailsDescription()))
&& (this.getShuntKey() == null ? other.getShuntKey() == null : this.getShuntKey().equals(other.getShuntKey()))
&& (this.getShuntProportion() == null ? other.getShuntProportion() == null : this.getShuntProportion().equals(other.getShuntProportion()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getEmployeeName() == null ? other.getEmployeeName() == null : this.getEmployeeName().equals(other.getEmployeeName()))
&& (this.getEmployeeWorkCode() == null ? other.getEmployeeWorkCode() == null : this.getEmployeeWorkCode().equals(other.getEmployeeWorkCode()))
&& (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
&& (this.getBeidouEtlTime() == null ? other.getBeidouEtlTime() == null : this.getBeidouEtlTime().equals(other.getBeidouEtlTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getParametersList() == null) ? 0 : getParametersList().hashCode());
result = prime * result + ((getShuntType() == null) ? 0 : getShuntType().hashCode());
result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
result = prime * result + ((getAbtestExperimentGroupId() == null) ? 0 : getAbtestExperimentGroupId().hashCode());
result = prime * result + ((getDetailsDescription() == null) ? 0 : getDetailsDescription().hashCode());
result = prime * result + ((getShuntKey() == null) ? 0 : getShuntKey().hashCode());
result = prime * result + ((getShuntProportion() == null) ? 0 : getShuntProportion().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getEmployeeName() == null) ? 0 : getEmployeeName().hashCode());
result = prime * result + ((getEmployeeWorkCode() == null) ? 0 : getEmployeeWorkCode().hashCode());
result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
result = prime * result + ((getBeidouEtlTime() == null) ? 0 : getBeidouEtlTime().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", parametersList=").append(parametersList);
sb.append(", shuntType=").append(shuntType);
sb.append(", version=").append(version);
sb.append(", abtestExperimentGroupId=").append(abtestExperimentGroupId);
sb.append(", detailsDescription=").append(detailsDescription);
sb.append(", shuntKey=").append(shuntKey);
sb.append(", shuntProportion=").append(shuntProportion);
sb.append(", updateTime=").append(updateTime);
sb.append(", createTime=").append(createTime);
sb.append(", employeeName=").append(employeeName);
sb.append(", employeeWorkCode=").append(employeeWorkCode);
sb.append(", deleted=").append(deleted);
sb.append(", beidouEtlTime=").append(beidouEtlTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
@@ -1,18 +0,0 @@
package generator.mapper;
import generator.domain.AbtestExperimentAlgorithm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author wyl
* @description 针对表【abtest_experiment_algorithm(算法实验记录表)】的数据库操作Mapper
* @createDate 2023-05-26 10:46:15
* @Entity generator.domain.AbtestExperimentAlgorithm
*/
public interface AbtestExperimentAlgorithmMapper extends BaseMapper<AbtestExperimentAlgorithm> {
}
@@ -1,13 +0,0 @@
package generator.service;
import generator.domain.AbtestExperimentAlgorithm;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author wyl
* @description 针对表【abtest_experiment_algorithm(算法实验记录表)】的数据库操作Service
* @createDate 2023-05-26 10:46:15
*/
public interface AbtestExperimentAlgorithmService extends IService<AbtestExperimentAlgorithm> {
}
@@ -1,22 +0,0 @@
package generator.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import generator.domain.AbtestExperimentAlgorithm;
import generator.service.AbtestExperimentAlgorithmService;
import generator.mapper.AbtestExperimentAlgorithmMapper;
import org.springframework.stereotype.Service;
/**
* @author wyl
* @description 针对表【abtest_experiment_algorithm(算法实验记录表)】的数据库操作Service实现
* @createDate 2023-05-26 10:46:15
*/
@Service
public class AbtestExperimentAlgorithmServiceImpl extends ServiceImpl<AbtestExperimentAlgorithmMapper, AbtestExperimentAlgorithm>
implements AbtestExperimentAlgorithmService{
}