Skip to content

Commit

Permalink
[FEAT] #559 merge recruit-dev into 559
Browse files Browse the repository at this point in the history
  • Loading branch information
wken5577 committed Mar 15, 2024
2 parents 60c1b05 + f6597d4 commit fda8595
Show file tree
Hide file tree
Showing 47 changed files with 292 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import gg.pingpong.api.admin.game.dto.GameUserLogAdminReqDto;
import gg.pingpong.api.admin.game.dto.RankGamePPPModifyReqDto;
import gg.pingpong.api.admin.game.service.GameAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.pingpong.api.user.rank.redis.RankRedisService;
import gg.utils.dto.PageRequestDto;
import gg.utils.exception.ErrorCode;
import gg.utils.exception.custom.InvalidParameterException;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import javax.validation.constraints.NotNull;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import gg.pingpong.api.admin.manage.controller.response.AnnouncementAdminListResponseDto;
import gg.pingpong.api.admin.manage.dto.AnnouncementAdminAddDto;
import gg.pingpong.api.admin.manage.service.AnnouncementAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.AllArgsConstructor;

@RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import gg.pingpong.api.admin.manage.controller.request.PenaltyRequestDto;
import gg.pingpong.api.admin.manage.controller.response.PenaltyListResponseDto;
import gg.pingpong.api.admin.manage.service.PenaltyAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.RequiredArgsConstructor;

@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.pingpong.api.admin.manage.controller.request;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.pingpong.api.admin.noti.controller.request;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;
import lombok.Setter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto;
import gg.pingpong.api.admin.store.dto.CoinPolicyAdminAddDto;
import gg.pingpong.api.admin.store.service.CoinPolicyAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto;
import gg.pingpong.api.admin.store.controller.response.ItemListResponseDto;
import gg.pingpong.api.admin.store.service.ItemAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import gg.utils.exception.item.ItemImageLargeException;
import gg.utils.exception.item.ItemImageTypeException;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import gg.pingpong.api.admin.store.controller.response.MegaphoneHistoryResponseDto;
import gg.pingpong.api.admin.store.service.MegaphoneAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.RequiredArgsConstructor;

@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.pingpong.api.admin.store.controller.request;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import gg.pingpong.api.admin.user.controller.response.UserImageListAdminResponseDto;
import gg.pingpong.api.admin.user.controller.response.UserSearchAdminResponseDto;
import gg.pingpong.api.admin.user.service.UserAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import gg.utils.exception.user.UserImageLargeException;
import gg.utils.exception.user.UserImageTypeException;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.pingpong.api.admin.user.controller.request;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;
import lombok.Setter;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@Configuration
@EnableJpaAuditing
@EnableJpaRepositories(basePackages = {"gg.repo", "gg.admin.repo"})
@EntityScan(basePackages = "gg.data")
public class JpaConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.pingpong.api.user.game.controller.request;

import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;
import lombok.Setter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

import gg.auth.UserDto;
import gg.auth.argumentresolver.Login;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto;
import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto;
import gg.pingpong.api.user.rank.service.RankService;
import gg.utils.dto.PageRequestDto;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

import gg.auth.UserDto;
import gg.auth.argumentresolver.Login;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto;
import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto;
import gg.pingpong.api.user.rank.service.RankService;
import gg.utils.dto.PageRequestDto;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import gg.auth.UserDto;
import gg.auth.argumentresolver.Login;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.pingpong.api.user.store.controller.request.ItemGiftRequestDto;
import gg.pingpong.api.user.store.controller.response.ItemStoreListResponseDto;
import gg.pingpong.api.user.store.controller.response.UserItemListResponseDto;
import gg.pingpong.api.user.store.service.ItemService;
import gg.utils.dto.PageRequestDto;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import gg.data.pingpong.tournament.type.TournamentStatus;
import gg.data.pingpong.tournament.type.TournamentType;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.dto.PageRequestDto;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import gg.data.pingpong.game.type.Mode;
import gg.data.user.type.OauthType;
import gg.data.user.type.RoleType;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.pingpong.api.global.security.cookie.CookieUtil;
import gg.pingpong.api.global.security.jwt.utils.TokenHeaders;
import gg.pingpong.api.user.user.controller.request.UserModifyRequestDto;
Expand All @@ -54,6 +53,7 @@
import gg.pingpong.api.user.user.service.UserAuthenticationService;
import gg.pingpong.api.user.user.service.UserCoinService;
import gg.pingpong.api.user.user.service.UserService;
import gg.utils.dto.PageRequestDto;
import gg.utils.exception.user.KakaoOauth2AlreadyExistException;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import gg.pingpong.api.admin.manage.controller.response.AnnouncementAdminListResponseDto;
import gg.pingpong.api.admin.manage.dto.AnnouncementAdminAddDto;
import gg.pingpong.api.admin.manage.service.AnnouncementAdminService;
import gg.pingpong.api.global.dto.PageRequestDto;
import gg.utils.annotation.UnitTest;
import gg.utils.dto.PageRequestDto;

