Skip to content

Comments

[이진용] sprint4#66

Open
alpha-lens wants to merge 82 commits intocodeit-bootcamp-spring:이진용from
alpha-lens:이진용-sprint4

Hidden character warning

The head ref may contain hidden characters: "\uc774\uc9c4\uc6a9-sprint4"
Open

[이진용] sprint4#66
alpha-lens wants to merge 82 commits intocodeit-bootcamp-spring:이진용from
alpha-lens:이진용-sprint4

Conversation

@alpha-lens
Copy link
Collaborator

요구사항

기본

[x] DiscodeitApplication의 테스트 로직은 삭제하세요.
[x] 지금까지 구현한 서비스 로직을 활용해 웹 API를 구현하세요. 이때 @RequestMapping만 사용해 구현해보세요.
[x] 웹 API의 예외를 전역으로 처리하세요.

API 테스트

[x] Postman을 활용해 컨트롤러를 테스트 하세요.
Postman API 테스트 결과를 다음과 같이 export하여 PR에 첨부해주세요.
Sprint 4.postman_collection.json

사용자 관리

[x] 사용자를 등록할 수 있다.
[x] 사용자 정보를 수정할 수 있다.
[x] 사용자를 삭제할 수 있다.
[x] 모든 사용자를 조회할 수 있다.
[x] 사용자의 온라인 상태를 업데이트할 수 있다.

권한 관리

[x] 사용자는 로그인할 수 있다.

채널 관리

[x] 공개 채널을 생성할 수 있다.
[x] 비공개 채널을 생성할 수 있다.
[x] 공개 채널의 정보를 수정할 수 있다.
[x] 채널을 삭제할 수 있다.
[x] 특정 사용자가 볼 수 있는 모든 채널 목록을 조회할 수 있다.

메시지 관리

[x] 메시지를 보낼 수 있다.
[x] 메시지를 수정할 수 있다.
[x] 메시지를 삭제할 수 있다.
[x] 특정 채널의 메시지 목록을 조회할 수 있다.

메시지 수신 정보 관리

[x] 특정 채널의 메시지 수신 정보를 생성할 수 있다.
[x] 특정 채널의 메시지 수신 정보를 수정할 수 있다.
[x] 특정 사용자의 메시지 수신 정보를 조회할 수 있다.

바이너리 파일 다운로드

[x] 바이너리 파일을 1개 또는 여러 개 조회할 수 있다.

심화

[x] 사용자 목록 조회, BinaryContent 파일 조회 API를 다음의 조건을 만족하도록 수정하세요.
[x] 사용자 목록 조회
[x] BinaryContent 파일 조회
[x] 다음의 파일을 활용하여 사용자 목록을 보여주는 화면을 서빙해보세요.

생성형 AI 활용

[x] 생성형 AI (Claude, ChatGPT 등)를 활용해서 위 이미지와 비슷한 화면을 생성 후 서빙해보세요.

주요 변경사항

스크린샷

API Test

스크린샷 2026-02-11 오후 10 06 08 스크린샷 2026-02-11 오후 10 06 19 스크린샷 2026-02-11 오후 10 06 29 스크린샷 2026-02-11 오후 10 06 36

생성형 AI 사용

스크린샷 2026-02-11 오후 9 52 51

멘토에게

  • 변수명 네이밍 부분에 대한 지적이 필요합니다. 잘 한건지 모르겠습니다.
  • HTTP 상태코드를 적절하게 사용했는지에 대한 판단이 필요합니다.
  • Exception이 불필요하게 분기를 나눠놓은 것인가 싶습니다.
    • 약 5주간 함께 할 수 있어서 즐거웠습니다. 감사합니다.

Date : 20260109

Today I work's...
Server && Channel make test logic
로그인 로그아웃 기능 추가.
기타 버그 수정
채널 서비스 관련한 업데이트
ResponseDto를 이용하여 채널 서비스를 고도화하였으며
향후 사용자의 마지막 읽은 메시지 내용 등을 추가하는 작업이 필요함.
첨부파일 기능을 추가했다. (아직 테스트중)
MVC에 맞게 조금 리팩토링했다. (Service에서 출력하는 기능 제거 등)
메시지 조회 불가능한 버그를 고쳤다. (아직 테스트 중)
로그인시에만 사용할 수 있던 것을 RequestParam을 이용해서 userId를 입력받게 했다.
ResponseEntity로 반환하던 것을 RestController로 변경함으로서 DTO를 반환하게 했다.
1. DTO 파일명을 바꿨다.
2. DTO 파일을 두 그룹으로 묶었다.
3. import 구문을 최적화했다.
profile 이미지 저장에서 filename으로 되어 있어서 확장자 저장이 안 된 것 같다.
그 외에 readme 내용을 일단 지웠다.
@alpha-lens alpha-lens added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Feb 11, 2026
@joonfluence
Copy link

커밋 메세지에 대한 규칙을 컨벤션으로 잘 작성해주셨네요~
추가로 한번 더 참고해보세요 https://www.conventionalcommits.org/ko/v1.0.0/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 파일류들은 .gitignore에 추가해주세요~!

import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/api/auth")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1 버저닝을 추가 해주는 것도 좋습니다 (계속 버전이 변화될 수 있기 때문에) 나중에 추가하긴 어렵거든요

private final AuthService authService;

@RequestMapping(value = "/login", method = RequestMethod.POST)
public ResponseEntity<String> loginUser(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String으로 반환하는게 과연 좋을지 고민해보세요~

Comment on lines 39 to 44
@RequestMapping(value = "/find", method = RequestMethod.GET)
public List<ResponseChannelDto> findChannel(
@RequestParam("id") UUID userId
){
return channelService.findAll(userId);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESTFul API에서 GET이 이미 자원에 대한 조회의 의미를 내포하기 때문에 /find 굳이 추가할 필요 없습니다!

throw new NotFound("The channel does not exist.");
}

if(channelService.find(channelId, userId).channelType() == ChannelType.PRIVATE){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChannelType.PRIVATE.equals(targetChannel.getType())

Comment on lines 51 to 63
for (MultipartFile file : files) {
String fileName = file.getOriginalFilename();
String extension = fileName.substring(fileName.lastIndexOf("."));
if(List.of(".jpg", ".jpeg", ".png").contains(extension)) {
byte[] bytes = file.getBytes();
RequestCreateBinaryContentDto requestBinaryContentDto = new RequestCreateBinaryContentDto(file.getContentType(), file.getOriginalFilename(), bytes);
binaryContentIds.add(binaryContentService.create(requestBinaryContentDto));
}
}

RequestCreateMessageDto requestMessageDto = new RequestCreateMessageDto(content, channelId, userId, binaryContentIds);
return messageService.create(requestMessageDto);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 로직들이 Controller에 있는게 맞을까요?

Comment on lines 16 to 17
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy년 MM월 dd일 HH시 mm분 ss초")
.withZone(ZoneId.of("Asia/Seoul"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 로직이 여기에 들어가는게 맞을까요? 고민해보시죠~!

Comment on lines +1 to +2
.idea
*.ser No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.gitignore에 파일 더 추가해보시죠~

Copy link

@joonfluence joonfluence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants