Compare commits

40 Commits

Author SHA1 Message Date
sdw086 1eac5db02d admin/front 분리2 2026-07-20 17:49:39 +09:00
sdw086 ed41ef24cb admin/front 분리 2026-07-20 17:49:24 +09:00
sdw086 9269278e40 [PATCH] swagger 문서 버전 정보 기입 2026-06-29 11:48:10 +09:00
sdw086 9a1a1a02c9 [api] admin/notice/~
공지사항 api 추가
2026-06-25 17:42:41 +09:00
sdw086 f6df6bc7cb [api] admin/member/delete
회원 정보삭제 다중으로 받을수 있게 수정
2026-06-24 14:53:24 +09:00
sdw086 d00b7dca70 [api] admin/member/delete
회원 정보삭제 다중으로 받을수 있게 수정
2026-06-24 10:49:59 +09:00
sdw086 70f674f6e7 [api] admin/member/add
회원 정보 등록 추가
2026-06-23 16:30:16 +09:00
sdw086 35b89d861c [api] admin/member/add
회원 정보 등록 추가
2026-06-23 10:27:18 +09:00
sdw086 4b65caee2b [api] md 파일 갱신 2026-05-28 15:05:43 +09:00
sdw086 e8004a7da9 [api] SSO 관리 작업 2026-05-28 14:53:52 +09:00
sdw086 b0646a0d3d [api] 스케줄 관리 작업 2026-05-28 10:30:10 +09:00
sdw086 cbea6bc2af [api] tus 수정 2026-05-27 15:18:03 +09:00
sdw086 85d593fb9d [api] tus 주소 부터 일단변경 2026-05-26 10:02:08 +09:00
sdw086 797b12b459 [api] SecurityConfig.java 수정 2026-05-26 09:04:46 +09:00
sdw086 96fd237aeb [api] fornt 패키지 로 front 파일 이동 2026-05-22 17:44:22 +09:00
sdw086 059d690c93 [api] FileController.java 컨벤션 맞춰 변경 2026-05-22 16:40:22 +09:00
sdw086 24783da7a0 [api] UserController.java 컨벤션 맞춰 변경 및 개인정보 상세 추가 2026-05-22 15:53:15 +09:00
sdw086 7b10ef0db8 [api] SsoController.java, AuthController.java 컨벤션 맞춰 변경 2026-05-22 11:55:48 +09:00
sdw086 3a4f4679c0 [api] CorsController.java 이쪽 컨벤션 맞춰 변경 2026-05-21 18:04:38 +09:00
sdw086 bdaaec4f97 [api] AdminUserController.java 이쪽 컨벤션 맞춰 변경 2026-05-21 17:17:59 +09:00
sdw086 05cf8281f2 [api] AdminAuthController 이쪽 컨벤션 맞춰 변경 2026-05-21 16:56:04 +09:00
sdw086 4c30133285 [api] AdminMemberController 이쪽 컨벤션 맞춰 변경 2026-05-21 16:02:45 +09:00
sdw086 41b3cd5b33 [api] 크로스도메인 등록 목록 작업 2026-05-21 11:56:22 +09:00
sdw086 ada6dfc7b4 [api] 관리자 휴면/탈퇴/삭제 추가 2026-05-20 17:48:07 +09:00
sdw086 b58a321482 [api] 회원 탈퇴 관련 api 추가 2026-05-20 09:00:06 +09:00
sdw086 d5483b790d [api] 회원 목록 & 수정 & 상세 추가 / 각 vo dto contorller schema 추가 2026-05-19 16:17:05 +09:00
sdw086 4cc6078484 [api] 회원정보 수정 & 비밀번호 변경 2026-05-18 10:55:16 +09:00
sdw086 58252a0fda [api] 회원 비밀번호 확인 추가2 2026-05-15 17:39:50 +09:00
sdw086 1f0c76bbd4 [api] 회원 비밀번호 확인 추가2 2026-05-15 17:39:43 +09:00
sdw086 8cdcc81aaf [api] 회원 비밀번호 확인 추가 2026-05-15 17:37:35 +09:00
sdw086 4368eccc82 [api] userType, userRole 추가 2026-05-12 17:40:07 +09:00
sdw086 c7b8478ad0 [api] 회원가입 샘플 추가 2026-05-12 15:00:08 +09:00
sdw086 376a9bb576 [api] tus 파일 다운로드 업로드 주소 변경 2026-05-12 14:48:25 +09:00
sdw086 4e6c87798f [api] 파일업로드, TUS path통일, 권한 내용 변경 2026-05-12 14:40:54 +09:00
sdw086 a4a8b551b0 [api] 파일업로드 공개 2026-05-11 09:50:12 +09:00
sdw086 13e41f6e3c [api] 파일업로드, tus파일 주소변경, md 파일 변경 2026-05-08 17:21:19 +09:00
sdw086 0fc91fddac [api] file -> tusFile 패키지로 변경 2026-05-07 09:45:11 +09:00
sdw086 5d3f5dc15d [admin] 로그인 로그아웃 작업 추가 2026-04-30 08:32:03 +09:00
sdw086 6cae972c0c [개발]AGENTS 문서 업데이트 2026-04-24 10:58:14 +09:00
sdw086 88c3a4364b [api] 코딩 컨벤션 추가 2026-04-09 10:54:53 +09:00
555 changed files with 18434 additions and 4550 deletions
+34
View File
@@ -0,0 +1,34 @@
plugins {
id 'java-library'
}
dependencies {
api 'org.springframework.boot:spring-boot-starter'
api 'org.springframework.boot:spring-boot-starter-web'
api 'org.springframework.boot:spring-boot-starter-validation'
api 'org.springframework.boot:spring-boot-starter-security'
api 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.3'
api 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.27'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
runtimeOnly 'com.microsoft.sqlserver:mssql-jdbc:12.8.1.jre11'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
jar {
enabled = true
}
@@ -1,7 +1,7 @@
package com.alist.api.config.exception; package com.alist.api.core.common.exception;
import com.alist.api.common.response.ApiResponse; import com.alist.api.core.common.response.ApiResponse;
import com.alist.api.common.response.ApiResponseCode; import com.alist.api.core.common.response.ApiResponseCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.javassist.NotFoundException; import org.apache.ibatis.javassist.NotFoundException;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@@ -0,0 +1,155 @@
package com.alist.api.core.common.file.service;
import com.alist.api.core.config.file.FileUploadProperties;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Iterator;
@Service
public class FileImageService {
public record ImageSize(int width, int height) {
}
public ImageSize resizeAndSave(MultipartFile multipartFile, Path savePath, FileUploadProperties.Resize resize, String extension) throws IOException {
BufferedImage source = ImageIO.read(multipartFile.getInputStream());
if (source == null) {
throw new IllegalArgumentException("invalid image");
}
BufferedImage target;
if (resize.getWidth() != null && resize.getHeight() != null) {
target = cropAndResize(source, resize.getWidth(), resize.getHeight());
} else if (resize.getMaxWidth() != null && source.getWidth() > resize.getMaxWidth()) {
target = resizeByMaxWidth(source, resize.getMaxWidth());
} else {
target = source;
}
writeImage(target, imageFormat(extension), savePath, resize.getQuality());
return new ImageSize(target.getWidth(), target.getHeight());
}
public ImageSize readSize(Path path) throws IOException {
BufferedImage image = ImageIO.read(path.toFile());
if (image == null) {
return null;
}
return new ImageSize(image.getWidth(), image.getHeight());
}
private BufferedImage cropAndResize(BufferedImage source, int targetWidth, int targetHeight) {
double targetRatio = (double) targetWidth / targetHeight;
int sourceWidth = source.getWidth();
int sourceHeight = source.getHeight();
double sourceRatio = (double) sourceWidth / sourceHeight;
int cropWidth = sourceWidth;
int cropHeight = sourceHeight;
if (sourceRatio > targetRatio) {
cropWidth = (int) Math.round(sourceHeight * targetRatio);
} else {
cropHeight = (int) Math.round(sourceWidth / targetRatio);
}
BufferedImage cropped = source.getSubimage(
(sourceWidth - cropWidth) / 2
, (sourceHeight - cropHeight) / 2
, cropWidth
, cropHeight
);
return resize(cropped, targetWidth, targetHeight);
}
private BufferedImage resizeByMaxWidth(BufferedImage source, int maxWidth) {
int targetWidth = maxWidth;
int targetHeight = (int) Math.round((double) source.getHeight() * targetWidth / source.getWidth());
return resize(source, targetWidth, targetHeight);
}
private BufferedImage resize(BufferedImage source, int width, int height) {
BufferedImage target = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = target.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
graphics.drawImage(source, 0, 0, width, height, null);
graphics.dispose();
return target;
}
private void writeImage(BufferedImage image, String format, Path savePath, Float quality) throws IOException {
if (!"jpeg".equals(format)) {
boolean written = ImageIO.write(image, format, savePath.toFile());
if (!written) {
throw new IllegalArgumentException("unsupported image format");
}
return;
}
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("jpeg");
if (!writers.hasNext()) {
throw new IllegalArgumentException("unsupported image format");
}
ImageWriter writer = writers.next();
ImageWriteParam parameter = writer.getDefaultWriteParam();
if (parameter.canWriteCompressed()) {
parameter.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
parameter.setCompressionQuality(normalizeQuality(quality));
}
try (ImageOutputStream output = ImageIO.createImageOutputStream(savePath.toFile())) {
writer.setOutput(output);
writer.write(null, new IIOImage(image, null, null), parameter);
} finally {
writer.dispose();
}
}
private float normalizeQuality(Float quality) {
if (quality == null) {
return 0.9f;
}
if (quality < 0.0f) {
return 0.0f;
}
if (quality > 1.0f) {
return 1.0f;
}
return quality;
}
private String imageFormat(String extension) {
if ("jpg".equalsIgnoreCase(extension)) {
return "jpeg";
}
return extension.toLowerCase();
}
}
@@ -0,0 +1,288 @@
package com.alist.api.core.common.file.service;
import com.alist.api.core.common.file.vo.FileStorageUploadVo;
import com.alist.api.core.config.file.FileUploadProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource;
import org.springframework.http.ContentDisposition;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.Locale;
import java.util.UUID;
@Service
public class FileStorageService {
private static final String PUBLIC_PREFIX = "/uploads";
@Value("${file.storage.root-path}")
private String rootPath;
@Value("${file.storage.view-domain}")
private String viewDomain;
private final FileUploadProperties fileUploadProperties;
private final FileImageService fileImageService;
public FileStorageService(FileUploadProperties fileUploadProperties, FileImageService fileImageService) {
this.fileUploadProperties = fileUploadProperties;
this.fileImageService = fileImageService;
}
public FileStorageUploadVo saveFileUpload(String folder, MultipartFile multipartFile) {
if (folder == null || folder.isBlank()) {
throw new IllegalArgumentException("invalid folder");
}
if (multipartFile == null || multipartFile.isEmpty()) {
throw new IllegalArgumentException("empty file");
}
FileUploadProperties.UploadType uploadType = resolveUploadType(folder);
String originalFileName = cleanFileName(multipartFile.getOriginalFilename());
String extension = extractExtension(originalFileName);
validateExtension(extension);
validateSize(multipartFile.getSize(), uploadType);
boolean image = isImageExtension(extension);
if (uploadType.isImageOnly() && !image) {
throw new IllegalArgumentException("image only");
}
LocalDate today = LocalDate.now();
String storedFileName = UUID.randomUUID().toString().replace("-", "") + "." + extension;
Path savePath = Paths.get(
rootPath
, uploadType.getFolder()
, String.valueOf(today.getYear())
, "%02d".formatted(today.getMonthValue())
, "%02d".formatted(today.getDayOfMonth())
, storedFileName
).normalize().toAbsolutePath();
ensureUnderRoot(savePath);
try {
Files.createDirectories(savePath.getParent());
FileImageService.ImageSize imageSize = null;
if (image && uploadType.getResize() != null && uploadType.getResize().isEnabled()) {
imageSize = fileImageService.resizeAndSave(multipartFile, savePath, uploadType.getResize(), extension);
} else {
multipartFile.transferTo(savePath);
if (image) {
imageSize = fileImageService.readSize(savePath);
}
}
FileStorageUploadVo fileStorageUploadVo = new FileStorageUploadVo();
fileStorageUploadVo.setUploadPath(toUploadPath(savePath));
fileStorageUploadVo.setOriginalFileName(originalFileName);
fileStorageUploadVo.setStoredFileName(storedFileName);
fileStorageUploadVo.setFileExtension(extension);
fileStorageUploadVo.setContentType(multipartFile.getContentType());
fileStorageUploadVo.setFileSize(Files.size(savePath));
fileStorageUploadVo.setWidth(imageSize == null ? null : imageSize.width());
fileStorageUploadVo.setHeight(imageSize == null ? null : imageSize.height());
return fileStorageUploadVo;
} catch (IOException exception) {
throw new IllegalStateException("file save failed", exception);
}
}
public ResponseEntity<Resource> loadFileResource(String uploadPath, boolean inline) {
try {
Path filePath = resolveUploadPath(uploadPath);
if (!Files.exists(filePath) || !Files.isRegularFile(filePath)) {
return ResponseEntity.notFound().build();
}
String contentType = Files.probeContentType(filePath);
if (contentType == null || contentType.isBlank()) {
contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE;
}
ContentDisposition contentDisposition = inline
? ContentDisposition.inline().filename(filePath.getFileName().toString(), StandardCharsets.UTF_8).build()
: ContentDisposition.attachment().filename(filePath.getFileName().toString(), StandardCharsets.UTF_8).build();
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType(contentType))
.contentLength(Files.size(filePath))
.header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition.toString())
.body(new InputStreamResource(Files.newInputStream(filePath)));
} catch (IOException exception) {
throw new IllegalStateException("file read failed", exception);
}
}
public String buildFileViewUrl(String uploadPath) {
if (viewDomain == null || viewDomain.isBlank()) {
throw new IllegalStateException("file.storage.view-domain is empty");
}
String fileDomain = viewDomain.endsWith("/")
? viewDomain.substring(0, viewDomain.length() - 1)
: viewDomain;
String normalizedUploadPath = uploadPath.startsWith("/") ? uploadPath : "/" + uploadPath;
return fileDomain + normalizedUploadPath;
}
private Path resolveUploadPath(String uploadPath) {
if (uploadPath == null || uploadPath.isBlank()) {
throw new IllegalArgumentException("empty path");
}
String normalizedUploadPath = uploadPath.trim().replace("\\", "/");
if (!normalizedUploadPath.startsWith(PUBLIC_PREFIX + "/")) {
throw new IllegalArgumentException("invalid path");
}
String relativePath = normalizedUploadPath.substring((PUBLIC_PREFIX + "/").length());
if (relativePath.contains("..") || relativePath.startsWith("/") || relativePath.contains(":")) {
throw new IllegalArgumentException("invalid path");
}
Path rootPath = rootPath();
Path resolvedPath = rootPath.resolve(relativePath).normalize().toAbsolutePath();
if (!resolvedPath.startsWith(rootPath)) {
throw new IllegalArgumentException("invalid path");
}
return resolvedPath;
}
private String toUploadPath(Path savePath) {
Path rootPath = rootPath();
Path absolutePath = savePath.normalize().toAbsolutePath();
if (!absolutePath.startsWith(rootPath)) {
throw new IllegalArgumentException("invalid path");
}
return PUBLIC_PREFIX + "/" + rootPath.relativize(absolutePath).toString().replace("\\", "/");
}
private void ensureUnderRoot(Path path) {
if (!path.startsWith(rootPath())) {
throw new IllegalArgumentException("invalid save path");
}
}
private Path rootPath() {
return Paths.get(rootPath).normalize().toAbsolutePath();
}
private void validateSize(long fileSize, FileUploadProperties.UploadType uploadType) {
long maxSize = uploadType.getMaxSize() == null
? fileUploadProperties.getMaxSize().toBytes()
: uploadType.getMaxSize().toBytes();
if (fileSize > maxSize) {
throw new IllegalArgumentException("file size exceeded");
}
}
private void validateExtension(String extension) {
if (extension.isBlank() || fileUploadProperties.getAllowedExtensions().stream().noneMatch(extension::equalsIgnoreCase)) {
throw new IllegalArgumentException("invalid extension");
}
}
private String cleanFileName(String fileName) {
if (fileName == null || fileName.isBlank()) {
throw new IllegalArgumentException("empty file name");
}
return Paths.get(fileName).getFileName().toString();
}
private String extractExtension(String fileName) {
int extensionIndex = fileName.lastIndexOf('.');
if (extensionIndex < 0 || extensionIndex == fileName.length() - 1) {
return "";
}
return fileName.substring(extensionIndex + 1).trim().toLowerCase(Locale.ROOT);
}
private boolean isImageExtension(String extension) {
return "jpg".equals(extension)
|| "jpeg".equals(extension)
|| "png".equals(extension)
|| "gif".equals(extension);
}
private FileUploadProperties.UploadType resolveUploadType(String folder) {
String normalizedFolder = normalizeFolder(folder);
FileUploadProperties.UploadType uploadType = fileUploadProperties.getTypes() == null
? null
: fileUploadProperties.getTypes().get(normalizedFolder);
if (uploadType != null) {
uploadType.setFolder(normalizeFolder(uploadType.getFolder()));
return uploadType;
}
FileUploadProperties.UploadType fallbackUploadType = new FileUploadProperties.UploadType();
fallbackUploadType.setFolder(normalizedFolder);
fallbackUploadType.setMaxSize(null);
fallbackUploadType.setImageOnly(false);
fallbackUploadType.setResize(new FileUploadProperties.Resize());
fallbackUploadType.getResize().setEnabled(false);
return fallbackUploadType;
}
private String normalizeFolder(String folder) {
if (folder == null || folder.isBlank()) {
throw new IllegalArgumentException("invalid folder");
}
String normalizedFolder = folder.trim().replace("\\", "/");
while (normalizedFolder.startsWith("/")) {
normalizedFolder = normalizedFolder.substring(1);
}
while (normalizedFolder.endsWith("/")) {
normalizedFolder = normalizedFolder.substring(0, normalizedFolder.length() - 1);
}
if (normalizedFolder.isBlank()
|| normalizedFolder.contains("..")
|| normalizedFolder.contains(":")
|| normalizedFolder.startsWith("http://")
|| normalizedFolder.startsWith("https://")) {
throw new IllegalArgumentException("invalid folder");
}
if (!normalizedFolder.matches("^[a-zA-Z0-9/_-]+$")) {
throw new IllegalArgumentException("invalid folder");
}
return normalizedFolder;
}
}
@@ -0,0 +1,17 @@
package com.alist.api.core.common.file.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileStorageUploadVo {
private String uploadPath;
private String originalFileName;
private String storedFileName;
private String fileExtension;
private String contentType;
private Long fileSize;
private Integer width;
private Integer height;
}
@@ -1,7 +1,7 @@
package com.alist.api.config.jwt; package com.alist.api.core.common.jwt;
import com.alist.api.common.response.ApiResponse; import com.alist.api.core.common.response.ApiResponse;
import com.alist.api.common.response.ApiResponseCode; import com.alist.api.core.common.response.ApiResponseCode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
@@ -1,7 +1,7 @@
package com.alist.api.config.jwt; package com.alist.api.core.common.jwt;
import com.alist.api.common.response.ApiResponse; import com.alist.api.core.common.response.ApiResponse;
import com.alist.api.common.response.ApiResponseCode; import com.alist.api.core.common.response.ApiResponseCode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
@@ -0,0 +1,101 @@
package com.alist.api.core.common.jwt;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpHeaders;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
import java.util.List;
public class JwtAuthenticationFilter extends OncePerRequestFilter {
private final JwtTokenProvider jwtTokenProvider;
private final String requiredScope;
private final String accessTokenCookieName;
public JwtAuthenticationFilter(
JwtTokenProvider jwtTokenProvider,
String requiredScope,
String accessTokenCookieName
) {
this.jwtTokenProvider = jwtTokenProvider;
this.requiredScope = requiredScope;
this.accessTokenCookieName = accessTokenCookieName;
}
@Override
protected void doFilterInternal(
HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain
) throws ServletException, IOException {
try {
String token = resolveToken(request);
if (token != null && jwtTokenProvider.validateToken(token)) {
String principal = jwtTokenProvider.getUserTokenIdx(token);
String role = jwtTokenProvider.getRole(token);
String scope = jwtTokenProvider.getScope(token);
String tokenType = jwtTokenProvider.getTokenType(token);
boolean authenticatable =
requiredScope.equals(scope)
&& role != null
&& "ACCESS".equals(tokenType);
if (authenticatable) {
UsernamePasswordAuthenticationToken authentication =
new UsernamePasswordAuthenticationToken(
principal,
null,
List.of(new SimpleGrantedAuthority("ROLE_" + role))
);
authentication.setDetails(
new WebAuthenticationDetailsSource().buildDetails(request)
);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
} catch (Exception e) {
SecurityContextHolder.clearContext();
}
filterChain.doFilter(request, response);
}
private String resolveToken(HttpServletRequest request) {
String bearer = request.getHeader(HttpHeaders.AUTHORIZATION);
if (bearer != null && bearer.startsWith("Bearer ")) {
String token = bearer.substring(7).trim();
if (!token.isEmpty()) {
return token;
}
}
Cookie[] cookies = request.getCookies();
if (cookies == null) {
return null;
}
for (Cookie cookie : cookies) {
if (accessTokenCookieName.equals(cookie.getName())) {
String token = cookie.getValue();
if (token != null && !token.isBlank()) {
return token.trim();
}
}
}
return null;
}
}
@@ -1,11 +1,11 @@
package com.alist.api.config.jwt; package com.alist.api.core.common.jwt;
import com.alist.api.config.properties.JwtProperties;
import io.jsonwebtoken.Claims; import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtException; import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.Jwts; import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys; import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.crypto.SecretKey; import javax.crypto.SecretKey;
@@ -15,25 +15,32 @@ import java.util.Date;
@Component @Component
public class JwtTokenProvider { public class JwtTokenProvider {
private final JwtProperties jwtProperties;
private final SecretKey secretKey; private final SecretKey secretKey;
private final long accessTokenValiditySeconds;
private final long refreshTokenValiditySeconds;
public JwtTokenProvider(JwtProperties jwtProperties) { public JwtTokenProvider(
this.jwtProperties = jwtProperties; @Value("${jwt.secret}") String secret,
this.secretKey = Keys.hmacShaKeyFor( @Value("${jwt.access-token-validity-seconds}") long accessTokenValiditySeconds,
jwtProperties.getSecret().getBytes(StandardCharsets.UTF_8) @Value("${jwt.refresh-token-validity-seconds}") long refreshTokenValiditySeconds
); ) {
this.secretKey = Keys.hmacShaKeyFor(secret.getBytes(StandardCharsets.UTF_8));
this.accessTokenValiditySeconds = accessTokenValiditySeconds;
this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
} }
/** 토큰생성 **/ /** 토큰생성 **/
public String createToken(String userId) { public String createToken(String userId) {
Date now = new Date(); Date now = new Date();
Date expiry = new Date( Date expiry = new Date(
now.getTime() + jwtProperties.getAccessTokenValiditySeconds() * 1000 now.getTime() + accessTokenValiditySeconds * 1000
); );
return Jwts.builder() return Jwts.builder()
.setSubject(userId) .setSubject(userId)
.claim("role", "TEST")
.claim("scope", "USER")
.claim("tokenType", "ACCESS")
.setIssuedAt(now) .setIssuedAt(now)
.setExpiration(expiry) .setExpiration(expiry)
.signWith(secretKey, SignatureAlgorithm.HS256) .signWith(secretKey, SignatureAlgorithm.HS256)
@@ -43,11 +50,13 @@ public class JwtTokenProvider {
/* 엑세스 토큰 생성 */ /* 엑세스 토큰 생성 */
public String createAccessToken(Integer userTokenIdx, String role) { public String createAccessToken(Integer userTokenIdx, String role) {
Instant now = Instant.now(); Instant now = Instant.now();
Instant expiry = now.plusSeconds(jwtProperties.getAccessTokenValiditySeconds()); Instant expiry = now.plusSeconds(accessTokenValiditySeconds);
return Jwts.builder() return Jwts.builder()
.setSubject(String.valueOf(userTokenIdx)) .setSubject(String.valueOf(userTokenIdx))
.claim("role", role) .claim("role", role)
.claim("scope", "USER")
.claim("tokenType", "ACCESS")
.setIssuedAt(Date.from(now)) .setIssuedAt(Date.from(now))
.setExpiration(Date.from(expiry)) .setExpiration(Date.from(expiry))
.signWith(secretKey, SignatureAlgorithm.HS256) .signWith(secretKey, SignatureAlgorithm.HS256)
@@ -57,10 +66,12 @@ public class JwtTokenProvider {
/* 리프레시 토큰 생성 */ /* 리프레시 토큰 생성 */
public String createRefreshToken(Integer userTokenIdx) { public String createRefreshToken(Integer userTokenIdx) {
Instant now = Instant.now(); Instant now = Instant.now();
Instant expiry = now.plusSeconds(jwtProperties.getRefreshTokenValiditySeconds()); Instant expiry = now.plusSeconds(refreshTokenValiditySeconds);
return Jwts.builder() return Jwts.builder()
.setSubject(String.valueOf(userTokenIdx)) .setSubject(String.valueOf(userTokenIdx))
.claim("scope", "USER")
.claim("tokenType", "REFRESH")
.setIssuedAt(Date.from(now)) .setIssuedAt(Date.from(now))
.setExpiration(Date.from(expiry)) .setExpiration(Date.from(expiry))
.signWith(secretKey, SignatureAlgorithm.HS256) .signWith(secretKey, SignatureAlgorithm.HS256)
@@ -90,7 +101,6 @@ public class JwtTokenProvider {
.getBody(); .getBody();
} }
/* 업로드 전용 토큰*/ /* 업로드 전용 토큰*/
public String createUploadToken(long userTokenIdx) { public String createUploadToken(long userTokenIdx) {
Instant now = Instant.now(); Instant now = Instant.now();
@@ -114,4 +124,49 @@ public class JwtTokenProvider {
} }
} }
public String createAdminAccessToken(long userTokenIdx) {
Instant now = Instant.now();
Instant expiry = now.plusSeconds(accessTokenValiditySeconds);
return Jwts.builder()
.setSubject(String.valueOf(userTokenIdx))
.claim("role", "ADMIN")
.claim("scope", "ADMIN")
.claim("tokenType", "ACCESS")
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(expiry))
.signWith(secretKey, SignatureAlgorithm.HS256)
.compact();
}
public String createAdminRefreshToken(long userTokenIdx) {
Instant now = Instant.now();
Instant expiry = now.plusSeconds(refreshTokenValiditySeconds);
return Jwts.builder()
.setSubject(String.valueOf(userTokenIdx))
.claim("role", "ADMIN")
.claim("scope", "ADMIN")
.claim("tokenType", "REFRESH")
.setIssuedAt(Date.from(now))
.setExpiration(Date.from(expiry))
.signWith(secretKey, SignatureAlgorithm.HS256)
.compact();
}
public Claims getClaims(String token) {
return parseClaims(token);
}
public String getRole(String token) {
return parseClaims(token).get("role", String.class);
}
public String getScope(String token) {
return parseClaims(token).get("scope", String.class);
}
public String getTokenType(String token) {
return parseClaims(token).get("tokenType", String.class);
}
} }
@@ -0,0 +1,32 @@
package com.alist.api.core.common.paging;
import com.alist.api.core.common.utils.PagingUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Setter;
@Setter
public class PagingRequest {
@Schema(description = "페이지 번호", example = "1")
private Integer page;
@Schema(description = "페이지 크기", example = "20")
private Integer size;
public Integer getPage() {
return PagingUtil.getPage(page);
}
public Integer getSize() {
return PagingUtil.getSize(size);
}
@Schema(hidden = true)
public Integer getLimit() {
return PagingUtil.getLimit(size);
}
@Schema(hidden = true)
public Integer getOffset() {
return PagingUtil.getOffset(page, size);
}
}
@@ -0,0 +1,36 @@
package com.alist.api.core.common.paging;
import com.alist.api.core.common.utils.PagingUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PagingResponse {
@Schema(description = "현재 페이지 번호", example = "1")
private int page;
@Schema(description = "페이지당 조회 개수", example = "20")
private int size;
@Schema(description = "전체 데이터 개수", example = "100")
private int totalCount;
@Schema(description = "전체 페이지 수", example = "5")
private int totalPage;
@Schema(
description = "현재 페이지 첫 번째 row 번호. 각 row 번호는 rowStartNum - memberList index로 계산합니다.",
example = "100"
)
private int rowStartNum;
public void setPaging(PagingRequest pagingRequest, int totalCount) {
this.page = pagingRequest.getPage();
this.size = pagingRequest.getSize();
this.totalCount = totalCount;
this.totalPage = PagingUtil.getTotalPage(totalCount, pagingRequest.getSize());
this.rowStartNum = PagingUtil.getRowStartNum(totalCount, pagingRequest.getPage(), pagingRequest.getSize());
}
}
@@ -1,4 +1,4 @@
package com.alist.api.common.response; package com.alist.api.core.common.response;
import lombok.Getter; import lombok.Getter;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@@ -1,4 +1,4 @@
package com.alist.api.common.response; package com.alist.api.core.common.response;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -1,4 +1,4 @@
package com.alist.api.common.utils; package com.alist.api.core.common.utils;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.Base64; import java.util.Base64;
@@ -1,4 +1,4 @@
package com.alist.api.common.utils; package com.alist.api.core.common.utils;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
@@ -0,0 +1,44 @@
package com.alist.api.core.common.utils;
public final class PagingUtil {
private static final int DEFAULT_PAGE = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private PagingUtil() {
}
public static int getPage(Integer page) {
return page == null || page < 1 ? DEFAULT_PAGE : page;
}
public static int getSize(Integer size) {
if (size == null || size < 1) {
return DEFAULT_SIZE;
}
return Math.min(size, MAX_SIZE);
}
public static int getLimit(Integer size) {
return getSize(size);
}
public static int getOffset(Integer page, Integer size) {
return (getPage(page) - 1) * getSize(size);
}
public static int getTotalPage(int totalCount, Integer size) {
return totalCount <= 0 ? 0 : (int) Math.ceil((double) totalCount / getSize(size));
}
public static int getRowStartNum(int totalCount, Integer page, Integer size) {
if (totalCount <= 0) {
return 0;
}
int offset = getOffset(page, size);
int rowStartNum = totalCount - offset;
return Math.max(rowStartNum, 0);
}
}
@@ -1,4 +1,4 @@
package com.alist.api.common.utils; package com.alist.api.core.common.utils;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
@@ -1,4 +1,4 @@
package com.alist.api.common.utils; package com.alist.api.core.common.utils;
import jakarta.servlet.http.Cookie; import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@@ -0,0 +1,9 @@
package com.alist.api.core.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.alist.api.core")
public class ApiCoreConfig {
}
@@ -0,0 +1,89 @@
package com.alist.api.core.config.cors;
import com.alist.api.core.modules.standard.testCorsAllowedList.service.TestCorsAllowedListService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Slf4j
@Component
public class CorsCache {
public static final String REDIS_KEY = "alist:cors:allow-origins";
private final StringRedisTemplate stringRedisTemplate;
private final ObjectMapper objectMapper;
private final TestCorsAllowedListService testCorsAllowedListService;
private volatile List<String> allowedOriginList = List.of();
public CorsCache(StringRedisTemplate stringRedisTemplate, ObjectMapper objectMapper, TestCorsAllowedListService testCorsAllowedListService) {
this.stringRedisTemplate = stringRedisTemplate;
this.objectMapper = objectMapper;
this.testCorsAllowedListService = testCorsAllowedListService;
}
@PostConstruct
public void initialize() {
refreshFromRedis();
}
@Scheduled(fixedDelayString = "${cors.cache.redis-refresh-interval-ms:60000}")
public void refreshFromRedis() {
String allowedOriginJson = stringRedisTemplate.opsForValue().get(REDIS_KEY);
if (allowedOriginJson == null || allowedOriginJson.isBlank()) {
allowedOriginList = List.of();
return;
}
try {
List<String> redisAllowedOriginList = objectMapper.readValue(allowedOriginJson, new TypeReference<List<String>>() {
});
allowedOriginList = redisAllowedOriginList.stream()
.filter(Objects::nonNull)
.map(String::trim)
.filter(allowedOrigin -> !allowedOrigin.isEmpty())
.distinct()
.toList();
} catch (JsonProcessingException e) {
log.error("CORS Redis cache JSON parsing failed.", e);
}
}
public void syncFromDatabase() {
List<String> databaseAllowedOriginList = testCorsAllowedListService.selectTestCorsAllowedListAllowedOriginList();
List<String> allowedOriginList = new ArrayList<>();
for (String allowedOrigin : databaseAllowedOriginList) {
if (allowedOrigin != null && !allowedOrigin.isBlank()) {
allowedOriginList.add(allowedOrigin.trim());
}
}
try {
String allowedOriginJson = objectMapper.writeValueAsString(allowedOriginList);
stringRedisTemplate.opsForValue().set(REDIS_KEY, allowedOriginJson);
this.allowedOriginList = List.copyOf(allowedOriginList);
} catch (JsonProcessingException e) {
throw new IllegalStateException("CORS Redis cache JSON creation failed.", e);
}
}
public boolean isAllowed(String origin) {
return allowedOriginList.contains("*") || allowedOriginList.contains(origin);
}
public List<String> getAllowedOriginList() {
return List.copyOf(allowedOriginList);
}
}
@@ -0,0 +1,19 @@
package com.alist.api.core.config.cors;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
@Component
public class CorsCachePublisher {
public static final String CHANNEL = "alist:cors:allow-origins:changed";
private final StringRedisTemplate stringRedisTemplate;
public CorsCachePublisher(StringRedisTemplate stringRedisTemplate) {
this.stringRedisTemplate = stringRedisTemplate;
}
public void publishReload() {
stringRedisTemplate.convertAndSend(CHANNEL, "reload");
}
}
@@ -0,0 +1,4 @@
package com.alist.api.core.config.cors;
public class CorsCacheRefreshEvent {
}
@@ -0,0 +1,22 @@
package com.alist.api.core.config.cors;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;
@Component
public class CorsCacheRefreshEventListener {
private final CorsCache corsCache;
private final CorsCachePublisher corsCachePublisher;
public CorsCacheRefreshEventListener(CorsCache corsCache, CorsCachePublisher corsCachePublisher) {
this.corsCache = corsCache;
this.corsCachePublisher = corsCachePublisher;
}
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
public void refreshCorsCache(CorsCacheRefreshEvent corsCacheRefreshEvent) {
corsCache.syncFromDatabase();
corsCachePublisher.publishReload();
}
}
@@ -0,0 +1,19 @@
package com.alist.api.core.config.cors;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;
@Component
public class CorsCacheSubscriber implements MessageListener {
private final CorsCache corsCache;
public CorsCacheSubscriber(CorsCache corsCache) {
this.corsCache = corsCache;
}
@Override
public void onMessage(Message message, byte[] pattern) {
corsCache.refreshFromRedis();
}
}
@@ -0,0 +1,21 @@
package com.alist.api.core.config.cors;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@EnableScheduling
public class CorsRedisConfig {
@Bean
public RedisMessageListenerContainer corsRedisMessageListenerContainer(RedisConnectionFactory redisConnectionFactory, CorsCacheSubscriber corsCacheSubscriber) {
RedisMessageListenerContainer redisMessageListenerContainer = new RedisMessageListenerContainer();
redisMessageListenerContainer.setConnectionFactory(redisConnectionFactory);
redisMessageListenerContainer.addMessageListener(corsCacheSubscriber, new ChannelTopic(CorsCachePublisher.CHANNEL));
return redisMessageListenerContainer;
}
}
@@ -1,4 +1,4 @@
package com.alist.api.config.migration; package com.alist.api.core.config.datasource;
import javax.sql.DataSource; import javax.sql.DataSource;
@@ -8,6 +8,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -16,8 +17,13 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
@Configuration @Configuration
@ConditionalOnProperty(
prefix = "migration.datasource.alist"
, name = "enabled"
, havingValue = "true"
)
@MapperScan( @MapperScan(
basePackages = "com.alist.api.modules.migration.alist", basePackages = "com.alist.api.core.modules.migration.alist",
sqlSessionFactoryRef = "migrationAlistSqlSessionFactory" sqlSessionFactoryRef = "migrationAlistSqlSessionFactory"
) )
public class AlistDataSourceConfig { public class AlistDataSourceConfig {
@@ -36,11 +42,11 @@ public class AlistDataSourceConfig {
) throws Exception { ) throws Exception {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean(); SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
factoryBean.setDataSource(migrationAlistDataSource); factoryBean.setDataSource(migrationAlistDataSource);
factoryBean.setTypeAliasesPackage("com.alist.api.modules.migration.alist"); factoryBean.setTypeAliasesPackage("com.alist.api.core.modules.migration.alist");
factoryBean.setConfiguration(mybatisConfiguration()); factoryBean.setConfiguration(mybatisConfiguration());
factoryBean.setMapperLocations( factoryBean.setMapperLocations(
new PathMatchingResourcePatternResolver() new PathMatchingResourcePatternResolver()
.getResources("classpath:mapper/migration/alist/**/*.xml") .getResources("classpath*:mapper/migration/alist/**/*.xml")
); );
return factoryBean.getObject(); return factoryBean.getObject();
} }
@@ -1,4 +1,4 @@
package com.alist.api.config.migration; package com.alist.api.core.config.datasource;
import javax.sql.DataSource; import javax.sql.DataSource;
@@ -8,6 +8,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -16,8 +17,13 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
@Configuration @Configuration
@ConditionalOnProperty(
prefix = "migration.datasource.eltown"
, name = "enabled"
, havingValue = "true"
)
@MapperScan( @MapperScan(
basePackages = "com.alist.api.modules.migration.eltown", basePackages = "com.alist.api.core.modules.migration.eltown",
sqlSessionFactoryRef = "migrationEltownSqlSessionFactory" sqlSessionFactoryRef = "migrationEltownSqlSessionFactory"
) )
public class EltownDataSourceConfig { public class EltownDataSourceConfig {
@@ -36,11 +42,11 @@ public class EltownDataSourceConfig {
) throws Exception { ) throws Exception {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean(); SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
factoryBean.setDataSource(migrationEltownDataSource); factoryBean.setDataSource(migrationEltownDataSource);
factoryBean.setTypeAliasesPackage("com.alist.api.modules.migration.eltown"); factoryBean.setTypeAliasesPackage("com.alist.api.core.modules.migration.eltown");
factoryBean.setConfiguration(mybatisConfiguration()); factoryBean.setConfiguration(mybatisConfiguration());
factoryBean.setMapperLocations( factoryBean.setMapperLocations(
new PathMatchingResourcePatternResolver() new PathMatchingResourcePatternResolver()
.getResources("classpath:mapper/migration/eltown/**/*.xml") .getResources("classpath*:mapper/migration/eltown/**/*.xml")
); );
return factoryBean.getObject(); return factoryBean.getObject();
} }
@@ -1,4 +1,4 @@
package com.alist.api.config; package com.alist.api.core.config.datasource;
import javax.sql.DataSource; import javax.sql.DataSource;
@@ -14,12 +14,19 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import java.util.Arrays;
import java.util.stream.Stream;
@Configuration @Configuration
@MapperScan( @MapperScan(
basePackages = "com.alist.api.modules", basePackages = {
"com.alist.api.core.modules.standard",
"com.alist.api.core.modules.bespoke"
},
annotationClass = Mapper.class, annotationClass = Mapper.class,
sqlSessionFactoryRef = "mainSqlSessionFactory" sqlSessionFactoryRef = "mainSqlSessionFactory"
) )
@@ -49,12 +56,21 @@ public class MainDataSourceConfig {
) throws Exception { ) throws Exception {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean(); SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
factoryBean.setDataSource(mainDataSource); factoryBean.setDataSource(mainDataSource);
factoryBean.setTypeAliasesPackage("com.alist.api"); factoryBean.setTypeAliasesPackage("com.alist.api.core");
factoryBean.setConfiguration(mybatisConfiguration()); factoryBean.setConfiguration(mybatisConfiguration());
factoryBean.setMapperLocations(
new PathMatchingResourcePatternResolver() PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
.getResources("classpath:mapper/*/*.xml")
); Resource[] standardMappers = resolver.getResources("classpath*:mapper/standard/**/*.xml");
Resource[] bespokeMappers = resolver.getResources("classpath*:mapper/bespoke/**/*.xml");
Resource[] mapperLocations = Stream.of(
Arrays.stream(standardMappers)
, Arrays.stream(bespokeMappers)
).flatMap(stream -> stream).toArray(Resource[]::new);
factoryBean.setMapperLocations(mapperLocations);
return factoryBean.getObject(); return factoryBean.getObject();
} }
@@ -0,0 +1,9 @@
package com.alist.api.core.config.file;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(FileUploadProperties.class)
public class FileUploadConfig {
}
@@ -0,0 +1,38 @@
package com.alist.api.core.config.file;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@ConfigurationProperties(prefix = "file.upload")
public class FileUploadProperties {
private DataSize maxSize;
private List<String> allowedExtensions;
private Map<String, UploadType> types;
@Getter
@Setter
public static class UploadType {
private String folder;
private DataSize maxSize;
private boolean imageOnly;
private Resize resize = new Resize();
}
@Getter
@Setter
public static class Resize {
private boolean enabled;
private Integer width;
private Integer height;
private Integer maxWidth;
private Float quality = 0.9f;
}
}
@@ -0,0 +1,44 @@
package com.alist.api.core.config.filter;
import com.alist.api.core.config.cors.CorsCache;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class DynamicCorsFilter extends OncePerRequestFilter {
private final CorsCache corsCache;
public DynamicCorsFilter(CorsCache corsCache) {
this.corsCache = corsCache;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
String origin = request.getHeader("Origin");
if (origin != null && corsCache.isAllowed(origin)) {
response.setHeader("Access-Control-Allow-Origin", origin);
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, PATCH, OPTIONS");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With, Accept, Origin, Referer, Content-Disposition, Content-Length");
response.setHeader("Access-Control-Expose-Headers", "Authorization, Set-Cookie");
response.setHeader("Access-Control-Max-Age", "3600");
}
if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
response.setStatus(HttpServletResponse.SC_OK);
return;
}
filterChain.doFilter(request, response);
}
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.fileDetail.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileDetailTusFileAuthDto {
private Integer userTokenIdx;
private String fileUuid;
private String originName;
private Long sizeBytes;
private String contentType;
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.bespoke.fileDetail.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileDetailTusFileListDto {
private Long fileMasterIdx;
private Integer userTokenIdx;
}
@@ -1,11 +1,11 @@
package com.alist.api.modules.file.dto; package com.alist.api.core.modules.bespoke.fileDetail.dto;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class FileDeleteDto { public class FileDetailTusFileViewDto {
private Integer userTokenIdx;
private String fileUuid; private String fileUuid;
private Integer userTokenIdx;
} }
@@ -0,0 +1,27 @@
package com.alist.api.core.modules.bespoke.fileDetail.mapper;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileAuthDto;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileListDto;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileViewDto;
import com.alist.api.core.modules.bespoke.fileDetail.vo.FileDetailTusFileListItemVo;
import com.alist.api.core.modules.bespoke.fileDetail.vo.FileDetailTusFileViewVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface FileDetailTusFileMapper {
int fileDetailTusFileUploadAuthCount(FileDetailTusFileAuthDto fileDetailTusFileAuthDto);
FileDetailTusFileViewVo fileDetailTusFileMetaView(FileDetailTusFileViewDto fileDetailTusFileViewDto);
FileDetailTusFileViewVo fileDetailTusFileMoveView(FileDetailTusFileViewDto fileDetailTusFileViewDto);
FileDetailTusFileViewVo fileDetailTusFileUploadCancelView(FileDetailTusFileViewDto fileDetailTusFileViewDto);
List<FileDetailTusFileListItemVo> fileDetailTusFileList(FileDetailTusFileListDto fileDetailTusFileListDto);
FileDetailTusFileViewVo fileDetailTusFileView(FileDetailTusFileViewDto fileDetailTusFileViewDto);
FileDetailTusFileViewVo fileDetailTusFileDeleteView(FileDetailTusFileViewDto fileDetailTusFileViewDto);
}
@@ -0,0 +1,56 @@
package com.alist.api.core.modules.bespoke.fileDetail.service;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileAuthDto;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileListDto;
import com.alist.api.core.modules.bespoke.fileDetail.dto.FileDetailTusFileViewDto;
import com.alist.api.core.modules.bespoke.fileDetail.mapper.FileDetailTusFileMapper;
import com.alist.api.core.modules.bespoke.fileDetail.vo.FileDetailTusFileListItemVo;
import com.alist.api.core.modules.bespoke.fileDetail.vo.FileDetailTusFileViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class FileDetailTusFileService {
private final FileDetailTusFileMapper fileDetailTusFileMapper;
public FileDetailTusFileService(FileDetailTusFileMapper fileDetailTusFileMapper) {
this.fileDetailTusFileMapper = fileDetailTusFileMapper;
}
@Transactional(readOnly = true)
public int fileDetailTusFileUploadAuthCount(FileDetailTusFileAuthDto fileDetailTusFileAuthDto) {
return fileDetailTusFileMapper.fileDetailTusFileUploadAuthCount(fileDetailTusFileAuthDto);
}
@Transactional(readOnly = true)
public FileDetailTusFileViewVo fileDetailTusFileMetaView(FileDetailTusFileViewDto fileDetailTusFileViewDto) {
return fileDetailTusFileMapper.fileDetailTusFileMetaView(fileDetailTusFileViewDto);
}
@Transactional(readOnly = true)
public FileDetailTusFileViewVo fileDetailTusFileMoveView(FileDetailTusFileViewDto fileDetailTusFileViewDto) {
return fileDetailTusFileMapper.fileDetailTusFileMoveView(fileDetailTusFileViewDto);
}
@Transactional(readOnly = true)
public FileDetailTusFileViewVo fileDetailTusFileUploadCancelView(FileDetailTusFileViewDto fileDetailTusFileViewDto) {
return fileDetailTusFileMapper.fileDetailTusFileUploadCancelView(fileDetailTusFileViewDto);
}
@Transactional(readOnly = true)
public List<FileDetailTusFileListItemVo> fileDetailTusFileList(FileDetailTusFileListDto fileDetailTusFileListDto) {
return fileDetailTusFileMapper.fileDetailTusFileList(fileDetailTusFileListDto);
}
@Transactional(readOnly = true)
public FileDetailTusFileViewVo fileDetailTusFileView(FileDetailTusFileViewDto fileDetailTusFileViewDto) {
return fileDetailTusFileMapper.fileDetailTusFileView(fileDetailTusFileViewDto);
}
@Transactional(readOnly = true)
public FileDetailTusFileViewVo fileDetailTusFileDeleteView(FileDetailTusFileViewDto fileDetailTusFileViewDto) {
return fileDetailTusFileMapper.fileDetailTusFileDeleteView(fileDetailTusFileViewDto);
}
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.fileDetail.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileDetailTusFileListItemVo {
private Long fileDetailIdx;
private Long fileMasterIdx;
private String fileUuid;
private String originName;
private String contentType;
private Long sizeBytes;
}
@@ -0,0 +1,25 @@
package com.alist.api.core.modules.bespoke.fileDetail.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileDetailTusFileViewVo {
private Long fileDetailIdx;
private Long fileMasterIdx;
private String fileUuid;
private String originName;
private String contentType;
private Long sizeBytes;
private Long uploadedBytes;
private String tusUploadId;
private String folderPath;
private String saveName;
private String savePath;
private String ext;
private String moveYn;
private Integer moveTryCount;
private Integer status;
private Integer userIdx;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.fileMaster.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileMasterTusFileModifyDto {
private String fileUuid;
}
@@ -0,0 +1,9 @@
package com.alist.api.core.modules.bespoke.fileMaster.mapper;
import com.alist.api.core.modules.bespoke.fileMaster.dto.FileMasterTusFileModifyDto;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FileMasterTusFileMapper {
int fileMasterTusFileAggregateModify(FileMasterTusFileModifyDto fileMasterTusFileModifyDto);
}
@@ -0,0 +1,20 @@
package com.alist.api.core.modules.bespoke.fileMaster.service;
import com.alist.api.core.modules.bespoke.fileMaster.dto.FileMasterTusFileModifyDto;
import com.alist.api.core.modules.bespoke.fileMaster.mapper.FileMasterTusFileMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class FileMasterTusFileService {
private final FileMasterTusFileMapper fileMasterTusFileMapper;
public FileMasterTusFileService(FileMasterTusFileMapper fileMasterTusFileMapper) {
this.fileMasterTusFileMapper = fileMasterTusFileMapper;
}
@Transactional
public int fileMasterTusFileAggregateModify(FileMasterTusFileModifyDto fileMasterTusFileModifyDto) {
return fileMasterTusFileMapper.fileMasterTusFileAggregateModify(fileMasterTusFileModifyDto);
}
}
@@ -0,0 +1,16 @@
package com.alist.api.core.modules.bespoke.notice.dto;
import com.alist.api.core.common.paging.PagingRequest;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class NoticeNoticeListDto extends PagingRequest {
private String keyword;
private String noticeType;
private String targetScope;
private Long campusIdx;
private String pinYn;
private String useYn;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.notice.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class NoticeNoticeViewDto {
private Long noticeIdx;
}
@@ -0,0 +1,23 @@
package com.alist.api.core.modules.bespoke.notice.mapper;
import com.alist.api.core.modules.bespoke.notice.dto.NoticeNoticeListDto;
import com.alist.api.core.modules.bespoke.notice.dto.NoticeNoticeViewDto;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeCampusListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeFileListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeViewVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface NoticeNoticeMapper {
int noticeNoticeListCount(NoticeNoticeListDto noticeNoticeListDto);
List<NoticeNoticeListItemVo> noticeNoticeList(NoticeNoticeListDto noticeNoticeListDto);
NoticeNoticeViewVo noticeNoticeView(NoticeNoticeViewDto noticeNoticeViewDto);
List<NoticeNoticeCampusListItemVo> noticeNoticeCampusList(NoticeNoticeViewDto noticeNoticeViewDto);
List<NoticeNoticeFileListItemVo> noticeNoticeFileList(NoticeNoticeViewDto noticeNoticeViewDto);
}
@@ -0,0 +1,46 @@
package com.alist.api.core.modules.bespoke.notice.service;
import com.alist.api.core.modules.bespoke.notice.dto.NoticeNoticeListDto;
import com.alist.api.core.modules.bespoke.notice.dto.NoticeNoticeViewDto;
import com.alist.api.core.modules.bespoke.notice.mapper.NoticeNoticeMapper;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeCampusListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeFileListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeListItemVo;
import com.alist.api.core.modules.bespoke.notice.vo.NoticeNoticeViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class NoticeNoticeService {
private final NoticeNoticeMapper noticeNoticeMapper;
public NoticeNoticeService(NoticeNoticeMapper noticeNoticeMapper) {
this.noticeNoticeMapper = noticeNoticeMapper;
}
@Transactional(readOnly = true)
public int noticeNoticeListCount(NoticeNoticeListDto noticeNoticeListDto) {
return noticeNoticeMapper.noticeNoticeListCount(noticeNoticeListDto);
}
@Transactional(readOnly = true)
public List<NoticeNoticeListItemVo> noticeNoticeList(NoticeNoticeListDto noticeNoticeListDto) {
return noticeNoticeMapper.noticeNoticeList(noticeNoticeListDto);
}
@Transactional(readOnly = true)
public NoticeNoticeViewVo noticeNoticeView(NoticeNoticeViewDto noticeNoticeViewDto) {
return noticeNoticeMapper.noticeNoticeView(noticeNoticeViewDto);
}
@Transactional(readOnly = true)
public List<NoticeNoticeCampusListItemVo> noticeNoticeCampusList(NoticeNoticeViewDto noticeNoticeViewDto) {
return noticeNoticeMapper.noticeNoticeCampusList(noticeNoticeViewDto);
}
@Transactional(readOnly = true)
public List<NoticeNoticeFileListItemVo> noticeNoticeFileList(NoticeNoticeViewDto noticeNoticeViewDto) {
return noticeNoticeMapper.noticeNoticeFileList(noticeNoticeViewDto);
}
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.bespoke.notice.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class NoticeNoticeCampusListItemVo {
private Long noticeCampusIdx;
private Long campusIdx;
}
@@ -0,0 +1,19 @@
package com.alist.api.core.modules.bespoke.notice.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class NoticeNoticeFileListItemVo {
private Long noticeFileIdx;
private Long noticeIdx;
private String fileOriginalName;
private String fileSaveName;
private String filePath;
private Long fileSize;
private String fileExt;
private Integer sortOrder;
private LocalDateTime createDate;
}
@@ -0,0 +1,21 @@
package com.alist.api.core.modules.bespoke.notice.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class NoticeNoticeListItemVo {
private Long noticeIdx;
private String noticeType;
private String targetScope;
private String title;
private String pinYn;
private LocalDateTime startDate;
private LocalDateTime endDate;
private Integer viewCount;
private String useYn;
private LocalDateTime createDate;
private LocalDateTime updateDate;
}
@@ -0,0 +1,24 @@
package com.alist.api.core.modules.bespoke.notice.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class NoticeNoticeViewVo {
private Long noticeIdx;
private String noticeType;
private String targetScope;
private String title;
private String content;
private String pinYn;
private LocalDateTime startDate;
private LocalDateTime endDate;
private Integer viewCount;
private String useYn;
private LocalDateTime createDate;
private Long createMember;
private LocalDateTime updateDate;
private Long updateMember;
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import com.alist.api.core.common.paging.PagingRequest;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserAdminMemberListDto extends PagingRequest {
private String keyword;
private String userRole;
private String userType;
private String dormantYn;
private String withdrawStatus;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserAdminMemberViewDto {
private Integer userIdx;
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserLoginViewDto {
private String id;
private String userType;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserSsoLoginViewDto {
private String id;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserUserPasswordViewDto {
private Integer userTokenIdx;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserUserProfileViewDto {
private Integer userTokenIdx;
}
@@ -0,0 +1,18 @@
package com.alist.api.core.modules.bespoke.testUser.mapper;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserAdminMemberListDto;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserAdminMemberViewDto;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserAdminMemberListItemVo;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserAdminMemberViewVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface TestUserAdminMemberMapper {
int testUserAdminMemberCount(TestUserAdminMemberListDto testUserAdminMemberListDto);
List<TestUserAdminMemberListItemVo> testUserAdminMemberList(TestUserAdminMemberListDto testUserAdminMemberListDto);
TestUserAdminMemberViewVo testUserAdminMemberView(TestUserAdminMemberViewDto testUserAdminMemberViewDto);
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.mapper;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserLoginViewDto;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserLoginViewVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TestUserAuthMapper {
TestUserLoginViewVo testUserLoginView(TestUserLoginViewDto testUserLoginViewDto);
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.bespoke.testUser.mapper;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserSsoLoginViewDto;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserSsoLoginViewVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TestUserSsoMapper {
TestUserSsoLoginViewVo testUserSsoLoginView(TestUserSsoLoginViewDto testUserSsoLoginViewDto);
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.testUser.mapper;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserUserPasswordViewDto;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserUserProfileViewDto;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserUserPasswordViewVo;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserUserProfileViewVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TestUserUserMapper {
TestUserUserPasswordViewVo testUserUserPasswordView(TestUserUserPasswordViewDto testUserUserPasswordViewDto);
TestUserUserProfileViewVo testUserUserProfileView(TestUserUserProfileViewDto testUserUserProfileViewDto);
}
@@ -0,0 +1,34 @@
package com.alist.api.core.modules.bespoke.testUser.service;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserAdminMemberListDto;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserAdminMemberViewDto;
import com.alist.api.core.modules.bespoke.testUser.mapper.TestUserAdminMemberMapper;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserAdminMemberListItemVo;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserAdminMemberViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class TestUserAdminMemberService {
private final TestUserAdminMemberMapper testUserBackOfficeMapper;
public TestUserAdminMemberService(TestUserAdminMemberMapper testUserBackOfficeMapper) {
this.testUserBackOfficeMapper = testUserBackOfficeMapper;
}
@Transactional(readOnly = true)
public int testUserAdminMemberCount(TestUserAdminMemberListDto testUserAdminMemberListDto) {
return testUserBackOfficeMapper.testUserAdminMemberCount(testUserAdminMemberListDto);
}
@Transactional(readOnly = true)
public List<TestUserAdminMemberListItemVo> testUserAdminMemberList(TestUserAdminMemberListDto testUserAdminMemberListDto) {
return testUserBackOfficeMapper.testUserAdminMemberList(testUserAdminMemberListDto);
}
@Transactional(readOnly = true)
public TestUserAdminMemberViewVo testUserAdminMemberView(TestUserAdminMemberViewDto testUserAdminMemberViewDto) {
return testUserBackOfficeMapper.testUserAdminMemberView(testUserAdminMemberViewDto);
}
}
@@ -0,0 +1,21 @@
package com.alist.api.core.modules.bespoke.testUser.service;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserLoginViewDto;
import com.alist.api.core.modules.bespoke.testUser.mapper.TestUserAuthMapper;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserLoginViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class TestUserAuthService {
private final TestUserAuthMapper testUserAuthMapper;
public TestUserAuthService(TestUserAuthMapper testUserAuthMapper) {
this.testUserAuthMapper = testUserAuthMapper;
}
@Transactional(readOnly = true)
public TestUserLoginViewVo testUserLoginView(TestUserLoginViewDto testUserLoginViewDto) {
return testUserAuthMapper.testUserLoginView(testUserLoginViewDto);
}
}
@@ -0,0 +1,21 @@
package com.alist.api.core.modules.bespoke.testUser.service;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserSsoLoginViewDto;
import com.alist.api.core.modules.bespoke.testUser.mapper.TestUserSsoMapper;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserSsoLoginViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class TestUserSsoService {
private final TestUserSsoMapper testUserSsoMapper;
public TestUserSsoService(TestUserSsoMapper testUserSsoMapper) {
this.testUserSsoMapper = testUserSsoMapper;
}
@Transactional(readOnly = true)
public TestUserSsoLoginViewVo testUserSsoLoginView(TestUserSsoLoginViewDto testUserSsoLoginViewDto) {
return testUserSsoMapper.testUserSsoLoginView(testUserSsoLoginViewDto);
}
}
@@ -0,0 +1,28 @@
package com.alist.api.core.modules.bespoke.testUser.service;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserUserPasswordViewDto;
import com.alist.api.core.modules.bespoke.testUser.dto.TestUserUserProfileViewDto;
import com.alist.api.core.modules.bespoke.testUser.mapper.TestUserUserMapper;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserUserPasswordViewVo;
import com.alist.api.core.modules.bespoke.testUser.vo.TestUserUserProfileViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class TestUserUserService {
private final TestUserUserMapper testUserUserMapper;
public TestUserUserService(TestUserUserMapper testUserUserMapper) {
this.testUserUserMapper = testUserUserMapper;
}
@Transactional(readOnly = true)
public TestUserUserPasswordViewVo testUserUserPasswordView(TestUserUserPasswordViewDto testUserUserPasswordViewDto) {
return testUserUserMapper.testUserUserPasswordView(testUserUserPasswordViewDto);
}
@Transactional(readOnly = true)
public TestUserUserProfileViewVo testUserUserProfileView(TestUserUserProfileViewDto testUserUserProfileViewDto) {
return testUserUserMapper.testUserUserProfileView(testUserUserProfileViewDto);
}
}
@@ -0,0 +1,24 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class TestUserAdminMemberListItemVo {
private Integer userIdx;
private Integer userTokenIdx;
private String id;
private String email;
private String hp;
private String userRole;
private String userType;
private String dormantYn;
private LocalDateTime dormantAt;
private String withdrawStatus;
private LocalDateTime withdrawAt;
private LocalDateTime createAt;
private LocalDateTime updateAt;
}
@@ -0,0 +1,4 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
public class TestUserAdminMemberViewVo extends TestUserAdminMemberListItemVo {
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserLoginViewVo {
private Integer userIdx;
private String id;
private String password;
private Integer userTokenIdx;
private String userRole;
private String userType;
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserSsoLoginViewVo {
private Integer userIdx;
private Integer userTokenIdx;
private String id;
private String password;
private String userRole;
private String userType;
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserUserPasswordViewVo {
private Integer userIdx;
private String password;
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.testUser.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserUserProfileViewVo {
private Integer userIdx;
private String id;
private String email;
private String hp;
private String userRole;
private String userType;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.testUserToken.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestUserTokenApiKeyLoginViewDto {
private String userApiKey;
private String userType;
private List<String> userTypes;
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.bespoke.testUserToken.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserTokenLoginCheckedViewDto {
private Integer userTokenIdx;
private String userType;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.testUserToken.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestUserTokenRefreshViewDto {
private Integer userTokenIdx;
private String userType;
private List<String> userTypes;
}
@@ -0,0 +1,18 @@
package com.alist.api.core.modules.bespoke.testUserToken.mapper;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenApiKeyLoginViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenLoginCheckedViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenRefreshViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenApiKeyLoginViewVo;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenLoginCheckedViewVo;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenRefreshViewVo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TestUserTokenAuthMapper {
TestUserTokenApiKeyLoginViewVo testUserTokenApiKeyLoginView(TestUserTokenApiKeyLoginViewDto testUserTokenApiKeyLoginViewDto);
TestUserTokenLoginCheckedViewVo testUserTokenLoginCheckedView(TestUserTokenLoginCheckedViewDto testUserTokenLoginCheckedViewDto);
TestUserTokenRefreshViewVo testUserTokenRefreshView(TestUserTokenRefreshViewDto testUserTokenRefreshViewDto);
}
@@ -0,0 +1,35 @@
package com.alist.api.core.modules.bespoke.testUserToken.service;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenApiKeyLoginViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenLoginCheckedViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.dto.TestUserTokenRefreshViewDto;
import com.alist.api.core.modules.bespoke.testUserToken.mapper.TestUserTokenAuthMapper;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenApiKeyLoginViewVo;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenLoginCheckedViewVo;
import com.alist.api.core.modules.bespoke.testUserToken.vo.TestUserTokenRefreshViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class TestUserTokenAuthService {
private final TestUserTokenAuthMapper testUserTokenAuthMapper;
public TestUserTokenAuthService(TestUserTokenAuthMapper testUserTokenAuthMapper) {
this.testUserTokenAuthMapper = testUserTokenAuthMapper;
}
@Transactional(readOnly = true)
public TestUserTokenApiKeyLoginViewVo testUserTokenApiKeyLoginView(TestUserTokenApiKeyLoginViewDto testUserTokenApiKeyLoginViewDto) {
return testUserTokenAuthMapper.testUserTokenApiKeyLoginView(testUserTokenApiKeyLoginViewDto);
}
@Transactional(readOnly = true)
public TestUserTokenLoginCheckedViewVo testUserTokenLoginCheckedView(TestUserTokenLoginCheckedViewDto testUserTokenLoginCheckedViewDto) {
return testUserTokenAuthMapper.testUserTokenLoginCheckedView(testUserTokenLoginCheckedViewDto);
}
@Transactional(readOnly = true)
public TestUserTokenRefreshViewVo testUserTokenRefreshView(TestUserTokenRefreshViewDto testUserTokenRefreshViewDto) {
return testUserTokenAuthMapper.testUserTokenRefreshView(testUserTokenRefreshViewDto);
}
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.testUserToken.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserTokenApiKeyLoginViewVo {
private Integer userIdx;
private String id;
private Integer userTokenIdx;
private String userRole;
private String userType;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.bespoke.testUserToken.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserTokenLoginCheckedViewVo {
private Integer userIdx;
private String id;
private Integer userTokenIdx;
private String userRole;
private String userType;
}
@@ -0,0 +1,15 @@
package com.alist.api.core.modules.bespoke.testUserToken.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestUserTokenRefreshViewVo {
private Integer userIdx;
private String id;
private Integer userTokenIdx;
private String refreshToken;
private String userRole;
private String userType;
}
@@ -1,11 +1,11 @@
package com.alist.api.modules.migration.alist.user.dto; package com.alist.api.core.modules.migration.alist.user.dto;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class AlistUserDto { public class AlistUserMigrationDto {
private String id; private String id;
private String password; private String password;
} }
@@ -0,0 +1,12 @@
package com.alist.api.core.modules.migration.alist.user.mapper;
import com.alist.api.core.modules.migration.alist.user.dto.AlistUserMigrationDto;
import com.alist.api.core.modules.migration.alist.user.vo.AlistUserMigrationVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AlistUserMigrationMapper {
List<AlistUserMigrationVo> selectAlistUserMigrationList(AlistUserMigrationDto alistUserMigrationDto);
}
@@ -0,0 +1,27 @@
package com.alist.api.core.modules.migration.alist.user.service;
import com.alist.api.core.modules.migration.alist.user.dto.AlistUserMigrationDto;
import com.alist.api.core.modules.migration.alist.user.mapper.AlistUserMigrationMapper;
import com.alist.api.core.modules.migration.alist.user.vo.AlistUserMigrationVo;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@ConditionalOnProperty(
prefix = "migration.datasource.alist",
name = "enabled",
havingValue = "true"
)
public class AlistUserMigrationService {
private final AlistUserMigrationMapper alistUserMigrationMapper;
public AlistUserMigrationService(AlistUserMigrationMapper alistUserMigrationMapper) {
this.alistUserMigrationMapper = alistUserMigrationMapper;
}
public List<AlistUserMigrationVo> selectAlistUserMigrationList(AlistUserMigrationDto alistUserMigrationDto) {
return alistUserMigrationMapper.selectAlistUserMigrationList(alistUserMigrationDto);
}
}
@@ -1,11 +1,11 @@
package com.alist.api.modules.migration.eltown.user.vo; package com.alist.api.core.modules.migration.alist.user.vo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class EltownUserVo { public class AlistUserMigrationVo {
private String id; private String id;
private String name; private String name;
private String hp; private String hp;
@@ -1,11 +1,11 @@
package com.alist.api.modules.migration.eltown.user.dto; package com.alist.api.core.modules.migration.eltown.user.dto;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class EltownUserDto { public class EltownUserMigrationDto {
private String id; private String id;
private String password; private String password;
private String md5Password; private String md5Password;
@@ -0,0 +1,12 @@
package com.alist.api.core.modules.migration.eltown.user.mapper;
import com.alist.api.core.modules.migration.eltown.user.dto.EltownUserMigrationDto;
import com.alist.api.core.modules.migration.eltown.user.vo.EltownUserMigrationVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface EltownUserMigrationMapper {
List<EltownUserMigrationVo> selectEltownUserMigrationList(EltownUserMigrationDto eltownUserMigrationDto);
}
@@ -0,0 +1,30 @@
package com.alist.api.core.modules.migration.eltown.user.service;
import com.alist.api.core.common.utils.HashUtils;
import com.alist.api.core.modules.migration.eltown.user.dto.EltownUserMigrationDto;
import com.alist.api.core.modules.migration.eltown.user.mapper.EltownUserMigrationMapper;
import com.alist.api.core.modules.migration.eltown.user.vo.EltownUserMigrationVo;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@ConditionalOnProperty(
prefix = "migration.datasource.eltown",
name = "enabled",
havingValue = "true"
)
public class EltownUserMigrationService {
private final EltownUserMigrationMapper eltownUserMigrationMapper;
public EltownUserMigrationService(EltownUserMigrationMapper eltownUserMigrationMapper) {
this.eltownUserMigrationMapper = eltownUserMigrationMapper;
}
public List<EltownUserMigrationVo> selectEltownUserMigrationList(EltownUserMigrationDto eltownUserMigrationDto) {
eltownUserMigrationDto.setMd5Password(HashUtils.md5(eltownUserMigrationDto.getPassword()));
return eltownUserMigrationMapper.selectEltownUserMigrationList(eltownUserMigrationDto);
}
}
@@ -1,11 +1,11 @@
package com.alist.api.modules.migration.alist.user.vo; package com.alist.api.core.modules.migration.eltown.user.vo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class AlistUserVo { public class EltownUserMigrationVo {
private String id; private String id;
private String name; private String name;
private String hp; private String hp;
@@ -0,0 +1,20 @@
package com.alist.api.core.modules.standard.alCalendar.dto;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
public class AlCalendarAddDto {
private String yyyymmdd;
private String yyyy;
private String mm;
private String dd;
private Short weekNo;
private String weekNm;
private String holidayYn;
private String holidayNm;
private LocalDate formatDate;
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.standard.alCalendar.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarDeleteDto {
private String yyyymmdd;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.standard.alCalendar.dto;
import com.alist.api.core.common.paging.PagingRequest;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarListDto extends PagingRequest {
private String yyyymmdd;
private String yyyy;
private String mm;
private String holidayYn;
}
@@ -0,0 +1,31 @@
package com.alist.api.core.modules.standard.alCalendar.dto;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
public class AlCalendarModifyDto {
private String yyyymmdd;
private String yyyy;
private String mm;
private String dd;
private Short weekNo;
private String weekNm;
private String holidayYn;
private String holidayNm;
private LocalDate formatDate;
public boolean hasModifyValue() {
return yyyy != null
|| mm != null
|| dd != null
|| weekNo != null
|| weekNm != null
|| holidayYn != null
|| holidayNm != null
|| formatDate != null;
}
}
@@ -0,0 +1,10 @@
package com.alist.api.core.modules.standard.alCalendar.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarViewDto {
private String yyyymmdd;
}
@@ -0,0 +1,27 @@
package com.alist.api.core.modules.standard.alCalendar.mapper;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarAddDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarDeleteDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarListDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarModifyDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarViewDto;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarListItemVo;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarViewVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface AlCalendarMapper {
int selectAlCalendarListCount(AlCalendarListDto alCalendarListDto);
List<AlCalendarListItemVo> selectAlCalendarList(AlCalendarListDto alCalendarListDto);
AlCalendarViewVo selectAlCalendarView(AlCalendarViewDto alCalendarViewDto);
int insertAlCalendarAdd(AlCalendarAddDto alCalendarAddDto);
int updateAlCalendarModify(AlCalendarModifyDto alCalendarModifyDto);
int deleteAlCalendarDelete(AlCalendarDeleteDto alCalendarDeleteDto);
}
@@ -0,0 +1,82 @@
package com.alist.api.core.modules.standard.alCalendar.service;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarAddDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarDeleteDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarListDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarModifyDto;
import com.alist.api.core.modules.standard.alCalendar.dto.AlCalendarViewDto;
import com.alist.api.core.modules.standard.alCalendar.mapper.AlCalendarMapper;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarAddVo;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarDeleteVo;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarListVo;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarModifyVo;
import com.alist.api.core.modules.standard.alCalendar.vo.AlCalendarViewVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class AlCalendarService {
private final AlCalendarMapper alCalendarMapper;
public AlCalendarService(AlCalendarMapper alCalendarMapper) {
this.alCalendarMapper = alCalendarMapper;
}
@Transactional(readOnly = true)
public AlCalendarListVo selectAlCalendarList(AlCalendarListDto alCalendarListDto) {
int totalCount = alCalendarMapper.selectAlCalendarListCount(alCalendarListDto);
AlCalendarListVo alCalendarListVo = new AlCalendarListVo();
alCalendarListVo.setAlCalendarList(alCalendarMapper.selectAlCalendarList(alCalendarListDto));
alCalendarListVo.setPaging(alCalendarListDto, totalCount);
return alCalendarListVo;
}
@Transactional(readOnly = true)
public AlCalendarViewVo selectAlCalendarView(AlCalendarViewDto alCalendarViewDto) {
return alCalendarMapper.selectAlCalendarView(alCalendarViewDto);
}
@Transactional
public AlCalendarAddVo insertAlCalendarAdd(AlCalendarAddDto alCalendarAddDto) {
int insertCount = alCalendarMapper.insertAlCalendarAdd(alCalendarAddDto);
AlCalendarAddVo alCalendarAddVo = new AlCalendarAddVo();
alCalendarAddVo.setAdded(insertCount > 0);
alCalendarAddVo.setYyyymmdd(alCalendarAddDto.getYyyymmdd());
alCalendarAddVo.setResultCode(insertCount > 0 ? 2002 : 500);
return alCalendarAddVo;
}
@Transactional
public AlCalendarModifyVo updateAlCalendarModify(AlCalendarModifyDto alCalendarModifyDto) {
AlCalendarModifyVo alCalendarModifyVo = new AlCalendarModifyVo();
alCalendarModifyVo.setYyyymmdd(alCalendarModifyDto.getYyyymmdd());
if (!alCalendarModifyDto.hasModifyValue()) {
alCalendarModifyVo.setUpdated(false);
alCalendarModifyVo.setResultCode(4001);
return alCalendarModifyVo;
}
int updateCount = alCalendarMapper.updateAlCalendarModify(alCalendarModifyDto);
alCalendarModifyVo.setUpdated(updateCount > 0);
alCalendarModifyVo.setResultCode(updateCount > 0 ? 2005 : 2003);
return alCalendarModifyVo;
}
@Transactional
public AlCalendarDeleteVo deleteAlCalendarDelete(AlCalendarDeleteDto alCalendarDeleteDto) {
int deleteCount = alCalendarMapper.deleteAlCalendarDelete(alCalendarDeleteDto);
AlCalendarDeleteVo alCalendarDeleteVo = new AlCalendarDeleteVo();
alCalendarDeleteVo.setDeleted(deleteCount > 0);
alCalendarDeleteVo.setYyyymmdd(alCalendarDeleteDto.getYyyymmdd());
alCalendarDeleteVo.setResultCode(deleteCount > 0 ? 2005 : 2003);
return alCalendarDeleteVo;
}
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarAddVo {
private boolean added;
private String yyyymmdd;
@JsonIgnore
private Integer resultCode;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarDeleteVo {
private boolean deleted;
private String yyyymmdd;
@JsonIgnore
private Integer resultCode;
}
@@ -0,0 +1,20 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
public class AlCalendarListItemVo {
private String yyyymmdd;
private String yyyy;
private String mm;
private String dd;
private Short weekNo;
private String weekNm;
private String holidayYn;
private String holidayNm;
private LocalDate formatDate;
}
@@ -0,0 +1,13 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import com.alist.api.core.common.paging.PagingResponse;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class AlCalendarListVo extends PagingResponse {
private List<AlCalendarListItemVo> alCalendarList;
}
@@ -0,0 +1,14 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class AlCalendarModifyVo {
private boolean updated;
private String yyyymmdd;
@JsonIgnore
private Integer resultCode;
}
@@ -0,0 +1,20 @@
package com.alist.api.core.modules.standard.alCalendar.vo;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
@Getter
@Setter
public class AlCalendarViewVo {
private String yyyymmdd;
private String yyyy;
private String mm;
private String dd;
private Short weekNo;
private String weekNm;
private String holidayYn;
private String holidayNm;
private LocalDate formatDate;
}
@@ -0,0 +1,35 @@
package com.alist.api.core.modules.standard.fileDetail.dto;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
public class FileDetailAddDto {
private Long fileDetailIdx;
private Long fileMasterIdx;
private Integer fileSeq;
private String fileUuid;
private String itemKey;
private String originName;
private String saveName;
private String savePath;
private String contentType;
private String ext;
private Long sizeBytes;
private Long uploadedBytes;
private String tusUploadId;
private LocalDateTime uploadTokenExpireAt;
private String checksumSha256;
private String moveYn;
private Integer moveTryCount;
private String moveLastError;
private LocalDateTime moveLockAt;
private LocalDateTime moveDate;
private String moveLockOwner;
private Short status;
private Integer createMember;
private Integer updateMember;
}
@@ -0,0 +1,11 @@
package com.alist.api.core.modules.standard.fileDetail.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileDetailDeleteDto {
private Long fileDetailIdx;
private Integer updateMember;
}

Some files were not shown because too many files have changed in this diff Show More