Skip to content

Commit

Permalink
fix: import optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
gracefulBrown committed Dec 27, 2024
1 parent d60bd7e commit 280fd5b
Show file tree
Hide file tree
Showing 61 changed files with 240 additions and 268 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package wooteco.prolog.steps;

import static org.assertj.core.api.Assertions.assertThat;

import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
Expand All @@ -8,8 +10,6 @@
import wooteco.prolog.roadmap.application.dto.EssayAnswerRequest;
import wooteco.prolog.roadmap.application.dto.EssayAnswerUpdateRequest;

import static org.assertj.core.api.Assertions.assertThat;

public final class EssayAnswerStepDefinitions extends AcceptanceSteps {

@Given("{long}번 퀴즈에 {string}(이)라는 답변을 생성하(면)(고)")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package wooteco.prolog.steps;

import static wooteco.prolog.member.domain.Part.ANDROID;
import static wooteco.prolog.member.domain.Part.BACKEND;
import static wooteco.prolog.member.domain.Part.FRONTEND;
import static wooteco.prolog.member.domain.Term.FOURTH;

import io.cucumber.java.en.Given;
import wooteco.prolog.AcceptanceSteps;
import wooteco.prolog.member.domain.*;
import wooteco.prolog.member.domain.Department;
import wooteco.prolog.member.domain.DepartmentMember;
import wooteco.prolog.member.domain.Member;
import wooteco.prolog.member.domain.repository.DepartmentMemberRepository;
import wooteco.prolog.member.domain.repository.DepartmentRepository;
import wooteco.prolog.member.domain.repository.MemberRepository;

import static wooteco.prolog.member.domain.Part.*;
import static wooteco.prolog.member.domain.Term.*;

public class GroupMemberStepDefinitions extends AcceptanceSteps {

private final MemberRepository memberRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package wooteco.prolog.steps;

import static org.assertj.core.api.Assertions.assertThat;

import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.springframework.http.HttpStatus;
import wooteco.prolog.AcceptanceSteps;
import wooteco.prolog.roadmap.application.dto.RecommendedRequest;

import static org.assertj.core.api.Assertions.assertThat;
import static wooteco.prolog.fixtures.KeywordAcceptanceFixture.KEYWORD_REQUEST;

public class KeywordRecommendedPostStepDefinitions extends AcceptanceSteps {

@Given("{int}번 키워드에 대해 추천 포스트 {string}를 작성하고")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package wooteco.prolog.steps;

import static org.assertj.core.api.Assertions.assertThat;
import static wooteco.prolog.fixtures.KeywordAcceptanceFixture.KEYWORD_REQUEST;

import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.springframework.http.HttpStatus;
import wooteco.prolog.AcceptanceSteps;
import wooteco.prolog.session.application.dto.SessionRequest;

import static org.assertj.core.api.Assertions.assertThat;
import static wooteco.prolog.fixtures.KeywordAcceptanceFixture.KEYWORD_REQUEST;

public class KeywordStepDefinitions extends AcceptanceSteps {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
package wooteco.prolog.article.application;

import static java.util.stream.Collectors.toList;
import static wooteco.prolog.common.exception.BadRequestCode.ARTICLE_NOT_FOUND_EXCEPTION;
import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_ALLOWED;

import com.google.common.collect.Lists;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -21,15 +29,6 @@
import wooteco.prolog.member.domain.MemberUpdatedEvent;
import wooteco.prolog.member.domain.Role;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

import static java.util.stream.Collectors.toList;
import static wooteco.prolog.common.exception.BadRequestCode.ARTICLE_NOT_FOUND_EXCEPTION;
import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_ALLOWED;

@RequiredArgsConstructor
@Service
@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package wooteco.prolog.article.application;

import static java.util.stream.Collectors.toList;

import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
import java.net.URL;
import java.util.ArrayList;
import org.springframework.stereotype.Component;
import wooteco.prolog.article.domain.RssFeed;
import wooteco.prolog.article.domain.RssFeeds;

import java.net.URL;
import java.util.ArrayList;

import static java.util.stream.Collectors.toList;

@Component
public class RssClient {
public RssFeeds fromRssFeedBy(String feedUrl) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package wooteco.prolog.article.application;

import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;

public class SSLUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import com.slack.api.model.block.composition.MarkdownTextObject;
import com.slack.api.model.block.composition.PlainTextObject;
import com.slack.api.model.block.element.ButtonElement;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -21,11 +25,6 @@
import org.springframework.transaction.annotation.Transactional;
import wooteco.prolog.article.domain.Article;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@RequiredArgsConstructor
@Service
@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package wooteco.prolog.article.application.dto;

import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import wooteco.prolog.article.application.OgTagParser.OgType;

import java.util.Map;

@Getter
@AllArgsConstructor
public class ArticleUrlResponse {
Expand Down
21 changes: 10 additions & 11 deletions backend/src/main/java/wooteco/prolog/article/domain/Article.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package wooteco.prolog.article.domain;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import wooteco.prolog.common.exception.BadRequestCode;
import wooteco.prolog.common.exception.BadRequestException;
import wooteco.prolog.member.domain.Member;
import static java.lang.Boolean.TRUE;

import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
Expand All @@ -19,9 +13,14 @@
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.time.LocalDateTime;

import static java.lang.Boolean.TRUE;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import wooteco.prolog.common.exception.BadRequestCode;
import wooteco.prolog.common.exception.BadRequestException;
import wooteco.prolog.member.domain.Member;

@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package wooteco.prolog.article.domain;

import javax.persistence.Embeddable;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand All @@ -9,8 +10,6 @@
import org.jsoup.Jsoup;
import org.jsoup.safety.Safelist;

import javax.persistence.Embeddable;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EqualsAndHashCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndFeed;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Objects;
import lombok.Getter;
import org.jdom2.Element;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import wooteco.prolog.member.domain.Member;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Objects;

@Getter
public class RssFeed {
private String title;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package wooteco.prolog.article.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import static java.util.stream.Collectors.toList;

import java.time.LocalDateTime;
import java.util.Comparator;
import java.util.List;

import static java.util.stream.Collectors.toList;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package wooteco.prolog.article.domain;

import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.util.Objects;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EqualsAndHashCode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package wooteco.prolog.article.domain;

import javax.persistence.Embeddable;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Embeddable;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EqualsAndHashCode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package wooteco.prolog.article.domain.repository;

import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import wooteco.prolog.article.domain.Article;

import java.util.List;
import java.util.Optional;

public interface ArticleRepository extends JpaRepository<Article, Long> {

List<Article> findAllByOrderByCreatedAtDesc();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package wooteco.prolog.article.ui;

import java.net.URI;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand All @@ -20,9 +22,6 @@
import wooteco.prolog.login.domain.AuthMemberPrincipal;
import wooteco.prolog.login.ui.LoginMember;

import java.net.URI;
import java.util.List;

@RequiredArgsConstructor
@RestController
@RequestMapping("/articles")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package wooteco.prolog.common;

import java.time.LocalDate;
import java.time.Month;
import java.time.format.DateTimeFormatter;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import wooteco.prolog.article.domain.ArticleFilterType;

import java.time.LocalDate;
import java.time.Month;
import java.time.format.DateTimeFormatter;

@Configuration
public class WebConverterConfig implements WebMvcConfigurer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package wooteco.prolog.member.application;

import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_ALLOWED;
import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_FOUND;

import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.Page;
Expand All @@ -20,14 +27,6 @@
import wooteco.prolog.member.domain.Role;
import wooteco.prolog.member.domain.repository.MemberRepository;

import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_ALLOWED;
import static wooteco.prolog.common.exception.BadRequestCode.MEMBER_NOT_FOUND;

@Service
@Transactional(readOnly = true)
public class MemberService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package wooteco.prolog.member.domain;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand Down
Loading

0 comments on commit 280fd5b

Please sign in to comment.