Skip to content

Commit

Permalink
[chore] spotless 적용 #169
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdtkdgns committed Nov 12, 2023
1 parent 03ccbeb commit c141f37
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
import allchive.server.domain.domains.content.domain.enums.ContentType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/archivings")
@RequiredArgsConstructor
Expand Down Expand Up @@ -70,8 +69,9 @@ public void deleteArchiving(@PathVariable("archivingId") Long archivingId) {

@Operation(
summary = "주제별 아카이빙 리스트를 가져옵니다.",
description = "sort parameter는 입력하지 말아주세요! sorting : 스크랩 여부 -> 스크랩 수 -> 생성일자" +
"\nsort에 popular쓰면 최신순 안쓰면 인기순 입니다!")
description =
"sort parameter는 입력하지 말아주세요! sorting : 스크랩 여부 -> 스크랩 수 -> 생성일자"
+ "\nsort에 popular쓰면 최신순 안쓰면 인기순 입니다!")
@GetMapping()
public SliceResponse<ArchivingResponse> getArchiving(
@RequestParam("category") Category category,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ private void validateExecution(Long archivingId, Long userId) {
private Slice<ContentResponse> getContentResponseSlice(
Long archivingId, Pageable pageable, ContentType contentType, List<Long> tagIds) {
List<Long> contentIds = null;
if(tagIds != null){
contentIds = contentTagGroupAdaptor.queryContentTagGroupByTagIdInWithContent(tagIds)
.stream().map(
contentTagGroup -> contentTagGroup.getContent().getId()
).toList();
if (tagIds != null) {
contentIds =
contentTagGroupAdaptor.queryContentTagGroupByTagIdInWithContent(tagIds).stream()
.map(contentTagGroup -> contentTagGroup.getContent().getId())
.toList();
}
Slice<Content> contentList =
contentAdaptor.querySliceContentByArchivingIdAndContentTypeAndIdIn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import allchive.server.api.config.security.SecurityUtil;
import allchive.server.core.annotation.UseCase;
import allchive.server.core.event.Event;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.domain.common.aop.distributedLock.DistributedLock;
import allchive.server.domain.common.enums.DistributedLockType;
import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor;
import allchive.server.domain.domains.archiving.domain.Archiving;
import allchive.server.domain.domains.archiving.service.ArchivingDomainService;
import allchive.server.domain.domains.archiving.validator.ArchivingValidator;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
Expand All @@ -27,6 +26,5 @@ public void errorExample(

@Operation(hidden = true)
@GetMapping(value = "health")
public void healthCheck() {
}
public void healthCheck() {}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package allchive.server.api.common.filter;


import org.apache.tomcat.util.http.fileupload.IOUtils;

import java.io.*;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.apache.tomcat.util.http.fileupload.IOUtils;

public class MultiReadInputStream extends HttpServletRequestWrapper {
private ByteArrayOutputStream cachedBytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import allchive.server.api.content.model.mapper.ContentMapper;
import allchive.server.core.annotation.UseCase;
import allchive.server.core.event.Event;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.domain.common.aop.distributedLock.DistributedLock;
import allchive.server.domain.common.enums.DistributedLockType;
import allchive.server.domain.domains.archiving.service.ArchivingAsyncDomainService;
Expand All @@ -25,6 +24,7 @@
import allchive.server.domain.domains.content.service.TagAsyncDomainService;
import allchive.server.domain.domains.content.validator.ContentValidator;
import allchive.server.domain.domains.content.validator.TagValidator;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import allchive.server.api.recycle.model.dto.request.ClearDeletedObjectRequest;
import allchive.server.core.annotation.UseCase;
import allchive.server.core.event.Event;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.domain.common.aop.distributedLock.DistributedLock;
import allchive.server.domain.common.enums.DistributedLockType;
import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor;
Expand All @@ -21,6 +20,7 @@
import allchive.server.domain.domains.recycle.validator.RecycleValidator;
import allchive.server.domain.domains.report.service.ReportDomainService;
import allchive.server.domain.domains.user.service.ScrapDomainService;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.infrastructure.s3.service.S3DeleteObjectService;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import allchive.server.core.annotation.UseCase;
import allchive.server.core.event.Event;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.domain.domains.archiving.adaptor.ArchivingAdaptor;
import allchive.server.domain.domains.archiving.domain.Archiving;
import allchive.server.domain.domains.archiving.service.ArchivingDomainService;
Expand All @@ -18,6 +17,7 @@
import allchive.server.domain.domains.recycle.service.RecycleDomainService;
import allchive.server.domain.domains.report.service.ReportDomainService;
import allchive.server.domain.domains.user.service.ScrapDomainService;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.infrastructure.s3.service.S3DeleteObjectService;
import java.time.LocalDateTime;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import allchive.server.api.user.model.dto.request.UpdateUserInfoRequest;
import allchive.server.core.annotation.UseCase;
import allchive.server.core.event.Event;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.domain.common.aop.distributedLock.DistributedLock;
import allchive.server.domain.common.enums.DistributedLockType;
import allchive.server.domain.domains.user.adaptor.UserAdaptor;
import allchive.server.domain.domains.user.domain.User;
import allchive.server.domain.domains.user.service.UserDomainService;
import allchive.server.domain.domains.user.validator.UserValidator;
import allchive.server.infrastructure.s3.event.S3ImageDeleteEvent;
import allchive.server.infrastructure.s3.service.S3DeleteObjectService;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@


import allchive.server.core.event.Event;
import java.lang.reflect.Method;

import allchive.server.infrastructure.slack.event.SlackAsyncErrorEvent;
import java.lang.reflect.Method;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import allchive.server.domain.domains.content.domain.Tag;
import allchive.server.domain.domains.content.repository.ContentTagGroupRepository;
import java.util.List;
import java.util.Optional;

import lombok.RequiredArgsConstructor;

@Adaptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@


import allchive.server.domain.domains.content.domain.Content;
import java.util.List;

import allchive.server.domain.domains.content.domain.enums.ContentType;
import java.util.List;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public Slice<Content> querySliceContentByArchivingIdAndContentTypeAndIdIn(
List<Content> archivings =
queryFactory
.selectFrom(content)
.where(archivingIdEq(archivingId), deleteStatusFalse(), contentTypeEq(contentType), idIn(contentIds))
.where(
archivingIdEq(archivingId),
deleteStatusFalse(),
contentTypeEq(contentType),
idIn(contentIds))
.orderBy(createdAtDesc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize() + 1)
Expand Down Expand Up @@ -61,8 +65,7 @@ private BooleanExpression contentTypeEq(ContentType contentType) {
}

private BooleanExpression idIn(List<Long> contentIds) {
if(contentIds == null)
return null;
if (contentIds == null) return null;
return content.id.in(contentIds);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ private BooleanExpression tagIn(List<Tag> tagList) {
}

private BooleanExpression tagIdIn(List<Long> tagIds) {
if(tagIds == null)
return null;
if (tagIds == null) return null;
return contentTagGroup.tag.id.in(tagIds);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package allchive.server.domain.domains.quitReason.adaptor;


import allchive.server.core.annotation.Adaptor;
import allchive.server.domain.domains.quitReason.domain.QuitReason;
import allchive.server.domain.domains.quitReason.repository.QuitReasonRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package allchive.server.domain.domains.quitReason.domain;


import allchive.server.domain.common.model.BaseTimeEntity;
import allchive.server.domain.domains.quitReason.domain.enums.Reason;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Getter
@Table(name = "tbl_quit_reason")
@Entity
Expand All @@ -19,8 +19,7 @@ public class QuitReason extends BaseTimeEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotNull
private Long userId;
@NotNull private Long userId;

private Reason reason;

Expand All @@ -31,9 +30,6 @@ private QuitReason(Long userId, Reason reason) {
}

public static QuitReason of(Long userId, Reason reason) {
return QuitReason.builder()
.userId(userId)
.reason(reason)
.build();
return QuitReason.builder().userId(userId).reason(reason).build();
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
package allchive.server.domain.domains.quitReason.domain.enums;

import allchive.server.domain.domains.user.domain.enums.OauthProvider;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.stream.Stream;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum Reason {
NOT_USED("NOT_USED"), // 자주 사용하지 않아서
UNCONFORTABLE("UNCONFORTABLE"), // 이용이 불편하고 장애가 많아서
USE_OTHER_SERVICE("USE_OTHER_SERVICE"), //다른 대체 서비스를 이용해서
USE_OTHER_SERVICE("USE_OTHER_SERVICE"), // 다른 대체 서비스를 이용해서
EXPENSIVE("EXPENSIVE"), // 서비스 이용료가 비싸서
NEW_ACCOUNT("NEW_ACCOUNT"), //새 계정을 만들고싶어서
NEW_ACCOUNT("NEW_ACCOUNT"), // 새 계정을 만들고싶어서
ETC("ETC");

@JsonValue
private String value;
@JsonValue private String value;

@JsonCreator
public static Reason parsing(String inputValue) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package allchive.server.domain.domains.quitReason.repository;


import allchive.server.domain.domains.quitReason.domain.QuitReason;
import org.springframework.data.jpa.repository.JpaRepository;

public interface QuitReasonRepository extends JpaRepository<QuitReason, Long> {
}
public interface QuitReasonRepository extends JpaRepository<QuitReason, Long> {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package allchive.server.domain.domains.quitReason.service;


import allchive.server.core.annotation.DomainService;
import allchive.server.domain.domains.quitReason.adaptor.QuitReasonAdaptor;
import allchive.server.domain.domains.quitReason.domain.QuitReason;
Expand Down

0 comments on commit c141f37

Please sign in to comment.