Skip to content

[FEATURE #26]: 가맹점 및 카테고리 구현 - #28

Merged
khyun9807 merged 9 commits into
developfrom
feature/#26
Feb 12, 2026
Merged

[FEATURE #26]: 가맹점 및 카테고리 구현#28
khyun9807 merged 9 commits into
developfrom
feature/#26

Conversation

@seoyeon2001

Copy link
Copy Markdown
Collaborator

📌 개요

  • 가맹점 등록, 수정, 조회
  • 카테고리 등록, 수정, 조회
  • 관리자 더미 유저 생성

🔧 작업 내용

  • 유저

    • Dummy Init 시 관리자 계정 생성
    • @PreAuthorize 활용하여 권한 체크
  • 가맹점 등록

    • 관리자만 등록 가능
    • 가맹점은 반드시 카테고리에 속하도록 해야 함
  • 가맹점 수정

    • 관리자만 수정 가능
  • 가맹점 조회

    • 카테고리로 필터링 가능
    • 가맹점명 오름차순
  • 카테고리 등록

    • 관리자만 등록 가능
    • depth는 최대 2
  • 카테고리 수정

    • 관리자만 수정 가능
    • depth 수정 불가
    • 부모 카테고리는 이름만 변경 가능
    • 자식 카테고리는 이름, 부모 카테고리 변경 가능
  • 카테고리 조회

    • 부모 카테고리로 필터링 가능
    • 파라미터로 부모 카테고리 ID 안넘기면 기본 부모 카테고리 조회
    • 카테고리명 오름차순

✅ 체크리스트

  • 테스트 완료(Postman, Swagger)

📝 기타 참고 사항

  • 카테고리 depth 최대 2 제한
  • 카테고리·가맹점은 삭제 미적용

📎 관련 이슈

Close #26

@seoyeon2001 seoyeon2001 self-assigned this Feb 10, 2026
@seoyeon2001 seoyeon2001 added the ✨ Feature 새로운 기능을 추가합니다. label Feb 10, 2026
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @seoyeon2001, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 시스템에 가맹점 및 카테고리 관리 기능을 도입하여 서비스의 핵심 비즈니스 로직을 확장합니다. 관리자 전용 기능을 통해 데이터의 무결성을 보장하고, 사용자 역할 기반의 접근 제어를 강화하여 보안성을 높였습니다. 또한, 기존 댓글 및 게시글 기능의 권한 확인 로직을 리팩토링하여 코드의 가독성과 유지보수성을 향상시켰습니다.

Highlights

  • 가맹점 및 카테고리 관리 기능 추가: 가맹점과 카테고리를 등록, 수정, 조회할 수 있는 새로운 API가 구현되었습니다.
  • 관리자 권한 제어 강화: @PreAuthorize 어노테이션을 활용하여 가맹점 및 카테고리 등록/수정 기능에 관리자 권한이 적용되었습니다.
  • 더미 관리자 계정 생성: 애플리케이션 초기화 시 더미 관리자 계정을 생성하는 로직이 추가되었습니다.
  • 카테고리 계층 구조 지원: 카테고리는 최대 2단계 깊이(depth)를 가지며, 부모-자식 관계를 관리할 수 있습니다.
  • 댓글 및 게시글 권한 확인 개선: Comment 및 Post 엔티티에 작성자 여부를 확인하는 isAuthor 메서드가 추가되어 권한 로직이 개선되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/com/payper/server/auth/AuthService.java
    • 관리자 권한으로 OAuth 사용자를 등록하는 findOrEnrollOAuthAdminUser 메서드가 추가되었습니다.
  • src/main/java/com/payper/server/auth/util/AuthDummyInit.java
    • 애플리케이션 시작 시 더미 관리자 계정을 생성하는 로직이 추가되었습니다.
  • src/main/java/com/payper/server/comment/entity/Comment.java
    • ZoneId 임포트가 제거되었고, likeCount 필드 초기화 및 댓글 작성자 여부를 확인하는 isAuthor 메서드가 추가되었습니다.
  • src/main/java/com/payper/server/comment/service/CommentService.java
    • 댓글 수정 및 삭제 시 Comment 엔티티의 isAuthor 메서드를 사용하여 권한을 확인하도록 변경되었습니다.
  • src/main/java/com/payper/server/global/response/ErrorCode.java
    • 관리자 권한 부족, 가맹점/카테고리 중복 및 유효성 검사 관련 새로운 에러 코드가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/controller/CategoryApi.java
    • 카테고리 등록, 수정, 조회를 위한 CategoryApi 인터페이스가 새로 추가되었습니다.
  • src/main/java/com/payper/server/merchant/controller/CategoryController.java
    • CategoryApi를 구현하고 카테고리 관리 기능을 제공하는 CategoryController가 추가되었으며, 관리자 권한이 필요한 엔드포인트에 @PreAuthorize가 적용되었습니다.
  • src/main/java/com/payper/server/merchant/controller/MerchantApi.java
    • 가맹점 등록, 수정, 조회 API 정의가 추가되었고, 게시글 작성 API의 파라미터가 업데이트되었습니다.
  • src/main/java/com/payper/server/merchant/controller/MerchantController.java
    • 가맹점 등록, 수정, 조회 기능을 구현하는 MerchantController가 업데이트되었으며, 관리자 권한이 필요한 엔드포인트에 @PreAuthorize가 적용되었습니다.
  • src/main/java/com/payper/server/merchant/dto/CategoryRequest.java
    • 카테고리 등록 및 수정을 위한 요청 DTO(RegisterCategory, UpdateCategory)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/dto/CategoryResponse.java
    • 카테고리 조회 응답을 위한 DTO(CategoryItem)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/dto/MerchantRequest.java
    • 가맹점 등록 및 수정을 위한 요청 DTO(RegisterMerchant, UpdateMerchant)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/dto/MerchantResponse.java
    • 가맹점 조회 응답을 위한 DTO(MerchantItem)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/entity/Category.java
    • 카테고리 엔티티에 @builder가 추가되었고, name 필드에 unique=true 제약 조건이 설정되었으며, 카테고리 등록 및 업데이트를 위한 헬퍼 메서드(register, updateNameAndParentCategory, updateName, isRoot, isDepth2)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/entity/Merchant.java
    • 가맹점 엔티티에 @builder가 추가되었고, name 필드에 unique=true 제약 조건이 설정되었으며, 가맹점 등록 및 업데이트를 위한 헬퍼 메서드(register, update)가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/repository/CategoryRepository.java
    • 카테고리 엔티티를 위한 CategoryRepository 인터페이스가 새로 추가되었으며, 이름 중복 확인 및 부모 카테고리별 조회 메서드가 정의되었습니다.
  • src/main/java/com/payper/server/merchant/repository/MerchantRepository.java
    • 가맹점 엔티티를 위한 MerchantRepository에 이름 중복 확인 및 카테고리 ID로 가맹점을 조회하는 커스텀 쿼리 메서드가 추가되었습니다.
  • src/main/java/com/payper/server/merchant/service/CategoryService.java
    • 카테고리 등록, 수정, 조회 로직을 처리하는 CategoryService가 새로 추가되었으며, 유효성 검사 및 비즈니스 규칙이 구현되었습니다.
  • src/main/java/com/payper/server/merchant/service/MerchantService.java
    • 가맹점 등록, 수정, 조회 로직을 처리하는 MerchantService가 새로 추가되었으며, 유효성 검사 및 비즈니스 규칙이 구현되었습니다.
  • src/main/java/com/payper/server/post/entity/Post.java
    • ZoneId 임포트가 제거되었고, softDelete 메서드에서 commentCount 초기화 로직이 제거되었으며, create 메서드에서 여러 필드가 초기화되도록 변경되었고, 게시글 작성자 여부를 확인하는 isAuthor 메서드가 추가되었습니다.
  • src/main/java/com/payper/server/post/service/PostService.java
    • 게시글 수정 및 삭제 시 Post 엔티티의 isAuthor 메서드를 사용하여 권한을 확인하도록 변경되었고, 삭제 로직이 softDelete로 변경되었습니다.
  • src/main/java/com/payper/server/security/SecurityConfig.java
    • @EnableMethodSecurity 어노테이션이 추가되어 메서드 수준 보안이 활성화되었고, 가맹점 및 카테고리 조회 API에 대한 접근 권한이 permitAll로 설정되었으며, 관리자 전용 API 경로가 추가되었습니다.
Activity
  • 이 Pull Request에는 현재까지 사용자 활동이 기록되지 않았습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@seoyeon2001 seoyeon2001 changed the title Feature/#26 [FEATURE #26]: 가맹점 및 카테고리 구현 Feb 10, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 가맹점 및 카테고리 관리를 위한 기능, CRUD 연산, 역할 기반 접근 제어를 추가합니다. 또한 관리자용 더미 데이터도 추가되었습니다. 변경 사항은 새로운 서비스, 리포지토리, 컨트롤러, DTO로 잘 구조화되어 있습니다. 보안 설정도 올바르게 업데이트되었습니다. 코드 중복 및 업데이트 로직의 잠재적 문제와 관련하여 몇 가지 개선 영역을 발견했습니다.

Comment thread src/main/java/com/payper/server/auth/AuthService.java Outdated
Comment thread src/main/java/com/payper/server/merchant/entity/Merchant.java

@khyun9807 khyun9807 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

고생하셨습니다 약간만 남은줄 알았는데 작업량이 꽤 많았네요 i believe u seoyeon
2개 정도 커멘트했는데 그것만 해결되면 바로 머지해도 좋을것 같습니다!

Comment thread src/main/java/com/payper/server/auth/AuthService.java Outdated

@Answl Answl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

확인했습니다! 수고하셨습니다

@khyun9807
khyun9807 merged commit 24cb22a into develop Feb 12, 2026
1 check passed
@khyun9807
khyun9807 deleted the feature/#26 branch February 12, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능을 추가합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: 가맹점 및 카테고리 구현

3 participants