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

feat : 분실물 게시글 API 구현 #1170

Merged
merged 8 commits into from
Jan 14, 2025
Merged

Conversation

Choon0414
Copy link
Contributor

🔥 연관 이슈

🚀 작업 내용

  1. 분실물 API를 구현했습니다.
    • 분실물 게시글 전체 조회 / 단건 조회 / 작성 / 삭제
    • 분실물 게시글 등록 시 키워드 알림이 발송됩니다.
  2. articles 구조
    • new_articles
      • new_koreatech_articles (한기대 공지)
      • new_koin_articles (코인 공지)
      • lost_item_articles (분실물 게시판)
        • lost_item_images (분실물 이미지)

💬 리뷰 중점사항

@Choon0414 Choon0414 added 기능 새로운 기능을 개발합니다. Team Campus 캠퍼스 팀에서 작업할 이슈입니다 labels Jan 13, 2025
@Choon0414 Choon0414 self-assigned this Jan 13, 2025
Copy link

github-actions bot commented Jan 13, 2025

Unit Test Results

354 tests   353 ✔️  1m 26s ⏱️
  45 suites      1 💤
  45 files        0

Results for commit 13dc083.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@kih1015 kih1015 left a comment

Choose a reason for hiding this comment

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

짧은 시간 내에 작업하시느라 정말 고생많으셨어요

코멘트 몇개만 확인부탁드립니다..!

Comment on lines 84 to 85

@GetMapping("/lostitem")
Copy link
Contributor

Choose a reason for hiding this comment

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

A

정말정말 사소한거긴한데 두개 단어라서 하이픈으로 엮어주면 어떨까요? ex) "lost-item"

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 이 생각 했어요!

Comment on lines 13 to 15
@JsonNaming(value = SnakeCaseStrategy.class)

public record LostItemArticleRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

A

공백 지워주세용

Comment on lines 65 to 74
private Board(
Integer id,
String name,
boolean isAnonymous,
Integer articleCount,
boolean isDeleted,
boolean isNotice,
Integer parentId
) {
this.id = id;
Copy link
Contributor

Choose a reason for hiding this comment

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

A

DB에서 id를 결정하기 때문에 빌더에 id 속성을 안넣어도 되지 않나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

분실물 게시판 boardId14로 정해서 생성 부분 수정하다 놓친 것 같네요.
수정하겠습니다!

`author_id` INT UNSIGNED NULL comment '작성자 id',
`category` VARCHAR(255) NOT NULL comment '분실물 카테고리',
`found_place` VARCHAR(255) NOT NULL comment '습득 장소',
`found_date` VARCHAR(255) NOT NULL comment '습득 날짜',
Copy link
Contributor

@kih1015 kih1015 Jan 13, 2025

Choose a reason for hiding this comment

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

C

found_date 날짜 타입으로 변경해야할 것 같아요..!

Comment on lines +28 to +29
@Schema(description = "분실물 사진")
List<String> images,
Copy link
Contributor

Choose a reason for hiding this comment

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

A

이미지 url 인가요?
클라에서 자원 서버에 직접 저장하고 url만 넘겨주는 형태인건가요?

Copy link
Contributor Author

@Choon0414 Choon0414 Jan 14, 2025

Choose a reason for hiding this comment

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

맞습니다. s3에 저장후 접근할 수 있는 url을 서버로 전달해줍니다.

사용자가 이미지 등록 → 클라이언트는 presigned url을 생성받아 S3에 이미지를 등록
→ S3가 클라이언트에게 해당 이미지의 url을 응답 → 클라가 서버에게 전달

Copy link
Contributor

@DHkimgit DHkimgit left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

Comment on lines 24 to 25
import in.koreatech.koin.domain.community.article.model.Article;
import in.koreatech.koin.domain.community.article.model.LostItemArticle;
Copy link
Contributor

Choose a reason for hiding this comment

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

사용 안하는 것 같아요!

@@ -14,6 +14,8 @@
import org.hibernate.annotations.Where;

import in.koreatech.koin.admin.notice.dto.AdminNoticeRequest;
import in.koreatech.koin.domain.community.article.dto.LostItemArticleRequest;
import in.koreatech.koin.domain.community.article.dto.LostItemArticlesRequest;
Copy link
Contributor

@DHkimgit DHkimgit Jan 14, 2025

Choose a reason for hiding this comment

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

18번째 줄 사용 안하는 것 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

import 부분은 리뷰에서 놓치기 쉬운데 예리한 지적 감사합니다!

Copy link
Contributor

@dradnats1012 dradnats1012 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@Operation(summary = "분실물 게시글 등록")
@PostMapping("/lostitem")
ResponseEntity<Void> createLostItemArticle(
@Auth(permit = {COUNCIL}) Integer councilId,
Copy link
Contributor

Choose a reason for hiding this comment

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

요게 총학 @Auth 인가요??

Copy link
Contributor Author

@Choon0414 Choon0414 Jan 14, 2025

Choose a reason for hiding this comment

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

넵 학생회라 COUNCIL로 정했습니다.

Comment on lines 117 to 127
@ApiResponses(
value = {
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(hidden = true))),
}
)
@Operation(summary = "분실물 게시글 단건 조회")
@GetMapping("/{id}")
ResponseEntity<LostItemArticleResponse> getLostItemArticle(
@Parameter(in = PATH) @PathVariable("id") Integer articleId
);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Operation(summary = "게시글 단건 조회")
    @GetMapping("/{id}")
    ResponseEntity<ArticleResponse> getArticle(
        @RequestParam(required = false) Integer boardId,
        @Parameter(in = PATH) @PathVariable("id") Integer articleId,
        @IpAddress String ipAddress
    );

이 부분이랑 겹치는것 같은데 괜찮은가요??

Copy link
Contributor Author

@Choon0414 Choon0414 Jan 14, 2025

Choose a reason for hiding this comment

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

경로를 수정 안했네요! 감사합니다.

Comment on lines 84 to 85

@GetMapping("/lostitem")
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 이 생각 했어요!

@Choon0414 Choon0414 merged commit 774b6e0 into develop Jan 14, 2025
4 checks passed
@Choon0414 Choon0414 deleted the feature/1167-lost-item-api branch January 14, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Campus 캠퍼스 팀에서 작업할 이슈입니다 기능 새로운 기능을 개발합니다.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

분실물 게시글 등록 / 삭제
4 participants