diff --git a/src/main/java/com/server/bbo_gak/domain/card/controller/CardController.java b/src/main/java/com/server/bbo_gak/domain/card/controller/CardController.java index 489b0c0..bec4d42 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/controller/CardController.java +++ b/src/main/java/com/server/bbo_gak/domain/card/controller/CardController.java @@ -3,6 +3,7 @@ import com.server.bbo_gak.domain.card.dto.request.CardContentUpdateRequest; import com.server.bbo_gak.domain.card.dto.request.CardCreateRequest; import com.server.bbo_gak.domain.card.dto.request.CardTitleUpdateRequest; +import com.server.bbo_gak.domain.card.dto.request.CardTypeUpdateRequest; import com.server.bbo_gak.domain.card.dto.response.CardCreateResponse; import com.server.bbo_gak.domain.card.dto.response.CardGetResponse; import com.server.bbo_gak.domain.card.dto.response.CardListGetResponse; @@ -46,9 +47,11 @@ public ResponseEntity getCardDetail( @GetMapping("/cards") public ResponseEntity> getCardList( @AuthUser User user, - @RequestParam("type") String type) { + @RequestParam("type") String type, + @RequestParam(value = "tag-ids", required = false) List tagIdList + ) { - return ResponseEntity.ok(cardService.getCardList(user, type)); + return ResponseEntity.ok(cardService.getCardList(user, type, tagIdList)); } @PostMapping("/card") @@ -59,6 +62,16 @@ public ResponseEntity createCard( return ResponseEntity.ok(cardService.createCard(user, cardCreateRequest)); } + @PutMapping("/cards/{card-id}/card-type") + public ResponseEntity updateCardType( + @AuthUser User user, + @PathVariable("card-id") Long cardId, + @RequestBody CardTypeUpdateRequest request + ) { + cardService.updateCardType(user, cardId, request); + return ResponseEntity.ok().body(null); + } + @PutMapping("/cards/{card-id}/title") public ResponseEntity updateCardTitle( @AuthUser User user, diff --git a/src/main/java/com/server/bbo_gak/domain/card/controller/CardInRecruitController.java b/src/main/java/com/server/bbo_gak/domain/card/controller/CardInRecruitController.java index 84c5377..04142aa 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/controller/CardInRecruitController.java +++ b/src/main/java/com/server/bbo_gak/domain/card/controller/CardInRecruitController.java @@ -29,12 +29,13 @@ public ResponseEntity getCardTypeCounts(@Auth } @GetMapping("/recruits/{recruit-id}/cards") - public ResponseEntity> getCardDetail( + public ResponseEntity> getCardList( @AuthUser User user, @PathVariable("recruit-id") Long recruitId, - @RequestParam("type") String type) { + @RequestParam("type") String type, + @RequestParam(value = "tag-ids", required = false) List tagIdList) { - return ResponseEntity.ok(cardInRecruitService.getCardListInRecruit(user, recruitId, type)); + return ResponseEntity.ok(cardInRecruitService.getCardListInRecruit(user, recruitId, type, tagIdList)); } @PostMapping("/recruits/{recruit-id}/cards/{card-id}") diff --git a/src/main/java/com/server/bbo_gak/domain/card/controller/TagController.java b/src/main/java/com/server/bbo_gak/domain/card/controller/TagController.java index 23044f2..b6a3b32 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/controller/TagController.java +++ b/src/main/java/com/server/bbo_gak/domain/card/controller/TagController.java @@ -22,8 +22,10 @@ public class TagController { private final TagService tagService; @GetMapping("/tags") - public ResponseEntity> getAllTagList() { - return ResponseEntity.ok(tagService.getAllTagList()); + public ResponseEntity> getAllTagList( + @AuthUser User user + ) { + return ResponseEntity.ok(tagService.getAllTagList(user)); } @GetMapping("/cards/{card-id}/tags") diff --git a/src/main/java/com/server/bbo_gak/domain/card/dao/CardDao.java b/src/main/java/com/server/bbo_gak/domain/card/dao/CardDao.java index b6d8b5b..71b0268 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/dao/CardDao.java +++ b/src/main/java/com/server/bbo_gak/domain/card/dao/CardDao.java @@ -25,8 +25,6 @@ public List findAllByUserIdAndCardTypeValueList(User user, CardTypeValue[] QCard qCard = QCard.card; QCardType qCardType = QCardType.cardType; - createRecruitBooleanBuilder(qCard, isRecruit); - return query.selectFrom(qCard) .leftJoin(qCard.cardTypeList, qCardType).fetchJoin() .where(qCard.user.id.eq(user.getId()) @@ -41,13 +39,12 @@ public List findAllByUserIdAndCardTypeValue(User user, CardTypeValue cardT QCard qCard = QCard.card; QCardType qCardType = QCardType.cardType; - createRecruitBooleanBuilder(qCard, recruitId); - return query.selectFrom(qCard) .leftJoin(qCard.cardTypeList, qCardType).fetchJoin() .where(qCard.user.id.eq(user.getId()) .and(qCardType.cardTypeValue.eq(cardTypeValue)) - .and(createRecruitBooleanBuilder(qCard, recruitId))) + .and(createRecruitBooleanBuilder(qCard, recruitId)) + ) .distinct() .fetch(); } @@ -72,6 +69,5 @@ private BooleanBuilder createRecruitBooleanBuilder(QCard qCard, Long recruitId) } return builder.and(qCard.recruit.id.eq(recruitId)).and(qCard.copyFlag.isTrue()); - } } diff --git a/src/main/java/com/server/bbo_gak/domain/card/dao/CardRepository.java b/src/main/java/com/server/bbo_gak/domain/card/dao/CardRepository.java index 1fe6a64..b7e9ef7 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/dao/CardRepository.java +++ b/src/main/java/com/server/bbo_gak/domain/card/dao/CardRepository.java @@ -11,4 +11,5 @@ public interface CardRepository extends JpaRepository { Optional findByIdAndUser(Long id, User user); List findAllByUser(User user); + } diff --git a/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java b/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java index 0d34184..223bf3e 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java +++ b/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java @@ -1,11 +1,14 @@ package com.server.bbo_gak.domain.card.dao; import com.server.bbo_gak.domain.card.entity.Tag; +import com.server.bbo_gak.domain.user.entity.Job; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; public interface TagRepository extends JpaRepository { + List findAllByJob(Job job); + List findAllByIdIsNotIn(List idList); } diff --git a/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardCreateRequest.java b/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardCreateRequest.java index e6d110b..74bdc8d 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardCreateRequest.java +++ b/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardCreateRequest.java @@ -9,7 +9,9 @@ public record CardCreateRequest( List cardTypeValueList, @Size(max = 3) - List tagIdList + List tagIdList, + + String cardTypeValueGroup ) { } diff --git a/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardTypeUpdateRequest.java b/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardTypeUpdateRequest.java new file mode 100644 index 0000000..0d11544 --- /dev/null +++ b/src/main/java/com/server/bbo_gak/domain/card/dto/request/CardTypeUpdateRequest.java @@ -0,0 +1,11 @@ +package com.server.bbo_gak.domain.card.dto.request; + +import java.util.List; + +public record CardTypeUpdateRequest( + List cardTypeValueList, + + String cardTypeValueGroup +) { + +} diff --git a/src/main/java/com/server/bbo_gak/domain/card/entity/Card.java b/src/main/java/com/server/bbo_gak/domain/card/entity/Card.java index 47cb58b..47f4748 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/entity/Card.java +++ b/src/main/java/com/server/bbo_gak/domain/card/entity/Card.java @@ -109,5 +109,15 @@ public void updateContent(String content) { this.content = content; } + public void updateCardTypeList(List cardTypeList) { + this.cardTypeList = cardTypeList; + } + + public boolean isTagListContain(List tagList) { + return cardTagList.stream() + .map(CardTag::getTag) + .anyMatch(tagList::contains); + } + } diff --git a/src/main/java/com/server/bbo_gak/domain/card/entity/CardTypeValueGroup.java b/src/main/java/com/server/bbo_gak/domain/card/entity/CardTypeValueGroup.java index 0dca8d4..e372176 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/entity/CardTypeValueGroup.java +++ b/src/main/java/com/server/bbo_gak/domain/card/entity/CardTypeValueGroup.java @@ -1,5 +1,8 @@ package com.server.bbo_gak.domain.card.entity; +import com.server.bbo_gak.global.error.exception.ErrorCode; +import com.server.bbo_gak.global.error.exception.NotFoundException; +import java.util.Arrays; import lombok.AllArgsConstructor; import lombok.Getter; @@ -7,11 +10,23 @@ @AllArgsConstructor public enum CardTypeValueGroup { - MY_INFO(new CardTypeValue[]{CardTypeValue.EXPERIENCE, CardTypeValue.INTERVIEW_QUESTION, + MY_INFO("내_정보", new CardTypeValue[]{CardTypeValue.EXPERIENCE, CardTypeValue.INTERVIEW_QUESTION, CardTypeValue.PERSONAL_STATEMENT}), - RECRUIT(new CardTypeValue[]{CardTypeValue.ASSIGNMENT_PREPARING, CardTypeValue.DOCUMENT_PREPARING, + RECRUIT("공고", new CardTypeValue[]{CardTypeValue.ASSIGNMENT_PREPARING, CardTypeValue.DOCUMENT_PREPARING, CardTypeValue.INTERVIEW_PREPARING}); - + + private String value; private CardTypeValue[] cardTypeValueList; + + public static CardTypeValueGroup findByValue(String value) { + return Arrays.stream(CardTypeValueGroup.values()) + .filter(cardType -> cardType.getValue().equals(value)) + .findFirst() + .orElseThrow((() -> new NotFoundException(ErrorCode.CARD_TYPE_VALUE_GROUP_NOT_FOUND))); + } + + public boolean contains(CardTypeValue cardTypeValue) { + return Arrays.asList(cardTypeValueList).contains(cardTypeValue); + } } diff --git a/src/main/java/com/server/bbo_gak/domain/card/entity/Tag.java b/src/main/java/com/server/bbo_gak/domain/card/entity/Tag.java index 4c2046e..dddf4c4 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/entity/Tag.java +++ b/src/main/java/com/server/bbo_gak/domain/card/entity/Tag.java @@ -1,6 +1,8 @@ package com.server.bbo_gak.domain.card.entity; +import com.server.bbo_gak.domain.user.entity.Job; import com.server.bbo_gak.global.common.BaseEntity; + import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; @@ -29,5 +31,8 @@ public class Tag extends BaseEntity { @Enumerated(EnumType.STRING) private TagType tagType; + @Enumerated(EnumType.STRING) + private Job job; + private String name; } diff --git a/src/main/java/com/server/bbo_gak/domain/card/service/CardInRecruitService.java b/src/main/java/com/server/bbo_gak/domain/card/service/CardInRecruitService.java index 517e17e..ecd7a77 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/service/CardInRecruitService.java +++ b/src/main/java/com/server/bbo_gak/domain/card/service/CardInRecruitService.java @@ -7,6 +7,7 @@ import com.server.bbo_gak.domain.card.dao.CardRepository; import com.server.bbo_gak.domain.card.dao.CardTagRepository; import com.server.bbo_gak.domain.card.dao.CardTypeRepository; +import com.server.bbo_gak.domain.card.dao.TagRepository; import com.server.bbo_gak.domain.card.dto.response.CardCreateResponse; import com.server.bbo_gak.domain.card.dto.response.CardListGetResponse; import com.server.bbo_gak.domain.card.dto.response.CardTypeCountInRecruitGetResponse; @@ -18,13 +19,16 @@ import com.server.bbo_gak.domain.card.entity.CardType; import com.server.bbo_gak.domain.card.entity.CardTypeValue; import com.server.bbo_gak.domain.card.entity.CardTypeValueGroup; +import com.server.bbo_gak.domain.card.entity.Tag; import com.server.bbo_gak.domain.recruit.dao.RecruitRepository; import com.server.bbo_gak.domain.recruit.entity.Recruit; import com.server.bbo_gak.domain.user.entity.User; import com.server.bbo_gak.global.error.exception.ErrorCode; import com.server.bbo_gak.global.error.exception.NotFoundException; +import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; @@ -44,6 +48,7 @@ public class CardInRecruitService { private final CardTagRepository cardTagRepository; private final CardImageRepository cardImageRepository; private final CardCopyInfoRepository cardCopyInfoRepository; + private final TagRepository tagRepository; @Transactional(readOnly = true) @@ -57,12 +62,16 @@ public CardTypeCountInRecruitGetResponse getCardTypeCountsInRecruit(User user) { } @Transactional(readOnly = true) - public List getCardListInRecruit(User user, Long recruitId, String cardTypeValue) { + public List getCardListInRecruit(User user, Long recruitId, String cardTypeValue + , List tagIdList) { + + List tagList = tagRepository.findAllById(Optional.ofNullable(tagIdList).orElse(Collections.emptyList())); List cards = cardDao.findAllByUserIdAndCardTypeValue(user, CardTypeValue.findByValue(cardTypeValue), recruitId); return cards.stream() + .filter(card -> tagList.isEmpty() || card.isTagListContain(tagList)) .sorted(Comparator.comparing(Card::getUpdatedDate).reversed()) .map(card -> CardListGetResponse.of(card, card.getCardTagList())) .collect(Collectors.toList()); diff --git a/src/main/java/com/server/bbo_gak/domain/card/service/CardService.java b/src/main/java/com/server/bbo_gak/domain/card/service/CardService.java index 128e0e8..8390dc8 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/service/CardService.java +++ b/src/main/java/com/server/bbo_gak/domain/card/service/CardService.java @@ -8,6 +8,7 @@ import com.server.bbo_gak.domain.card.dto.request.CardContentUpdateRequest; import com.server.bbo_gak.domain.card.dto.request.CardCreateRequest; import com.server.bbo_gak.domain.card.dto.request.CardTitleUpdateRequest; +import com.server.bbo_gak.domain.card.dto.request.CardTypeUpdateRequest; import com.server.bbo_gak.domain.card.dto.response.CardCreateResponse; import com.server.bbo_gak.domain.card.dto.response.CardGetResponse; import com.server.bbo_gak.domain.card.dto.response.CardListGetResponse; @@ -17,11 +18,15 @@ import com.server.bbo_gak.domain.card.entity.CardType; import com.server.bbo_gak.domain.card.entity.CardTypeValue; import com.server.bbo_gak.domain.card.entity.CardTypeValueGroup; +import com.server.bbo_gak.domain.card.entity.Tag; import com.server.bbo_gak.domain.user.entity.User; import com.server.bbo_gak.global.error.exception.ErrorCode; +import com.server.bbo_gak.global.error.exception.InvalidValueException; import com.server.bbo_gak.global.error.exception.NotFoundException; +import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -60,12 +65,22 @@ public CardGetResponse getCardDetail(User user, Long cardId) { } @Transactional(readOnly = true) - public List getCardList(User user, String cardTypeValue) { + public List getCardList(User user, String cardTypeValue, List tagIdList) { + + List tagList = tagRepository.findAllById(Optional.ofNullable(tagIdList).orElse(Collections.emptyList())); List cards = cardDao.findAllByUserIdAndCardTypeValue(user, CardTypeValue.findByValue(cardTypeValue), null); return cards.stream() + .filter(card -> { + + if (tagList.isEmpty()) { + return true; + } + + return card.isTagListContain(tagList); + }) .sorted(Comparator.comparing(Card::getUpdatedDate).reversed()) .map(card -> CardListGetResponse.of(card, card.getCardTagList())) .collect(Collectors.toList()); @@ -77,9 +92,8 @@ public CardCreateResponse createCard(User user, CardCreateRequest cardCreateRequ Card card = cardRepository.save(Card.creatEmptyCard(user)); - List cardTypeList = cardCreateRequest.cardTypeValueList().stream() - .map(cardTypeValue -> new CardType(card, CardTypeValue.findByValue(cardTypeValue))) - .toList(); + List cardTypeList = getValidCardTypeList(cardCreateRequest.cardTypeValueGroup(), card, + cardCreateRequest.cardTypeValueList()); cardTypeRepository.saveAll(cardTypeList); @@ -94,6 +108,24 @@ public CardCreateResponse createCard(User user, CardCreateRequest cardCreateRequ return new CardCreateResponse(card.getId()); } + @Transactional + public void updateCardType(User user, Long cardId, CardTypeUpdateRequest request) { + + Card card = cardRepository.findByIdAndUser(cardId, user) + .orElseThrow(() -> new NotFoundException(ErrorCode.CARD_NOT_FOUND)); + + cardTypeRepository.deleteAll(card.getCardTypeList()); + + List cardTypeList = getValidCardTypeList(request.cardTypeValueGroup(), card, + request.cardTypeValueList()); + + cardTypeRepository.saveAll(cardTypeList); + + // 양방향 연관 관계 고려 메소드 + card.updateCardTypeList(cardTypeList); + } + + @Transactional public void updateCardTitle(User user, Long cardId, CardTitleUpdateRequest request) { @@ -121,4 +153,42 @@ public void deleteCard(User user, Long cardId) { cardTagRepository.deleteAll(card.getCardTagList()); cardRepository.delete(card); } + + private List getValidCardTypeList(String cardTypeValueGroupValue, Card card, + List cardTypeValueList) { + + CardTypeValueGroup cardTypeValueGroup = CardTypeValueGroup.findByValue(cardTypeValueGroupValue); + + List cardTypeList = cardTypeValueList.stream() + .map(cardTypeValue -> new CardType(card, CardTypeValue.findByValue(cardTypeValue))) + .toList(); + + // 내정보에서 카드 생성인 경우 + if (cardTypeValueGroup.equals(CardTypeValueGroup.MY_INFO)) { + + if (cardTypeList.size() > 1) { + throw new InvalidValueException(ErrorCode.MY_INFO_CARD_TYPE_OVERSIZE); + } + + if (!CardTypeValueGroup.MY_INFO.contains(cardTypeList.getFirst().getCardTypeValue())) { + throw new InvalidValueException(ErrorCode.CARD_TYPE_NOT_MATCHED); + } + + return cardTypeList; + } + + // 공고에서 카드 생성인 경우 + if (cardTypeValueGroup.equals(CardTypeValueGroup.RECRUIT)) { + + for (CardType cardType : cardTypeList) { + if (!CardTypeValueGroup.RECRUIT.contains(cardType.getCardTypeValue())) { + throw new InvalidValueException(ErrorCode.CARD_TYPE_NOT_MATCHED); + } + } + + return cardTypeList; + } + + throw new InvalidValueException(ErrorCode.CARD_TYPE_NOT_FOUND); + } } diff --git a/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java b/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java index d85a119..a21c4bc 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java +++ b/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java @@ -25,8 +25,9 @@ public class TagService { private final CardTagRepository cardTagRepository; @Transactional(readOnly = true) - public List getAllTagList() { - return tagRepository.findAll().stream() + public List getAllTagList(User user) { + + return tagRepository.findAllByJob(user.getJob()).stream() .map(TagGetResponse::from) .toList(); } diff --git a/src/main/java/com/server/bbo_gak/domain/user/entity/Job.java b/src/main/java/com/server/bbo_gak/domain/user/entity/Job.java new file mode 100644 index 0000000..b87809e --- /dev/null +++ b/src/main/java/com/server/bbo_gak/domain/user/entity/Job.java @@ -0,0 +1,14 @@ +package com.server.bbo_gak.domain.user.entity; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum Job { + ALL("공통"), + DESIGNER("디자이너"), + DEVELOPER("개발자"); + + private final String value; +} diff --git a/src/main/java/com/server/bbo_gak/domain/user/entity/User.java b/src/main/java/com/server/bbo_gak/domain/user/entity/User.java index 7f50ab4..ad27d37 100644 --- a/src/main/java/com/server/bbo_gak/domain/user/entity/User.java +++ b/src/main/java/com/server/bbo_gak/domain/user/entity/User.java @@ -37,11 +37,15 @@ public class User extends BaseEntity { @Embedded private OauthInfo oauthInfo; + @Enumerated(EnumType.STRING) + private Job job; + // User 생성 팩토리 메서드 public static User from(OauthInfo oauthInfo) { return User.builder() .role(UserRole.USER) .oauthInfo(oauthInfo) + .job(Job.DEVELOPER) .build(); } } diff --git a/src/main/java/com/server/bbo_gak/global/error/exception/ErrorCode.java b/src/main/java/com/server/bbo_gak/global/error/exception/ErrorCode.java index 26ddeb2..067b420 100644 --- a/src/main/java/com/server/bbo_gak/global/error/exception/ErrorCode.java +++ b/src/main/java/com/server/bbo_gak/global/error/exception/ErrorCode.java @@ -32,6 +32,7 @@ public enum ErrorCode { //User USER_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 유저를 찾을 수 없습니다."), + JOB_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 직업을 찾을 수 없습니다"), //Image IMAGE_FILE_EXTENSION_NOT_FOUND(HttpStatus.BAD_REQUEST, "지원하지 않는 파일 확장자입니다."), @@ -40,10 +41,12 @@ public enum ErrorCode { //Card CARD_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 카드를 찾을 수 없습니다"), CARD_TYPE_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 카드 타입을 찾을 수 없습니다"), + CARD_TYPE_VALUE_GROUP_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 카드 타입 그룹(내 정보 or 공고)을 찾을 수 없습니다."), + CARD_TYPE_NOT_MATCHED(HttpStatus.BAD_REQUEST, "카드 타입이 맞지 않습니다"), + MY_INFO_CARD_TYPE_OVERSIZE(HttpStatus.BAD_REQUEST, "내 정보에서는 하나의 카드 타입만 할당 가능합니다."), //Tag TAG_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 태그를 찾을 수 없습니다"), - TAG_DUPLICATED(HttpStatus.BAD_REQUEST, "해당 태그가 이미 추가 돼있습니다."), //Season @@ -53,8 +56,6 @@ public enum ErrorCode { RECRUIT_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 공고를 찾을 수 없습니다"), RECRUIT_STATUS_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 공고 지원 상태를 찾을 수 없습니다"), RECRUIT_SCHEDULE_STAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 공고 일정 단계를 찾을 수 없습니다"), - - CARD_TAG_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 카드와 태그 매핑을 찾을 수 없습니다"), //CardMemo diff --git a/src/main/resources/application-datasource.yml b/src/main/resources/application-datasource.yml index 6118682..741c80f 100644 --- a/src/main/resources/application-datasource.yml +++ b/src/main/resources/application-datasource.yml @@ -11,3 +11,5 @@ spring: properties: hibernate: dialect: org.hibernate.dialect.MySQLDialect + default_batch_fetch_size: 1000 + diff --git a/src/test/java/com/server/bbo_gak/domain/card/controller/CardControllerTest.java b/src/test/java/com/server/bbo_gak/domain/card/controller/CardControllerTest.java index 09ea9c5..ad41fbd 100644 --- a/src/test/java/com/server/bbo_gak/domain/card/controller/CardControllerTest.java +++ b/src/test/java/com/server/bbo_gak/domain/card/controller/CardControllerTest.java @@ -1,6 +1,7 @@ package com.server.bbo_gak.domain.card.controller; import static com.epages.restdocs.apispec.ResourceDocumentation.resource; +import static org.hamcrest.Matchers.hasSize; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -15,6 +16,7 @@ import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import com.epages.restdocs.apispec.ResourceSnippetParameters; @@ -24,12 +26,17 @@ import com.server.bbo_gak.domain.card.dto.request.CardContentUpdateRequest; import com.server.bbo_gak.domain.card.dto.request.CardCreateRequest; import com.server.bbo_gak.domain.card.dto.request.CardTitleUpdateRequest; +import com.server.bbo_gak.domain.card.dto.request.CardTypeUpdateRequest; +import com.server.bbo_gak.domain.card.entity.Card; import com.server.bbo_gak.global.AbstractRestDocsTests; +import com.server.bbo_gak.global.RestDocsFactory; +import jakarta.persistence.EntityManager; import java.util.Arrays; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.restdocs.payload.JsonFieldType; import org.springframework.test.context.ActiveProfiles; @@ -45,9 +52,16 @@ public class CardControllerTest extends AbstractRestDocsTests { private static final String DEFAULT_URL = "/api/v1"; @Autowired private CardRepository cardRepository; + @Autowired private CardTagRepository cardTagRepository; + @Autowired + private RestDocsFactory restDocsFactory; + + @Autowired + private EntityManager entityManager; + @Nested class 카드_타입_카운트_조회 { @@ -105,22 +119,42 @@ class 카드_단건_조회 { class 카드_리스트_조회 { @Test - public void 성공() throws Exception { + public void 성공_태그_필터_없는_케이스() throws Exception { + + mockMvc.perform(get(DEFAULT_URL + "/cards").contentType(MediaType.APPLICATION_JSON) + .queryParam("type", "면접_질문") + .accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", hasSize(2))) + .andDo(document("[select] 카드 리스트 조회", preprocessResponse(prettyPrint()), resource(getBuild()))); + } - mockMvc.perform( - get(DEFAULT_URL + "/cards").contentType(MediaType.APPLICATION_JSON).queryParam("type", "자기소개서") - .accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andDo( - document("[select] 카드 리스트 조회", preprocessResponse(prettyPrint()), resource( - ResourceSnippetParameters.builder().description("카드 리스트 조회").tags("Card") - .queryParameters(parameterWithName("type").description("타입")) - .responseSchema(Schema.schema("CardListGetResponse")) - .responseFields(fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("Card ID"), - fieldWithPath("[].title").type(JsonFieldType.STRING).description("Card 제목"), - fieldWithPath("[].updatedDate").type(JsonFieldType.STRING).description("Card 수정일시"), - fieldWithPath("[].tagList.[].id").type(JsonFieldType.NUMBER).description("태그 ID"), - fieldWithPath("[].tagList.[].name").type(JsonFieldType.STRING).description("태그 이름"), - fieldWithPath("[].tagList.[].type").type(JsonFieldType.STRING).description("태그 타입")) - .build()))); + @Test + public void 성공_태그_필터_존재_하는_케이스() throws Exception { + + mockMvc.perform(get(DEFAULT_URL + "/cards").contentType(MediaType.APPLICATION_JSON) + .queryParam("type", "면접_질문") + .queryParam("tag-ids", "1") + .accept(MediaType.APPLICATION_JSON) + ) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", hasSize(1))) + .andDo(document("[select] 카드 리스트 조회", preprocessResponse(prettyPrint()), resource(getBuild()))); + } + + private ResourceSnippetParameters getBuild() { + return ResourceSnippetParameters.builder().description("카드 리스트 조회").tags("Card") + .queryParameters( + parameterWithName("type").description("타입"), + parameterWithName("tag-ids").description("태그 아이디 리스트").optional()) + .responseSchema(Schema.schema("CardListGetResponse")) + .responseFields(fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("Card ID"), + fieldWithPath("[].title").type(JsonFieldType.STRING).description("Card 제목"), + fieldWithPath("[].updatedDate").type(JsonFieldType.STRING).description("Card 수정일시"), + fieldWithPath("[].tagList.[].id").type(JsonFieldType.NUMBER).description("태그 ID"), + fieldWithPath("[].tagList.[].name").type(JsonFieldType.STRING).description("태그 이름"), + fieldWithPath("[].tagList.[].type").type(JsonFieldType.STRING).description("태그 타입")) + .build(); } } @@ -128,7 +162,8 @@ class 카드_리스트_조회 { @Nested class 카드_신규_생성 { - CardCreateRequest request = new CardCreateRequest(Arrays.asList("경험_정리", "자기소개서"), Arrays.asList(1L, 2L)); + CardCreateRequest request = new CardCreateRequest(Arrays.asList("경험_정리"), Arrays.asList(1L, 2L), + "내_정보"); @Test @Transactional @@ -139,14 +174,45 @@ class 카드_신규_생성 { .andExpect(status().isOk()).andDo(document("[create] 카드 신규 생성", preprocessResponse(prettyPrint()), resource(ResourceSnippetParameters.builder().description("카드 신규 생성").tags("Card") .requestSchema(Schema.schema("CardCreateRequest")) - .requestFields(fieldWithPath("cardTypeValueList").type(JsonFieldType.ARRAY).description("카드 타입값"), - fieldWithPath("tagIdList").type(JsonFieldType.ARRAY).description("태그 ID")) + .requestFields( + fieldWithPath("cardTypeValueList").type(JsonFieldType.ARRAY).description("카드 타입값"), + fieldWithPath("tagIdList").type(JsonFieldType.ARRAY).description("태그 ID"), + fieldWithPath("cardTypeValueGroup").type(JsonFieldType.STRING) + .description("카드 타입 그룹값(내_정보 or 공고)") + ) .responseSchema(Schema.schema("CardCreateResponse")) .responseFields(fieldWithPath("cardId").type(JsonFieldType.NUMBER).description("Card ID")) .build()))); } } + @Nested + class 카드_타입_수정 { + + + @Test + @Transactional + public void 성공() throws Exception { + + String expectedCardTypeValue = "면접_질문"; + CardTypeUpdateRequest request = new CardTypeUpdateRequest(Arrays.asList(expectedCardTypeValue), "내_정보"); + + mockMvc.perform( + restDocsFactory.createRequest(DEFAULT_URL + "/cards/{card-id}/card-type", request, HttpMethod.PUT, + objectMapper, 1L)) + .andExpect(status().isOk()) + .andDo(restDocsFactory.getSuccessResource("[카드_타입_수정] 성공", "카드_타입_수정", "Card", request, null)); + + Card card = cardRepository.findById(1L).get(); + + String actualCardTypeValue = card.getCardTypeList().getFirst().getCardTypeValue().getValue(); + + System.out.println(card.getCardTypeList().size()); + assertEquals(expectedCardTypeValue, actualCardTypeValue); + + } + } + @Nested class 카드_제목_수정 { diff --git a/src/test/java/com/server/bbo_gak/domain/card/controller/CardInRecruitControllerTest.java b/src/test/java/com/server/bbo_gak/domain/card/controller/CardInRecruitControllerTest.java index 680d3d9..0d5440a 100644 --- a/src/test/java/com/server/bbo_gak/domain/card/controller/CardInRecruitControllerTest.java +++ b/src/test/java/com/server/bbo_gak/domain/card/controller/CardInRecruitControllerTest.java @@ -1,24 +1,29 @@ package com.server.bbo_gak.domain.card.controller; +import static com.epages.restdocs.apispec.ResourceDocumentation.resource; import static org.hamcrest.Matchers.hasSize; +import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; +import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; +import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import com.fasterxml.jackson.core.type.TypeReference; +import com.epages.restdocs.apispec.ResourceSnippetParameters; +import com.epages.restdocs.apispec.Schema; import com.server.bbo_gak.domain.card.dao.CardCopyInfoRepository; import com.server.bbo_gak.domain.card.dao.CardRepository; import com.server.bbo_gak.domain.card.dto.response.CardCreateResponse; -import com.server.bbo_gak.domain.card.dto.response.CardListGetResponse; import com.server.bbo_gak.domain.card.dto.response.CardTypeCountInRecruitGetResponse; import com.server.bbo_gak.global.AbstractRestDocsTests; import com.server.bbo_gak.global.RestDocsFactory; -import java.util.List; -import org.assertj.core.util.Lists; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpMethod; +import org.springframework.restdocs.payload.JsonFieldType; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.jdbc.Sql; import org.springframework.test.web.servlet.ResultActions; @@ -69,20 +74,44 @@ class 카드_타입_카운트_조회_공고에서 { class 카드_리스트_조회_공고에서 { @Test - public void 성공() throws Exception { + public void 성공_태그_필터_없는_케이스() throws Exception { mockMvc.perform( - restDocsFactory.createRequest(DEFAULT_URL + "/recruits/{recruit-id}/cards?type=인터뷰_준비", null, - HttpMethod.GET, objectMapper, 1L)) + restDocsFactory.createRequest(DEFAULT_URL + "/recruits/{recruit-id}/cards", null, + HttpMethod.GET, objectMapper, 1L) + .queryParam("type", "인터뷰_준비") + .queryParam("tag-ids", "4")) .andExpect(status().isOk()) - .andDo( - result -> - restDocsFactory.getSuccessResourceList("[카드_리스트_조회_공고에서] 성공", "카드_리스트_조회_공고에서", cardInRecruit, - Lists.list(), objectMapper.readValue(result.getResponse().getContentAsString(), - new TypeReference>() { - })) - .handle(result)) - .andExpect(jsonPath("$", hasSize(3))); + .andExpect(jsonPath("$", hasSize(1))) + .andDo(document("[카드_리스트_조회_공고에서] 성공", preprocessResponse(prettyPrint()), resource(getBuild()))); + } + + @Test + public void 성공_태그_필터_존재_하는_케이스() throws Exception { + + mockMvc.perform( + restDocsFactory.createRequest(DEFAULT_URL + "/recruits/{recruit-id}/cards", null, + HttpMethod.GET, objectMapper, 1L) + .queryParam("type", "인터뷰_준비")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", hasSize(3))) + .andDo(document("[카드_리스트_조회_공고에서] 성공", preprocessResponse(prettyPrint()), resource(getBuild()))); + } + + private ResourceSnippetParameters getBuild() { + return ResourceSnippetParameters.builder().description("카드 리스트 조회").tags(cardInRecruit) + .queryParameters( + parameterWithName("type").description("타입"), + parameterWithName("tag-ids").description("태그 아이디 리스트").optional()) + .responseSchema(Schema.schema("CardListGetResponse")) + .responseFields(fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("Card ID"), + fieldWithPath("[].title").type(JsonFieldType.STRING).description("Card 제목"), + fieldWithPath("[].updatedDate").type(JsonFieldType.STRING).description("Card 수정일시"), + fieldWithPath("[].tagList").type(JsonFieldType.ARRAY).description("태그 리스트").optional(), + fieldWithPath("[].tagList.[].id").type(JsonFieldType.NUMBER).description("태그 ID"), + fieldWithPath("[].tagList.[].name").type(JsonFieldType.STRING).description("태그 이름"), + fieldWithPath("[].tagList.[].type").type(JsonFieldType.STRING).description("태그 타입")) + .build(); } } diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index e600dc5..075d1ee 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -15,6 +15,7 @@ spring: show_sql: true format_sql: true dialect: org.hibernate.dialect.H2Dialect + default_batch_fetch_size: 1000 cloud: aws: diff --git a/src/test/resources/auth-test-data.sql b/src/test/resources/auth-test-data.sql index c78c818..531a29a 100644 --- a/src/test/resources/auth-test-data.sql +++ b/src/test/resources/auth-test-data.sql @@ -17,12 +17,12 @@ from recruit_season; delete from users; -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', 'email', 'test', 'test', - 'test123', 'USER'); + 'test123', 'USER', 'DEVELOPER'); -INSERT INTO users( deleted, created_at, update_at, user_id, dtype, role, oauth_id, name, email, provider) -VALUES(false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 2, 'User', 'USER', 'oauthId', 'name', 'email', 'GOOGLE'); +INSERT INTO users( deleted, created_at, update_at, user_id, dtype, role, oauth_id, name, email, provider, job) +VALUES(false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 2, 'User', 'USER', 'oauthId', 'name', 'email', 'GOOGLE', 'DEVELOPER'); INSERT INTO refresh_token (id, token) VALUES (1, 'abcd1234'); diff --git a/src/test/resources/card-test-data.sql b/src/test/resources/card-test-data.sql index 1a1cd1a..765379b 100644 --- a/src/test/resources/card-test-data.sql +++ b/src/test/resources/card-test-data.sql @@ -1,6 +1,6 @@ -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', 'test', 'test', 'test', - 'test', 'USER'); + 'test', 'USER', 'DEVELOPER'); INSERT INTO recruit_season (recruit_season_id, name, user_id) VALUES (1, 'test', 1); @@ -31,12 +31,14 @@ INSERT INTO card (deleted, copy_flag, access_time, card_id, created_at, update_a VALUES (false, true, '2024-07-24 21:22:04.000000', 6, '2024-07-24 21:22:07.000000', '2024-07-24 21:22:08.000000', 1, 'test_contents', 'test_title', 1); -INSERT INTO tag (tag_id, name, tag_type, deleted, update_at, created_at) -VALUES (1, '스프링', 'CAPABILITY', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); -INSERT INTO tag (tag_id, name, tag_type, deleted, update_at, created_at) -VALUES (2, '리액트', 'CAPABILITY', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); -INSERT INTO tag (tag_id, name, tag_type, deleted, update_at, created_at) -VALUES (3, '봉사활동', 'PERSONALITY', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); +INSERT INTO tag (tag_id, name, tag_type, job, deleted, update_at, created_at) +VALUES (1, '스프링', 'CAPABILITY', 'DEVELOPER', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); +INSERT INTO tag (tag_id, name, tag_type, job, deleted, update_at, created_at) +VALUES (2, '리액트', 'CAPABILITY', 'DEVELOPER', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); +INSERT INTO tag (tag_id, name, tag_type, job, deleted, update_at, created_at) +VALUES (3, '알고리즘', 'CAPABILITY', 'DEVELOPER', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); +INSERT INTO tag (tag_id, name, tag_type, job, deleted, update_at, created_at) +VALUES (4, '봉사활동', 'PERSONALITY', 'DESIGNER', false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); INSERT INTO card_type (card_type_id, card_type_value, card_id, deleted, update_at, created_at) VALUES (1, 'EXPERIENCE', 1, false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'); @@ -76,7 +78,17 @@ VALUES (false, 1, 1, '2024-07-24 21:26:28.000000', 1, '2024-07-24 21:26:40.00000 INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) VALUES (false, 1, 2, '2024-07-24 21:26:29.000000', 2, '2024-07-24 21:26:41.000000'); INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) -VALUES (false, 2, 3, '2024-07-24 21:26:31.000000', 2, '2024-07-24 21:26:42.000000'); +VALUES (false, 2, 3, '2024-07-24 21:26:28.000000', 2, '2024-07-24 21:26:40.000000'); +INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) +VALUES (false, 2, 4, '2024-07-24 21:26:29.000000', 3, '2024-07-24 21:26:41.000000'); +INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) +VALUES (false, 3, 5, '2024-07-24 21:26:31.000000', 2, '2024-07-24 21:26:42.000000'); +INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) +VALUES (false, 3, 6, '2024-07-24 21:26:31.000000', 3, '2024-07-24 21:26:42.000000'); +INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) +VALUES (false, 4, 7, '2024-07-24 21:26:31.000000', 4, '2024-07-24 21:26:42.000000'); +INSERT INTO card_tag (deleted, card_id, card_tag_id, created_at, tag_id, update_at) +VALUES (false, 4, 8, '2024-07-24 21:26:31.000000', 4, '2024-07-24 21:26:42.000000'); INSERT INTO card_memo (deleted, card_id, card_memo_id, created_at, content, update_at) VALUES (false, 1, 1, '2024-07-24 21:26:31.000000', 'test contents 111', '2024-07-24 21:26:42.000000'); diff --git a/src/test/resources/image-test-data.sql b/src/test/resources/image-test-data.sql index ba019e1..d8296b0 100644 --- a/src/test/resources/image-test-data.sql +++ b/src/test/resources/image-test-data.sql @@ -1,5 +1,4 @@ -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', null, 'test', 'test', - 'test', - 'USER'); + 'test', 'USER', 'DEVELOPER'); diff --git a/src/test/resources/notification-test-data.sql b/src/test/resources/notification-test-data.sql index 3f50a07..c3482d0 100644 --- a/src/test/resources/notification-test-data.sql +++ b/src/test/resources/notification-test-data.sql @@ -1,7 +1,6 @@ -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', null, 'test', 'test', - 'test', - 'USER'); + 'test', 'USER', 'DEVELOPER'); -- 다음으로 recruit_season 테이블에 데이터를 삽입합니다. INSERT INTO recruit_season (recruit_season_id, name, user_id, deleted, update_at, created_at) diff --git a/src/test/resources/recruit-test-data.sql b/src/test/resources/recruit-test-data.sql index 8f4176b..63e64c4 100644 --- a/src/test/resources/recruit-test-data.sql +++ b/src/test/resources/recruit-test-data.sql @@ -1,10 +1,10 @@ -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', 'test', 'test', 'test', - 'test', 'USER'), + 'test', 'USER', 'DEVELOPER'), (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 2, 'AuthTestUser', 'test', 'test', 'test', - 'test', 'USER'), + 'test', 'USER', 'DEVELOPER'), (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 3, 'AuthTestUser', 'test', 'test', 'test', - 'test', 'USER') + 'test', 'USER', 'DEVELOPER') ; -- Season 테이블에 데이터 삽입 diff --git a/src/test/resources/season-test-data.sql b/src/test/resources/season-test-data.sql index 4c99857..8d37979 100644 --- a/src/test/resources/season-test-data.sql +++ b/src/test/resources/season-test-data.sql @@ -1,8 +1,8 @@ -INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role) +INSERT INTO users (deleted, created_at, update_at, user_id, dtype, email, login_id, name, password, role, job) VALUES (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 1, 'AuthTestUser', 'email', 'test', 'test', - 'test123', 'USER'), + 'test123', 'USER', 'DEVELOPER'), (false, '2024-07-24 21:27:20.000000', '2024-07-24 21:27:21.000000', 2, 'AuthTestUser', 'email', 'test', 'test', - 'test123', 'USER'); + 'test123', 'USER', 'DEVELOPER'); INSERT INTO recruit_season (recruit_season_id, name, user_id, deleted, update_at, created_at) VALUES (1, '2024 상반기', 2, false, '2024-07-24 21:26:28.000000', '2024-07-24 21:26:28.000000'),