Skip to content

Commit

Permalink
디렉토리 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
장준하 authored and 장준하 committed Aug 6, 2024
1 parent 7aed780 commit 9114c35
Show file tree
Hide file tree
Showing 32 changed files with 66 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import newCar.event_page.dto.*;
import newCar.event_page.entity.event.EventId;
import newCar.event_page.model.dto.*;
import newCar.event_page.model.entity.event.EventId;
import newCar.event_page.service.EventService;
import newCar.event_page.service.QuizService;
import newCar.event_page.service.RacingService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package newCar.event_page.dto;
package newCar.event_page.model.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;
import newCar.event_page.entity.event.EventCommon;
import newCar.event_page.model.entity.event.EventCommon;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package newCar.event_page.dto;
package newCar.event_page.model.dto;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;
import newCar.event_page.entity.event.racing.PersonalityTest;
import newCar.event_page.model.entity.event.racing.PersonalityTest;

import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package newCar.event_page.dto;
package newCar.event_page.model.dto;


import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;
import newCar.event_page.entity.event.quiz.Quiz;
import newCar.event_page.model.entity.event.quiz.Quiz;

import java.time.LocalDate;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package newCar.event_page.dto;
package newCar.event_page.model.dto;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import newCar.event_page.entity.Team;
import newCar.event_page.entity.event.racing.RacingWinner;
import newCar.event_page.model.entity.Team;
import newCar.event_page.model.entity.event.racing.RacingWinner;

@Data
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.dto;
package newCar.event_page.model.dto;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity;
package newCar.event_page.model.entity;