@UnitTest
@ExtendWith(MockitoExtension.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package gg.recruit.api.user.application.controller;
package gg.recruit.api.user.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import gg.auth.UserDto;
import gg.auth.argumentresolver.Login;
import gg.recruit.api.user.application.controller.response.MyApplicationDetailResDto;
import gg.recruit.api.user.application.controller.response.MyApplicationsResDto;
import gg.recruit.api.user.application.service.ApplicationService;
import gg.recruit.api.user.application.service.param.FindApplicationDetailParam;
import gg.recruit.api.user.application.service.response.ApplicationListSvcDto;
import gg.recruit.api.user.application.service.response.ApplicationWithAnswerSvcDto;
import gg.recruit.api.user.controller.response.MyApplicationDetailResDto;
import gg.recruit.api.user.service.param.FindApplicationDetailParam;
import gg.recruit.api.user.controller.response.MyApplicationsResDto;
import gg.recruit.api.user.service.ApplicationService;
import gg.recruit.api.user.service.response.ApplicationListSvcDto;
import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto;
import lombok.RequiredArgsConstructor;

@RestController
Expand All @@ -20,6 +20,7 @@
public class ApplicationController {

private final ApplicationService applicationService;

@GetMapping("/applications")
public MyApplicationsResDto getMyApplications(@Login UserDto userDto) {
ApplicationListSvcDto res = applicationService.findMyApplications(userDto.getId());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package gg.recruit.api.user.controller;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto;
import gg.recruit.api.user.service.RecruitmentService;
import gg.utils.dto.PageRequestDto;
import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
@RequestMapping("/recruitments")
public class RecruitmentController {
private final RecruitmentService recruitmentService;

@GetMapping
public ActiveRecruitmentListResDto findActiveRecruitmentList(PageRequestDto requestDto) {
Pageable pageable = PageRequest.of(requestDto.getPage() - 1, requestDto.getSize());
return new ActiveRecruitmentListResDto(recruitmentService.findActiveRecruitmentList(pageable));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package gg.recruit.api.user.controller.response;

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

import gg.recruit.api.user.service.response.RecruitmentListSvcDto;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public class ActiveRecruitmentListResDto {
private List<RecruitmentDto> recruitments;
private Integer totalPage;

public ActiveRecruitmentListResDto(RecruitmentListSvcDto dto) {
this.recruitments = dto.getRecruitments().stream().map(RecruitmentDto::new).collect(Collectors.toList());
this.totalPage = dto.getTotalPage();
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gg.recruit.api.user.application.controller.response;
package gg.recruit.api.user.controller.response;

import java.time.LocalDateTime;

import gg.recruit.api.user.application.service.response.ApplicationSvcDto;
import gg.recruit.api.user.service.response.ApplicationSvcDto;
import lombok.Getter;
import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gg.recruit.api.user.application.controller.response;
package gg.recruit.api.user.controller.response;

import gg.recruit.api.user.application.service.response.CheckListSvcDto;
import gg.recruit.api.user.service.response.CheckListSvcDto;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package gg.recruit.api.user.application.controller.response;
package gg.recruit.api.user.controller.response;

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

import java.util.List;

import gg.recruit.api.user.application.service.response.FormSvcDto;
import gg.recruit.api.user.service.response.FormSvcDto;
import lombok.AllArgsConstructor;

@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package gg.recruit.api.user.application.controller.response;
package gg.recruit.api.user.controller.response;

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

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

import gg.recruit.api.user.application.service.response.ApplicationWithAnswerSvcDto;
import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto;
import lombok.AllArgsConstructor;

@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package gg.recruit.api.user.application.controller.response;
package gg.recruit.api.user.controller.response;

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

import gg.recruit.api.user.application.service.response.ApplicationListSvcDto;
import gg.recruit.api.user.service.response.ApplicationListSvcDto;
import lombok.Getter;
import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package gg.recruit.api.user.controller.response;

import java.time.LocalDateTime;

import gg.recruit.api.user.service.response.RecruitmentSvcDto;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public class RecruitmentDto {
private Long id;
private LocalDateTime startDate;
private LocalDateTime endDate;
private String title;
private RecruitmentStatus status;
private String generation;

public RecruitmentDto(RecruitmentSvcDto dto) {
this.id = dto.getId();
this.startDate = dto.getStartDate();
this.endDate = dto.getEndDate();
this.title = dto.getTitle();
this.generation = dto.getGeneration();
this.status = RecruitmentStatus.BEFORE;
if (LocalDateTime.now().isAfter(dto.getStartDate()) && LocalDateTime.now().isBefore(dto.getEndDate())) {
this.status = RecruitmentStatus.PROGRESS;
} else if (LocalDateTime.now().isAfter(dto.getEndDate())) {
this.status = RecruitmentStatus.FINISHED;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package gg.recruit.api.user.controller.response;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public enum RecruitmentStatus {
BEFORE("모집전"), PROGRESS("모집중"), FINISHED("모집완료");
private final String desc;
}
Loading

0 comments on commit fda8595

Please sign in to comment.