1
0

refactor(web): 减少文件夹层级

This commit is contained in:
2024-12-13 17:26:17 +08:00
parent db05b69122
commit 8202a27f55
49 changed files with 155 additions and 177 deletions

View File

@@ -1,8 +1,8 @@
package com.eshore.gringotts.web; package com.eshore.gringotts.web;
import com.blinkfox.fenix.EnableFenix; import com.blinkfox.fenix.EnableFenix;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.service.UserService;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;

View File

@@ -1,6 +1,6 @@
package com.eshore.gringotts.web.domain.base.entity; package com.eshore.gringotts.web.domain.base.entity;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.EntityListeners; import javax.persistence.EntityListeners;

View File

@@ -1,6 +1,6 @@
package com.eshore.gringotts.web.domain.base.entity; package com.eshore.gringotts.web.domain.base.entity;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.entity.DataFile;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.core.TreeNode;
import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.DeserializationContext;

View File

@@ -1,6 +1,6 @@
package com.eshore.gringotts.web.domain.base.entity; package com.eshore.gringotts.web.domain.base.entity;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import javax.persistence.ConstraintMode; import javax.persistence.ConstraintMode;
import javax.persistence.EntityListeners; import javax.persistence.EntityListeners;

View File

@@ -1,6 +1,6 @@
package com.eshore.gringotts.web.domain.base.service; package com.eshore.gringotts.web.domain.base.service;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import org.eclipse.collections.api.map.ImmutableMap; import org.eclipse.collections.api.map.ImmutableMap;
/** /**

View File

@@ -4,7 +4,7 @@ import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.service.UserService;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.Query; import javax.persistence.Query;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;

View File

@@ -10,8 +10,8 @@ import com.eshore.gringotts.web.domain.base.entity.IdOnlyEntity_;
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity; import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity_; import com.eshore.gringotts.web.domain.base.entity.SimpleEntity_;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.service.UserService;
import java.util.Optional; import java.util.Optional;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;

View File

@@ -1,14 +1,14 @@
package com.eshore.gringotts.web.domain.authentication.controller; package com.eshore.gringotts.web.domain.controller;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.authentication.service.AuthenticationService;
import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport; import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport;
import com.eshore.gringotts.web.domain.base.entity.FileInfo; import com.eshore.gringotts.web.domain.base.entity.FileInfo;
import com.eshore.gringotts.web.domain.base.entity.SimpleListItem; import com.eshore.gringotts.web.domain.base.entity.SimpleListItem;
import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem; import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem;
import com.eshore.gringotts.web.domain.resource.service.DataResourceService; import com.eshore.gringotts.web.domain.entity.Authentication;
import com.eshore.gringotts.web.domain.upload.service.DataFileService; import com.eshore.gringotts.web.domain.service.AuthenticationService;
import com.eshore.gringotts.web.domain.service.DataFileService;
import com.eshore.gringotts.web.domain.service.DataResourceService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;

View File

@@ -1,10 +1,10 @@
package com.eshore.gringotts.web.domain.check.controller; package com.eshore.gringotts.web.domain.controller;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.base.controller.ListController; import com.eshore.gringotts.web.domain.base.controller.ListController;
import com.eshore.gringotts.web.domain.base.controller.query.Query; import com.eshore.gringotts.web.domain.base.controller.query.Query;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.check.service.CheckOrderService; import com.eshore.gringotts.web.domain.service.CheckOrderService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,14 +1,14 @@
package com.eshore.gringotts.web.domain.confirmation.controller; package com.eshore.gringotts.web.domain.controller;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport; import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport;
import com.eshore.gringotts.web.domain.base.entity.FileInfo; import com.eshore.gringotts.web.domain.base.entity.FileInfo;
import com.eshore.gringotts.web.domain.base.entity.SimpleListItem; import com.eshore.gringotts.web.domain.base.entity.SimpleListItem;
import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem; import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Confirmation;
import com.eshore.gringotts.web.domain.confirmation.service.ConfirmationService; import com.eshore.gringotts.web.domain.service.ConfirmationService;
import com.eshore.gringotts.web.domain.resource.service.DataResourceService; import com.eshore.gringotts.web.domain.service.DataFileService;
import com.eshore.gringotts.web.domain.upload.service.DataFileService; import com.eshore.gringotts.web.domain.service.DataResourceService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;

View File

@@ -1,11 +1,11 @@
package com.eshore.gringotts.web.domain.upload.controller; package com.eshore.gringotts.web.domain.controller;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import com.eshore.gringotts.web.configuration.UploadConfiguration; import com.eshore.gringotts.web.configuration.UploadConfiguration;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.upload.service.DataFileService; import com.eshore.gringotts.web.domain.service.DataFileService;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.controller; package com.eshore.gringotts.web.domain.controller;
import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -7,23 +7,23 @@ import com.eshore.gringotts.web.domain.base.controller.SimpleControllerSupport;
import com.eshore.gringotts.web.domain.base.entity.FileInfo; import com.eshore.gringotts.web.domain.base.entity.FileInfo;
import com.eshore.gringotts.web.domain.base.entity.SimpleListItem; import com.eshore.gringotts.web.domain.base.entity.SimpleListItem;
import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem; import com.eshore.gringotts.web.domain.base.entity.SimpleSaveItem;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Confirmation;
import com.eshore.gringotts.web.domain.resource.entity.DataResource; import com.eshore.gringotts.web.domain.entity.DataFile;
import com.eshore.gringotts.web.domain.resource.entity.format.CsvResourceFormat; import com.eshore.gringotts.web.domain.entity.DataResource;
import com.eshore.gringotts.web.domain.resource.entity.format.JsonLineResourceFormat; import com.eshore.gringotts.web.domain.entity.format.CsvResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.format.JsonResourceFormat; import com.eshore.gringotts.web.domain.entity.format.JsonLineResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.format.LineResourceFormat; import com.eshore.gringotts.web.domain.entity.format.JsonResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.format.NoneResourceFormat; import com.eshore.gringotts.web.domain.entity.format.LineResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat; import com.eshore.gringotts.web.domain.entity.format.NoneResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.type.ApiResourceType; import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.type.DatabaseResourceType; import com.eshore.gringotts.web.domain.entity.type.ApiResourceType;
import com.eshore.gringotts.web.domain.resource.entity.type.FileResourceType; import com.eshore.gringotts.web.domain.entity.type.DatabaseResourceType;
import com.eshore.gringotts.web.domain.resource.entity.type.FtpResourceType; import com.eshore.gringotts.web.domain.entity.type.FileResourceType;
import com.eshore.gringotts.web.domain.resource.entity.type.HDFSResourceType; import com.eshore.gringotts.web.domain.entity.type.FtpResourceType;
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType; import com.eshore.gringotts.web.domain.entity.type.HDFSResourceType;
import com.eshore.gringotts.web.domain.resource.service.DataResourceService; import com.eshore.gringotts.web.domain.entity.type.ResourceType;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.service.DataFileService;
import com.eshore.gringotts.web.domain.upload.service.DataFileService; import com.eshore.gringotts.web.domain.service.DataResourceService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import java.time.LocalDateTime; import java.time.LocalDateTime;

View File

@@ -1,11 +1,9 @@
package com.eshore.gringotts.web.domain.user.controller; package com.eshore.gringotts.web.domain.controller;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.service.UserService;
import lombok.Data; import lombok.Data;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -1,10 +1,10 @@
package com.eshore.gringotts.web.domain.user.controller; package com.eshore.gringotts.web.domain.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.eshore.gringotts.web.configuration.amis.AmisListResponse; import com.eshore.gringotts.web.configuration.amis.AmisListResponse;
import com.eshore.gringotts.web.configuration.amis.AmisResponse; import com.eshore.gringotts.web.configuration.amis.AmisResponse;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.service.UserService;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@@ -1,10 +1,8 @@
package com.eshore.gringotts.web.domain.authentication.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
import com.eshore.gringotts.web.domain.resource.entity.DataResource;
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;

View File

@@ -1,8 +1,7 @@
package com.eshore.gringotts.web.domain.check.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity; import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;
import com.eshore.gringotts.web.domain.user.entity.User;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.ConstraintMode; import javax.persistence.ConstraintMode;
import javax.persistence.Entity; import javax.persistence.Entity;

View File

@@ -1,10 +1,8 @@
package com.eshore.gringotts.web.domain.confirmation.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
import com.eshore.gringotts.web.domain.resource.entity.DataResource;
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.ConstraintMode; import javax.persistence.ConstraintMode;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.upload.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;

View File

@@ -1,12 +1,9 @@
package com.eshore.gringotts.web.domain.resource.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat; import com.eshore.gringotts.web.domain.entity.type.ResourceType;
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType;
import com.eshore.gringotts.web.domain.upload.entity.DataFile;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.user.entity; package com.eshore.gringotts.web.domain.entity;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity; import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.format; package com.eshore.gringotts.web.domain.entity.format;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
@@ -27,6 +27,8 @@ import org.hibernate.annotations.Where;
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?") @SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE) @Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
public abstract class ResourceFormat extends LogicDeleteIdOnlyEntity { public abstract class ResourceFormat extends LogicDeleteIdOnlyEntity {
public abstract Type getFormatType();
public enum Type { public enum Type {
NONE, NONE,
LINE, LINE,
@@ -34,6 +36,4 @@ public abstract class ResourceFormat extends LogicDeleteIdOnlyEntity {
JSON_LINE, JSON_LINE,
CSV, CSV,
} }
public abstract Type getFormatType();
} }

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,8 +1,8 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.entity.DataFile;
import javax.persistence.ConstraintMode; import javax.persistence.ConstraintMode;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.ForeignKey; import javax.persistence.ForeignKey;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,8 +1,8 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.entity.DataFile;
import javax.persistence.ConstraintMode; import javax.persistence.ConstraintMode;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.ForeignKey; import javax.persistence.ForeignKey;

View File

@@ -1,4 +1,4 @@
package com.eshore.gringotts.web.domain.resource.entity.type; package com.eshore.gringotts.web.domain.entity.type;
import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.core.Constants;
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;

View File

@@ -1,7 +1,7 @@
package com.eshore.gringotts.web.domain.authentication.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.entity.Authentication;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;

View File

@@ -1,8 +1,8 @@
package com.eshore.gringotts.web.domain.check.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import javax.transaction.Transactional; import javax.transaction.Transactional;

View File

@@ -1,7 +1,7 @@
package com.eshore.gringotts.web.domain.confirmation.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Confirmation;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;

View File

@@ -1,7 +1,7 @@
package com.eshore.gringotts.web.domain.upload.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.entity.DataFile;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository

View File

@@ -1,7 +1,7 @@
package com.eshore.gringotts.web.domain.resource.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.resource.entity.DataResource; import com.eshore.gringotts.web.domain.entity.DataResource;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;

View File

@@ -0,0 +1,9 @@
package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
import org.springframework.stereotype.Repository;
@Repository
public interface ResourceFormatRepository extends SimpleRepository<ResourceFormat, Long> {
}

View File

@@ -0,0 +1,9 @@
package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.entity.type.ResourceType;
import org.springframework.stereotype.Repository;
@Repository
public interface ResourceTypeRepository extends SimpleRepository<ResourceType, Long> {
}

View File

@@ -1,7 +1,7 @@
package com.eshore.gringotts.web.domain.user.repository; package com.eshore.gringotts.web.domain.repository;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository; import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.EntityGraph;
@@ -21,6 +21,7 @@ public interface UserRepository extends SimpleRepository<User, Long> {
List<User> findAll(); List<User> findAll();
Boolean existsByUsername(String username); Boolean existsByUsername(String username);
@EntityGraph(value = "user.detail", type = EntityGraph.EntityGraphType.FETCH) @EntityGraph(value = "user.detail", type = EntityGraph.EntityGraphType.FETCH)
Optional<User> findByUsername(String username); Optional<User> findByUsername(String username);
} }

View File

@@ -1,12 +0,0 @@
package com.eshore.gringotts.web.domain.resource.repository;
import com.blinkfox.fenix.jpa.FenixJpaRepository;
import com.blinkfox.fenix.specification.FenixJpaSpecificationExecutor;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
@Repository
public interface ResourceFormatRepository extends SimpleRepository<ResourceFormat, Long> {
}

View File

@@ -1,12 +0,0 @@
package com.eshore.gringotts.web.domain.resource.repository;
import com.blinkfox.fenix.jpa.FenixJpaRepository;
import com.blinkfox.fenix.specification.FenixJpaSpecificationExecutor;
import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
@Repository
public interface ResourceTypeRepository extends SimpleRepository<ResourceType, Long> {
}

View File

@@ -1,18 +1,16 @@
package com.eshore.gringotts.web.domain.authentication.service; package com.eshore.gringotts.web.domain.service;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication_;
import com.eshore.gringotts.web.domain.authentication.repository.AuthenticationRepository;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
import com.eshore.gringotts.web.domain.base.service.CheckingService; import com.eshore.gringotts.web.domain.base.service.CheckingService;
import com.eshore.gringotts.web.domain.base.service.LogicDeleteService; import com.eshore.gringotts.web.domain.base.service.LogicDeleteService;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.Authentication;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder_; import com.eshore.gringotts.web.domain.entity.Authentication_;
import com.eshore.gringotts.web.domain.check.service.CheckOrderService; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.CheckOrder_;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.repository.AuthenticationRepository;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
@@ -34,7 +32,7 @@ import org.springframework.stereotype.Service;
* @date 2024-12-02 * @date 2024-12-02
*/ */
@Slf4j @Slf4j
@Service("com.eshore.gringotts.web.domain.authentication.service.AuthenticationService") @Service("com.eshore.gringotts.web.domain.service.AuthenticationService")
public class AuthenticationService extends LogicDeleteService<Authentication> implements CheckingService { public class AuthenticationService extends LogicDeleteService<Authentication> implements CheckingService {
private final AuthenticationRepository authenticationRepository; private final AuthenticationRepository authenticationRepository;
private final UserService userService; private final UserService userService;
@@ -94,7 +92,7 @@ public class AuthenticationService extends LogicDeleteService<Authentication> im
StrUtil.format("数据资源「{}」的授权申请", authentication.getTarget().getName()), StrUtil.format("数据资源「{}」的授权申请", authentication.getTarget().getName()),
CheckOrder.Type.AUTHENTICATION, CheckOrder.Type.AUTHENTICATION,
mapper.writeValueAsString(Maps.immutable.of("authenticationId", authentication.getId())), mapper.writeValueAsString(Maps.immutable.of("authenticationId", authentication.getId())),
"com.eshore.gringotts.web.domain.authentication.service.AuthenticationService", "com.eshore.gringotts.web.domain.service.AuthenticationService",
authentication.getCreatedUser() authentication.getCreatedUser()
)); ));
CheckOrder order = checkOrderService.detailOrThrow(orderId); CheckOrder order = checkOrderService.detailOrThrow(orderId);