public enum LoginType {
KAKAO,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity;
package newCar.event_page.model.entity;

public enum Team {
PET,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity;
package newCar.event_page.model.entity;

import jakarta.persistence.*;
import lombok.AccessLevel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity;
package newCar.event_page.model.entity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity.event;
package newCar.event_page.model.entity.event;

import jakarta.persistence.*;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package newCar.event_page.entity.event;
package newCar.event_page.model.entity.event;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import newCar.event_page.dto.EventCommonDTO;
import newCar.event_page.model.dto.EventCommonDTO;

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package newCar.event_page.entity.event;
package newCar.event_page.model.entity.event;

public enum EventId {
Racing(1),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package newCar.event_page.entity.event;
package newCar.event_page.model.entity.event;

import jakarta.persistence.*;
import lombok.Getter;
import newCar.event_page.entity.User;
import newCar.event_page.model.entity.User;


@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package newCar.event_page.entity.event.quiz;
package newCar.event_page.model.entity.event.quiz;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import newCar.event_page.dto.QuizDTO;
import newCar.event_page.model.dto.QuizDTO;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package newCar.event_page.entity.event.quiz;
package newCar.event_page.model.entity.event.quiz;

import jakarta.persistence.*;
import lombok.Getter;
import newCar.event_page.entity.event.Event;
import newCar.event_page.model.entity.event.Event;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package newCar.event_page.entity.event.quiz;
package newCar.event_page.model.entity.event.quiz;

import jakarta.persistence.*;
import lombok.Getter;
import newCar.event_page.entity.event.EventUser;
import newCar.event_page.model.entity.event.EventUser;

@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package newCar.event_page.entity.event.racing;
package newCar.event_page.model.entity.event.racing;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import newCar.event_page.dto.PersonalityTestDTO;
import newCar.event_page.entity.Team;
import newCar.event_page.entity.TeamScore;
import newCar.event_page.model.dto.PersonalityTestDTO;
import newCar.event_page.model.entity.TeamScore;

@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package newCar.event_page.entity.event.racing;
package newCar.event_page.model.entity.event.racing;

import jakarta.persistence.CascadeType;
import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import jakarta.persistence.OneToMany;
import lombok.Getter;
import newCar.event_page.entity.event.Event;
import newCar.event_page.model.entity.event.Event;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package newCar.event_page.entity.event.racing;
package newCar.event_page.model.entity.event.racing;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import newCar.event_page.entity.event.EventUser;
import newCar.event_page.model.entity.event.EventUser;

@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/newCar/event_page/participant/Participant.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository;

import newCar.event_page.entity.event.EventCommon;
import newCar.event_page.model.entity.event.EventCommon;
import org.springframework.data.jpa.repository.JpaRepository;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository;

import newCar.event_page.entity.event.Event;
import newCar.event_page.model.entity.event.Event;
import org.springframework.data.jpa.repository.JpaRepository;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package newCar.event_page.repository;

import newCar.event_page.entity.event.EventUser;
import newCar.event_page.model.entity.event.EventUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository.quiz;

import newCar.event_page.entity.event.quiz.QuizEvent;
import newCar.event_page.model.entity.event.quiz.QuizEvent;
import org.springframework.data.jpa.repository.JpaRepository;

public interface QuizEventRepository extends JpaRepository<QuizEvent,Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package newCar.event_page.repository.quiz;

import newCar.event_page.entity.event.quiz.Quiz;
import newCar.event_page.model.entity.event.quiz.Quiz;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.time.LocalDate;
import java.util.List;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository.racing;

import newCar.event_page.entity.event.racing.PersonalityTest;
import newCar.event_page.model.entity.event.racing.PersonalityTest;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository.racing;

import newCar.event_page.entity.event.racing.RacingEvent;
import newCar.event_page.model.entity.event.racing.RacingEvent;
import org.springframework.data.jpa.repository.JpaRepository;

public interface RacingEventRepository extends JpaRepository<RacingEvent,Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package newCar.event_page.repository.racing;

import newCar.event_page.entity.event.racing.RacingWinner;
import newCar.event_page.model.entity.event.racing.RacingWinner;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/newCar/event_page/service/EventService.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package newCar.event_page.service;

import lombok.RequiredArgsConstructor;
import newCar.event_page.dto.EventCommonDTO;
import newCar.event_page.entity.event.EventCommon;
import newCar.event_page.entity.event.EventId;
import newCar.event_page.entity.event.quiz.Quiz;
import newCar.event_page.entity.event.quiz.QuizEvent;
import newCar.event_page.model.dto.EventCommonDTO;
import newCar.event_page.model.entity.event.EventCommon;
import newCar.event_page.model.entity.event.EventId;
import newCar.event_page.model.entity.event.quiz.Quiz;
import newCar.event_page.model.entity.event.quiz.QuizEvent;
import newCar.event_page.repository.EventCommonRepository;
import newCar.event_page.repository.quiz.QuizEventRepository;
import newCar.event_page.repository.quiz.QuizRepository;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/newCar/event_page/service/QuizService.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package newCar.event_page.service;

import lombok.RequiredArgsConstructor;
import newCar.event_page.dto.QuizDTO;
import newCar.event_page.entity.event.Event;
import newCar.event_page.entity.event.quiz.Quiz;
import newCar.event_page.model.dto.QuizDTO;
import newCar.event_page.model.entity.event.Event;
import newCar.event_page.model.entity.event.quiz.Quiz;
import newCar.event_page.exception.UnmodifiableFieldException;
import newCar.event_page.repository.EventRepository;
import newCar.event_page.repository.quiz.QuizRepository;
Expand Down
22 changes: 15 additions & 7 deletions src/main/java/newCar/event_page/service/RacingService.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package newCar.event_page.service;

import lombok.RequiredArgsConstructor;
import newCar.event_page.dto.PersonalityTestDTO;
import newCar.event_page.dto.RacingWinnersDTO;
import newCar.event_page.dto.WinnerSettingDTO;
import newCar.event_page.entity.event.EventUser;
import newCar.event_page.entity.event.racing.PersonalityTest;
import newCar.event_page.entity.event.racing.RacingWinner;
import newCar.event_page.model.dto.PersonalityTestDTO;
import newCar.event_page.model.dto.RacingWinnersDTO;
import newCar.event_page.model.dto.WinnerSettingDTO;
import newCar.event_page.model.entity.event.EventUser;
import newCar.event_page.model.entity.event.racing.PersonalityTest;
import newCar.event_page.model.entity.event.racing.RacingWinner;
import newCar.event_page.exception.DrawNotYetConductedException;
import newCar.event_page.exception.ExcessiveWinnersRequestedException;
import newCar.event_page.participant.Participant;
import newCar.event_page.repository.EventUserRepository;
import newCar.event_page.repository.racing.PersonalityTestRepository;
import newCar.event_page.repository.racing.RacingEventRepository;
Expand Down Expand Up @@ -139,5 +138,14 @@ private Participant findLast(Set<Participant> participantSet){
private double getWeight(int clickNumber) {
return 1 + ((Math.log(clickNumber+1))/(Math.log(30)));
}

class Participant {
public Long userId;
public double weight;
public Participant(Long userId, double weight) {
this.userId=userId;
this.weight=weight;
}
}
}

0 comments on commit 9114c35

Please sign in to comment.