Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ› [Bug] [Refactoring] 6๊ธฐ Party ์„œ๋น„์Šค ์ „์ฒด ๋ฆฌํŒฉํ† ๋ง ์ค‘ ์ฐพ์€ ๋ฒ„๊ทธ๋“ค ์ˆ˜์ • #779

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class CategoryListResDto {
private List<CategoryResDto> categoryList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class CommentResDto {
private Long commentId;
private String nickname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class LeaveRoomResDto {
private String nickname;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomCreateResDto {
private Long roomId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomDetailResDto {
private Long roomId;
private String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomJoinResDto {
private Long roomId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomListResDto {
private List<RoomResDto> roomList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomResDto {
private Long roomId;
private String categoryName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class RoomStartResDto {
private Long roomId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
@Getter
@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED)
public class UserRoomResDto {
private Long roomUserId;
private String nickname;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package gg.party.api.user.room.service;

import java.util.Collections;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.transaction.Transactional;

import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import gg.data.party.Room;
import gg.data.party.UserRoom;
Expand Down Expand Up @@ -38,18 +36,28 @@ public class RoomFindService {
* ์‹œ์ž‘ํ•˜์ง€ ์•Š์€ ๋ฐฉ๊ณผ ์‹œ์ž‘ํ•œ ๋ฐฉ์„ ๋ชจ๋‘ ์กฐํšŒํ•œ๋‹ค
* @return ์‹œ์ž‘ํ•˜์ง€ ์•Š์€ ๋ฐฉ (์ตœ์‹ ์ˆœ) + ์‹œ์ž‘ํ•œ ๋ฐฉ(๋๋‚˜๋Š” ์‹œ๊ฐ„์ด ๋น ๋ฅธ ์ˆœ) ์ „์ฒด List
*/
@Transactional
@Transactional(readOnly = true)
public RoomListResDto findRoomList() {
Sort sortForNotStarted = Sort.by("createdAt").descending();
Sort sortForStarted = Sort.by("startDate").descending();
List<RoomType> statuses = Arrays.asList(RoomType.OPEN, RoomType.START, RoomType.FINISH);
List<Room> rooms = roomRepository.findByStatusIn(statuses);

List<Room> notStartedRooms = roomRepository.findByStatus(RoomType.OPEN, sortForNotStarted);
List<Room> startedRooms = roomRepository.findByStatus(RoomType.START, sortForStarted);
List<Room> finishRooms = roomRepository.findByStatus(RoomType.FINISH, sortForStarted);
List<Room> openRooms = rooms.stream()
.filter(room -> room.getStatus() == RoomType.OPEN)
.sorted(Comparator.comparing(Room::getCreatedAt).reversed())
.collect(Collectors.toList());

List<Room> limitedFinishRooms = finishRooms.stream().limit(10).collect(Collectors.toList());
List<Room> startRooms = rooms.stream()
.filter(room -> room.getStatus() == RoomType.START)
.sorted(Comparator.comparing(Room::getStartDate).reversed())
.collect(Collectors.toList());

List<Room> finishRooms = rooms.stream()
.filter(room -> room.getStatus() == RoomType.FINISH)
.sorted(Comparator.comparing(Room::getStartDate).reversed())
.limit(10)
.collect(Collectors.toList());

List<Room> combinedRooms = Stream.of(notStartedRooms, startedRooms, limitedFinishRooms)
List<Room> combinedRooms = Stream.of(openRooms, startRooms, finishRooms)
.flatMap(List::stream)
.collect(Collectors.toList());

Expand All @@ -62,43 +70,48 @@ public RoomListResDto findRoomList() {

/**
* ํ˜„์žฌ ์ฐธ์—ฌ์ค‘์ธ ๋ฐฉ์„ ๋ชจ๋‘ ์กฐํšŒํ•œ๋‹ค(๋งŒ๋“  ๋ฐฉ ํฌํ•จ)
* ์‹œ์ž‘ํ•œ ๋ฐฉ ๋’ค์— ์‹œ์ž‘ํ•˜์ง€ ์•Š์€ ๋ฐฉ์ด ์˜ค๊ฒŒ ์ž‘์„ฑ
* @param userId ์ž์‹ ์˜ id
* @return ์ฐธ์—ฌํ•œ ๋ฐฉ ์ „์ฒด List
*/
@Transactional
@Transactional(readOnly = true)
public RoomListResDto findJoinedRoomList(Long userId) {
List<UserRoom> userRooms = userRoomRepository.findByUserId(userId);
List<Room> joinedRooms = userRooms.stream()
.map(UserRoom::getRoom)
.collect(Collectors.toList());

Collections.sort(joinedRooms, Comparator.comparing(Room::getDueDate));
List<Room> openRoom = joinedRooms.stream()
.filter(room -> room.getStatus() == RoomType.OPEN)
.sorted(Comparator.comparing(Room::getDueDate))
.collect(Collectors.toList());

List<Room> playingRoom = joinedRooms.stream()
.filter(room -> room.getStatus() == RoomType.OPEN || room.getStatus() == RoomType.START)
List<Room> startRoom = joinedRooms.stream()
.filter(room -> room.getStatus() == RoomType.START)
.sorted(Comparator.comparing(Room::getStartDate))
.collect(Collectors.toList());

Collections.sort(playingRoom, Comparator.comparing(Room::getDueDate));
startRoom.addAll(openRoom);

List<RoomResDto> roomListResDto = playingRoom.stream()
List<RoomResDto> roomListResDto = openRoom.stream()
.map(RoomResDto::new)
.collect(Collectors.toList());

return new RoomListResDto(roomListResDto);
}

/**
* ์‹œ๊ฐ„์ด ์ง€๋‚˜ ๋ณด์ด์ง€ ์•Š๊ฒŒ ๋œ ๋‚ด๊ฐ€ ํ”Œ๋ ˆ์ดํ•œ(์‹œ์ž‘ํ•œ) ๋ฐฉ์„ ๋ชจ๋‘ ์กฐํšŒํ•œ๋‹ค
* ์‹œ๊ฐ„์ด ์ง€๋‚˜ ๋ณด์ด์ง€ ์•Š๊ฒŒ ๋œ ๋‚ด๊ฐ€ ํ”Œ๋ ˆ์ดํ•œ(FINISH) ๋ฐฉ์„ ๋ชจ๋‘ ์กฐํšŒํ•œ๋‹ค
* @param userId ์ž์‹ ์˜ id
* user_room db์—์„œ ์ž์‹ ์˜ id์™€ isExist์ด true(๋‚˜๊ฐ€์ง€ ์•Š์•˜์Œ)
* ์ด๋ฉด์„œ status๊ฐ€ FINISH์ธ ๊ฒฝ์šฐ๋ฅผ ๋งˆ๊ฐ๊ธฐํ•œ ์ตœ์‹ ์ˆœ์œผ๋กœ ์ •๋ ฌ
* @return ๋๋‚œ ๋ฐฉ ์ „์ฒด List
* isExist์ด true(๋‚˜๊ฐ€์ง€ ์•Š์•˜์Œ)์ด๋ฉด์„œ status๊ฐ€ FINISH์ธ ๊ฒฝ์šฐ
* @return ์‹œ์ž‘์‹œ๊ฐ„์œผ๋กœ ์ •๋ ฌ๋œ ๋๋‚œ ๋ฐฉ ์ „์ฒด List
*/
@Transactional
@Transactional(readOnly = true)
public RoomListResDto findMyHistoryRoomList(Long userId) {
List<Room> finishRooms = userRoomRepository.findFinishRoomsByUserId(userId, RoomType.FINISH);
List<Room> finishRooms = userRoomRepository.findByUserIdAndStatusAndIsExistTrue(userId, RoomType.FINISH);

List<RoomResDto> roomListResDto = finishRooms.stream()
.sorted(Comparator.comparing(Room::getStartDate))
.map(RoomResDto::new)
.collect(Collectors.toList());

Expand All @@ -110,11 +123,11 @@ public RoomListResDto findMyHistoryRoomList(Long userId) {
* @param userId ์ž์‹ ์˜ id
* @param roomId ๋ฐฉ id
* @return ๋ฐฉ ์ƒ์„ธ์ •๋ณด dto
* @throws RoomNotFoundException ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฐฉ ์ž…๋ ฅ
* @throws RoomReportedException ์‹ ๊ณ  ๋ฐ›์€ ๋ฐฉ ์ฒ˜๋ฆฌ | ์‹œ์ž‘ํ•œ ๋ฐฉ๋„ ๋ณผ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์•ผํ•˜๋ฏ€๋กœ ๋ณ„๋„์ฒ˜๋ฆฌ
* @throws RoomNotFoundException ์œ ํšจํ•˜์ง€ ์•Š์€ ๋ฐฉ ์ž…๋ ฅ - 404
* @throws RoomReportedException ์‹ ๊ณ  ๋ฐ›์€ ๋ฐฉ ์ฒ˜๋ฆฌ - 403
* ์ต๋ช…์„ฑ์„ ์ง€ํ‚ค๊ธฐ ์œ„ํ•ด nickname์„ ๋ฆฌํ„ด
*/
@Transactional
@Transactional(readOnly = true)
public RoomDetailResDto findRoomDetail(Long userId, Long roomId) {
Room room = roomRepository.findById(roomId).orElseThrow(RoomNotFoundException::new);
if (room.getStatus() == RoomType.HIDDEN) {
Expand All @@ -125,37 +138,37 @@ public RoomDetailResDto findRoomDetail(Long userId, Long roomId) {

String myNickname = null;
if (userRoomOptional.isPresent()) {
UserRoom userRoom = userRoomOptional.get();
myNickname = userRoom.getNickname();
myNickname = userRoomOptional.get().getNickname();
}

Optional<UserRoom> hostUserRoomOptional = userRoomRepository.findByUserIdAndRoomIdAndIsExistTrue(
room.getHost().getId(), roomId);
String hostNickname = hostUserRoomOptional.get().getNickname();
Optional<UserRoom> hostUserRoom = userRoomRepository.findByUserIdAndRoomIdAndIsExistTrue(room.getHost().getId(),
roomId);
String hostNickname = hostUserRoom.get().getNickname();

if ((room.getStatus() == RoomType.START || room.getStatus() == RoomType.FINISH)
&& userRoomOptional.isPresent()) {
List<UserRoomResDto> roomUsers = userRoomRepository.findByRoomIdAndIsExistTrue(roomId).stream()
.map(userRoom -> new UserRoomResDto(userRoom, userRoom.getUser().getIntraId(),
userRoom.getUser().getImageUri()))
.collect(Collectors.toList());

List<CommentResDto> comments = commentRepository.findAllWithCommentFetchJoin(roomId).stream()
.filter(comment -> !comment.isHidden())
.map(comment -> new CommentResDto(comment, comment.getUser().getIntraId()))
.collect(Collectors.toList());

List<UserRoomResDto> roomUsers = userRoomRepository.findByRoomId(roomId).stream()
.filter(UserRoom::getIsExist)
.map(userRoom -> new UserRoomResDto(userRoom, userRoom.getUser().getIntraId(),
userRoom.getUser().getImageUri()))
.collect(Collectors.toList());
return new RoomDetailResDto(room, myNickname, hostNickname, roomUsers, comments);
} else { // if ์ฐธ์—ฌ์ž && Start or Finish ์ƒํƒœ์ธ ๊ฒฝ์šฐ intraID || else intraId == null
} else { // if ์ฐธ์—ฌ์ž && Start or Finish ์ƒํƒœ์ธ ๊ฒฝ์šฐ intraID ์ œ๊ณต || else intraId == null
List<UserRoomResDto> roomUsers = userRoomRepository.findByRoomIdAndIsExistTrue(roomId).stream()
.map(UserRoomResDto::new)
.collect(Collectors.toList());

List<CommentResDto> comments = commentRepository.findAllWithCommentFetchJoin(roomId).stream()
.filter(comment -> !comment.isHidden())
.map(CommentResDto::new)
.collect(Collectors.toList());

List<UserRoomResDto> roomUsers = userRoomRepository.findByRoomId(roomId).stream()
.filter(UserRoom::getIsExist)
.map(UserRoomResDto::new)
.collect(Collectors.toList());
return new RoomDetailResDto(room, myNickname, hostNickname, roomUsers, comments);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@ public LeaveRoomResDto modifyLeaveRoom(Long roomId, UserDto user) {
UserRoom targetUserRoom = userRoomRepository.findByUserAndRoom(userRepository.findById(user.getId()).get(),
targetRoom).orElseThrow(RoomNotParticipantException::new);

// ๋ชจ๋‘ ๋‚˜๊ฐˆ ๋•Œ ๋ฐฉ fail์ฒ˜๋ฆฌ
if (targetRoom.getCurrentPeople() == 1) {
targetRoom.updateCurrentPeople(0);
targetRoom.updateRoomStatus(RoomType.FAIL);
targetUserRoom.updateIsExist(false);
roomRepository.save(targetRoom);
userRoomRepository.save(targetUserRoom);
return new LeaveRoomResDto(targetUserRoom.getNickname());
}

targetRoom.updateCurrentPeople(targetRoom.getCurrentPeople() - 1);
targetUserRoom.updateIsExist(false);

Expand All @@ -124,8 +114,17 @@ public LeaveRoomResDto modifyLeaveRoom(Long roomId, UserDto user) {
targetRoom.updateHost(null);
}
}
userRoomRepository.save(targetUserRoom);

// ๋ชจ๋‘ ๋‚˜๊ฐˆ ๋•Œ ๋ฐฉ fail์ฒ˜๋ฆฌ
if (targetRoom.getCurrentPeople() == 0) {
targetRoom.updateRoomStatus(RoomType.FAIL);
roomRepository.save(targetRoom);
userRoomRepository.save(targetUserRoom);
return new LeaveRoomResDto(targetUserRoom.getNickname());
}

roomRepository.save(targetRoom);
userRoomRepository.save(targetUserRoom);

return new LeaveRoomResDto(targetUserRoom.getNickname());
}
Expand All @@ -136,27 +135,27 @@ public LeaveRoomResDto modifyLeaveRoom(Long roomId, UserDto user) {
* @param roomId, user
* @return ๋ฐฉ id
* @throws RoomNotFoundException ๋ฐฉ ์—†์Œ - 404
* @throws RoomNotOpenException ๋ฐฉ์ด ์—ด๋ฆฌ์ง€ ์•Š์€ ์ƒํƒœ - 400
* @throws RoomNotEnoughPeopleException ๋ฐฉ์— ์ถฉ๋ถ„ํ•œ ์ธ์›์ด ์—†์Œ - 400
* @throws RoomNotParticipantException ๋ฐฉ์— ์ฐธ๊ฐ€ํ•˜์ง€ ์•Š์€ ์œ ์ € - 400
* @throws UserNotHostException ๋ฐฉ์žฅ์ด ์•„๋‹Œ ๊ฒฝ์šฐ - 403
* @throws RoomNotOpenException ๋ฐฉ์ด ์—ด๋ฆฌ์ง€ ์•Š์€ ์ƒํƒœ - 400
* @throws RoomNotEnoughPeopleException ๋ฐฉ์— ์ถฉ๋ถ„ํ•œ ์ธ์›์ด ์—†์Œ - 400
*/
@Transactional
public RoomStartResDto modifyStartRoom(Long roomId, UserDto user) {
Room targetRoom = roomRepository.findById(roomId)
.orElseThrow(RoomNotFoundException::new);
if (!targetRoom.getStatus().equals(RoomType.OPEN)) {
throw new RoomNotOpenException();
}
if (targetRoom.getMinPeople() > targetRoom.getCurrentPeople()
|| targetRoom.getMaxPeople() < targetRoom.getCurrentPeople()) {
throw new RoomNotEnoughPeopleException();
}
UserRoom targetUserRoom = userRoomRepository.findByUserAndRoom(userRepository.findById(user.getId()).get(),
targetRoom).orElseThrow(RoomNotParticipantException::new);
if (targetRoom.getHost() != targetUserRoom.getUser()) {
throw new UserNotHostException();
}
if (!targetRoom.getStatus().equals(RoomType.OPEN)) {
throw new RoomNotOpenException();
}
if (targetRoom.getMinPeople() > targetRoom.getCurrentPeople()) {
throw new RoomNotEnoughPeopleException();
}

targetRoom.updateRoomStatus(RoomType.START);
List<User> users = userRoomRepository.findByIsExist(roomId);
targetRoom.startRoom(LocalDateTime.now());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

import java.util.Random;

/*
* ์ต๋ช… ๋‹‰๋„ค์ž„์„ ๋งŒ๋“œ๋Š” ํด๋ž˜์Šค์ž…๋‹ˆ๋‹ค.
* PREFIX์™€ SUFFIX ๋ฐฐ์—ด์—์„œ ๋žœ๋ค์œผ๋กœ ๋‹จ์–ด๋ฅผ ์„ ํƒํ•˜์—ฌ ์กฐํ•ฉํ•ฉ๋‹ˆ๋‹ค.
* ๋‘˜ ์ค‘ ์ค‘๋ณต๋˜๋Š” ์š”์†Œ๋„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. ex) ์šฉ๊ฐํ•œ int, ์šฉ๊ฐํ•œ string์ด ๊ณต์กดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
* ์ตœ๋Œ€ 4๊ธ€์ž || 7๊ธ€์ž๋กœ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
*/
public class GenerateRandomNickname {
private String nickname;

private static final String[] PREFIX = {"์šฉ๊ฐํ•œ", "๋Œ€๋‹ดํ•œ", "๋ฐ์€", "๋›ฐ์–ด๋‚œ", "์พŒํ™œํ•œ", "์˜๋ฆฌํ•œ", "๋„๋ง๊ฐ€๋Š”",
private static final String[] PREFIX = {"์šฉ๊ฐํ•œ", "๋Œ€๋‹ดํ•œ", "๋ฐ์€", "๋›ฐ์–ด๋‚œ", "์พŒํ™œํ•œ", "์˜๋ฆฌํ•œ", "๋„๋ง๊ฐ€๋Š”", "๋“ ๋“ ํ•œ",
"๋Œ€๋‹ดํ•œ", "์—ด์‹ฌ์ธ", "ํž˜์ฐฌ", "๋ถˆ๊ฐ™์€", "์‹ ์„ ํ•œ", "๊ด€๋Œ€ํ•œ", "์œ ์พŒํ•œ", "ํ–‰๋ณตํ•œ", "ํฌ๋ง์ฐฌ", "๋ช…๋ž‘ํ•œ", "์นœ์ ˆํ•œ", "ํ™œ๊ธฐ์ฐฌ",
"์ฐฉํ•œ", "์ด์ƒํ•œ", "์ž๋ž‘์Šค๋Ÿฌ์šด", "๋น ๋ฅธ", "์•ˆ๋„ํ•˜๋Š”", "์ˆ˜์ค์€", "์–ด๋ฆฌ์„์€", "๊ฐ•ํ•œ", "๊ฐ์‚ฌํ•˜๋Š”", "ํž˜๋“ ", "์šฉ๊ฐํ•œ", "์—ด์ •์ ์ธ",
"์ฐฉํ•œ", "์ด์ƒํ•œ", "๋น ๋ฅธ", "์•ˆ๋„ํ•˜๋Š”", "์ˆ˜์ค์€", "์–ด๋ฆฌ์„์€", "๊ฐ•ํ•œ", "๊ฐ์‚ฌํ•˜๋Š”", "ํž˜๋“ ", "์šฉ๊ฐํ•œ", "์—ด์ •์ ์ธ", "์กธ๋ฆฐ",
"๋˜‘๋˜‘ํ•œ", "์ฆ๊ฑฐ์šด", "๊ต‰์žฅํ•œ", "๊ณ ์ˆ˜", "์—„์ฒญ๋‚œ", "๋œฌ๊ธˆ์—†๋Š”", "์ถฉ๋ฌด๊ณต", "์ œ๋„ˆ๋Ÿด", "์— ํŽ˜๋Ÿฌ", "๋งˆ์ œ์Šคํ‹ฐ", "ํŒํƒ€์Šคํ‹ฑ", "๋ ˆ์ „๋”๋ฆฌ",
"๋จผ์น˜ํ‚จ", "๋‹คํฌํ˜ธ์Šค", "์Šˆํผ๋ฃจํ‚ค", "์—˜๋ฆฌํŠธ", "์ •์ ", "์ „๊ตํšŒ์žฅ", "๋ฒ ํ…Œ๋ž‘"};
"๋จผ์น˜ํ‚จ", "๋‹คํฌํ˜ธ์Šค", "์Šˆํผ๋ฃจํ‚ค", "์—˜๋ฆฌํŠธ", "์ •์ ", "์ „๊ตํšŒ์žฅ", "๋ฒ ํ…Œ๋ž‘", "ํ‚น", "ํ€ธ", "์ฑ”ํ”ผ์–ธ"};

private static final String[] SUFFIX = {"list", "vector", "string", "boolean", "number", "object", "array",
"set", "map", "date", "function", "null", "undefined", "buffer", "json", "error", "stack", "queue", "deque",
"tree", "graph", "pair", "int", "char", "float", "double", "long", "longlong", "size_t", "short", "struct"};
private static final String[] SUFFIX = {"list", "vector", "string", "bool", "number", "object", "array",
"set", "map", "date", "null", "buffer", "json", "error", "stack", "queue", "deque", "struct", "tree",
"graph", "pair", "int", "char", "float", "double", "long", "size_t", "short", "byte", "bit", "pointer"};

public static String generateRandomNickname() {
Random random = new Random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class TemplateController {
private final TemplateService templateService;

/**
* ํƒฌํ”Œ๋ฆฟ ๋ชฉ๋ก์„ ์กฐํšŒํ•œ๋‹ค
* @return ํƒฌํ”Œ๋ฆฟ ์ „์ฒด List
* ํ…œํ”Œ๋ฆฟ ์ „์ฒด ์กฐํšŒ
* @return ํ…œํ”Œ๋ฆฟ ์ „์ฒด ๋ฆฌ์ŠคํŠธ (๊ฐ€๋‚˜๋‹ค ์ˆœ์œผ๋กœ ์ •๋ ฌ) 200
*/
@GetMapping
public ResponseEntity<TemplateListResDto> templateList() {
Expand Down
Loading
Loading