View File

@@ -1,14 +1,13 @@
package com.eshore.gringotts.web.domain.check.service; package com.eshore.gringotts.web.domain.service;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.gringotts.web.domain.base.service.CheckingService; import com.eshore.gringotts.web.domain.base.service.CheckingService;
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport; import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder_; import com.eshore.gringotts.web.domain.entity.CheckOrder_;
import com.eshore.gringotts.web.domain.check.repository.CheckOrderRepository; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.repository.CheckOrderRepository;
import com.eshore.gringotts.web.domain.user.service.UserService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,18 +1,16 @@
package com.eshore.gringotts.web.domain.confirmation.service; package com.eshore.gringotts.web.domain.service;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
import com.eshore.gringotts.web.domain.base.service.CheckingService; import com.eshore.gringotts.web.domain.base.service.CheckingService;
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport; import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder_; import com.eshore.gringotts.web.domain.entity.CheckOrder_;
import com.eshore.gringotts.web.domain.check.service.CheckOrderService; import com.eshore.gringotts.web.domain.entity.Confirmation;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Confirmation_;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation_; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.confirmation.repository.ConfirmationRepository; import com.eshore.gringotts.web.domain.repository.ConfirmationRepository;
import com.eshore.gringotts.web.domain.user.entity.User;
import com.eshore.gringotts.web.domain.user.service.UserService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
@@ -35,7 +33,7 @@ import org.springframework.stereotype.Service;
* @date 2024-11-26 * @date 2024-11-26
*/ */
@Slf4j @Slf4j
@Service("com.eshore.gringotts.web.domain.confirmation.service.ConfirmationService") @Service("com.eshore.gringotts.web.domain.service.ConfirmationService")
public class ConfirmationService extends SimpleServiceSupport<Confirmation> implements CheckingService { public class ConfirmationService extends SimpleServiceSupport<Confirmation> implements CheckingService {
private final ConfirmationRepository confirmationRepository; private final ConfirmationRepository confirmationRepository;
private final CheckOrderService checkOrderService; private final CheckOrderService checkOrderService;
@@ -90,7 +88,7 @@ public class ConfirmationService extends SimpleServiceSupport<Confirmation> impl
StrUtil.format("数据资源「{}」的确权申请", confirmation.getTarget().getName()), StrUtil.format("数据资源「{}」的确权申请", confirmation.getTarget().getName()),
CheckOrder.Type.CONFIRMATION, CheckOrder.Type.CONFIRMATION,
mapper.writeValueAsString(Maps.immutable.of("confirmationId", confirmation.getId())), mapper.writeValueAsString(Maps.immutable.of("confirmationId", confirmation.getId())),
"com.eshore.gringotts.web.domain.confirmation.service.ConfirmationService", "com.eshore.gringotts.web.domain.service.ConfirmationService",
User.Role.CHECKER User.Role.CHECKER
)); ));
CheckOrder order = checkOrderService.detailOrThrow(orderId); CheckOrder order = checkOrderService.detailOrThrow(orderId);

View File

@@ -1,15 +1,14 @@
package com.eshore.gringotts.web.domain.upload.service; package com.eshore.gringotts.web.domain.service;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication_;
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport; import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Authentication;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation_; import com.eshore.gringotts.web.domain.entity.Authentication_;
import com.eshore.gringotts.web.domain.upload.entity.DataFile; import com.eshore.gringotts.web.domain.entity.Confirmation;
import com.eshore.gringotts.web.domain.upload.entity.DataFile_; import com.eshore.gringotts.web.domain.entity.Confirmation_;
import com.eshore.gringotts.web.domain.upload.repository.DataFileRepository; import com.eshore.gringotts.web.domain.entity.DataFile;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.DataFile_;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.repository.DataFileRepository;
import com.eshore.gringotts.web.helper.EntityHelper; import com.eshore.gringotts.web.helper.EntityHelper;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;

View File

@@ -1,19 +1,18 @@
package com.eshore.gringotts.web.domain.resource.service; package com.eshore.gringotts.web.domain.service;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication;
import com.eshore.gringotts.web.domain.authentication.entity.Authentication_;
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport; import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation; import com.eshore.gringotts.web.domain.entity.Authentication;
import com.eshore.gringotts.web.domain.confirmation.entity.Confirmation_; import com.eshore.gringotts.web.domain.entity.Authentication_;
import com.eshore.gringotts.web.domain.resource.entity.DataResource; import com.eshore.gringotts.web.domain.entity.Confirmation;
import com.eshore.gringotts.web.domain.resource.entity.DataResource_; import com.eshore.gringotts.web.domain.entity.Confirmation_;
import com.eshore.gringotts.web.domain.resource.entity.format.ResourceFormat; import com.eshore.gringotts.web.domain.entity.DataResource;
import com.eshore.gringotts.web.domain.resource.entity.type.ResourceType; import com.eshore.gringotts.web.domain.entity.DataResource_;
import com.eshore.gringotts.web.domain.resource.repository.DataResourceRepository; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.resource.repository.ResourceFormatRepository; import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
import com.eshore.gringotts.web.domain.resource.repository.ResourceTypeRepository; import com.eshore.gringotts.web.domain.entity.type.ResourceType;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.repository.DataResourceRepository;
import com.eshore.gringotts.web.domain.user.service.UserService; import com.eshore.gringotts.web.domain.repository.ResourceFormatRepository;
import com.eshore.gringotts.web.domain.repository.ResourceTypeRepository;
import com.eshore.gringotts.web.helper.EntityHelper; import com.eshore.gringotts.web.helper.EntityHelper;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;

View File

@@ -1,12 +1,12 @@
package com.eshore.gringotts.web.domain.user.service; package com.eshore.gringotts.web.domain.service;
import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import com.eshore.gringotts.web.domain.user.repository.UserRepository; import com.eshore.gringotts.web.domain.repository.UserRepository;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Optional; import java.util.Optional;
import lombok.Data; import lombok.Data;

View File

@@ -3,9 +3,9 @@ package com.eshore.gringotts.web.helper;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity_; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity_;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder; import com.eshore.gringotts.web.domain.entity.CheckOrder;
import com.eshore.gringotts.web.domain.check.entity.CheckOrder_; import com.eshore.gringotts.web.domain.entity.CheckOrder_;
import com.eshore.gringotts.web.domain.user.entity.User; import com.eshore.gringotts.web.domain.entity.User;
import java.util.function.Supplier; import java.util.function.Supplier;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Predicate;