Skip to content

feat: 교내 시설물 아이콘 URL 서빙#2227

Merged
DHkimgit merged 1 commit intodevelopfrom
feat/2226-coopshop-icon
Apr 28, 2026
Merged

feat: 교내 시설물 아이콘 URL 서빙#2227
DHkimgit merged 1 commit intodevelopfrom
feat/2226-coopshop-icon

Conversation

@DHkimgit
Copy link
Copy Markdown
Collaborator

@DHkimgit DHkimgit commented Apr 28, 2026

🔍 개요

  • 교내 시설물 아이콘 URL 서빙(URL 추가)

🚀 주요 변경 내용

  • 3가지 방법을 고려했습니다

방법 1: DB 테이블에 링크 저장

장점: 런타임에 URL 변경 가능, 관리자 페이지로 운영 가능
단점: SVG URL 하나 가져오는데 DB 쿼리 발생, 오버엔지니어링 가능성

방법 2: Spring Boot static final (하드코딩)

java
public class SvgAssets {
    public static final String ARROW = "https://cdn.example.com/icons/arrow.svg";
    public static final String LOGO  = "https://cdn.example.com/logo/main.svg";
}

장점: 단순하고 빠름
단점: URL 바뀌면 재배포 필요

방법 3: application.yml + @ConfigurationProperties

  • 코드 변경 없이 환경별로 다른 URL 사용 가능하고, 재배포 없이 외부 설정으로 관리 가능

결론 : 방법 1. DB 테이블에 링크 저장

  • 학기별로 정보가 바뀌는 구조라 시설물 형식의 이름 정보가 정적으로 저장되는 coop_name 테이블에 같이 저장하는게 적합하다고 판단했습니다.
  • 배포되면 DB에 직접 넣을 생각입니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • New Features
    • Coop shop listings now display icons for improved visual identification across the platform, enabling better shop recognition and enhanced user experience.

@DHkimgit DHkimgit requested review from Soundbar91 and taejinn April 28, 2026 13:26
@github-actions github-actions Bot added Team Campus 캠퍼스 팀에서 작업할 이슈입니다 기능 새로운 기능을 개발합니다. labels Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

The pull request adds icon URL support to the cooperative shop domain by introducing a new iconUrl field. The change spans the database schema, JPA entity model, and API response DTOs, enabling the system to serve icons for campus facilities.

Changes

Cohort / File(s) Summary
Database & Domain Model
src/main/resources/db/migration/V234__add_coopshop_icon.sql, src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java
Database migration adds nullable icon_url VARCHAR(500) column to coop_names table; JPA entity adds corresponding iconUrl field mapped to the new column.
API Response DTOs
src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopResponse.java, src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java
Both DTOs add iconUrl string field with Swagger documentation; mappers populate the field by reading from coopShop.getCoopName().getIconUrl().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A humble icon finds its place,
Through database and entity space,
From CoopName to the response flow,
Campus shops now have a glow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature: adding icon URL serving for campus facilities.
Linked Issues check ✅ Passed The PR implements the primary objective from issue #2226 by adding icon URL serving for campus facilities through database schema and DTO updates.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective: database migration adds icon_url column, entity/DTOs are updated to expose this field, and mapping logic populates it appropriately.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2226-coopshop-icon

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@ff1451 ff1451 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Copy link
Copy Markdown
Contributor

@dh2906 dh2906 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@github-actions
Copy link
Copy Markdown

Unit Test Results

671 tests   668 ✔️  1m 21s ⏱️
166 suites      3 💤
166 files        0

Results for commit 9557ff4.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java`:
- Around line 30-31: The `@Column` for the iconUrl field in CoopName lacks a
length constraint and must match the DB migration; update the `@Column`(name =
"icon_url") annotation on the iconUrl field in class CoopName to include length
= 500 so Hibernate's schema validation (ddl-auto: validate) matches the V234
migration's VARCHAR(500).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 602e1db4-8491-40c1-b1f4-9818f290fd44

📥 Commits

Reviewing files that changed from the base of the PR and between eaa098f and 9557ff4.

📒 Files selected for processing (4)
  • src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopResponse.java
  • src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java
  • src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java
  • src/main/resources/db/migration/V234__add_coopshop_icon.sql

Comment on lines +30 to +31
@Column(name = "icon_url")
private String iconUrl;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify DB/entity consistency and whether schema validation is enabled.

rg -n --type=sql -C2 'icon_url|VARCHAR\(500\)'
rg -n --type=java -C2 '@Column\(name\s*=\s*"icon_url"'
rg -n --type=yaml -C2 'ddl-auto|hbm2ddl'
rg -n --type=properties -C2 'ddl-auto|hbm2ddl'

Repository: BCSDLab/KOIN_API_V2

Length of output: 2692


🏁 Script executed:

#!/bin/bash
# Check all `@Column` annotations in CoopName entity
cat -n src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java | head -50

# Search for other `@Column` definitions without length in the file
rg -n '@Column' src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java

Repository: BCSDLab/KOIN_API_V2

Length of output: 1299


🏁 Script executed:

#!/bin/bash
# Find the migration that created the coop_names table
rg -n 'CREATE TABLE.*coop_names|ALTER TABLE.*coop_names' --type=sql -B2 -A10

Repository: BCSDLab/KOIN_API_V2

Length of output: 1188


Add length constraint to icon_url column.

The icon_url column at line 30 lacks a length specification, but the database migration (V234) defines it as VARCHAR(500). With Hibernate's ddl-auto: validate mode enabled in production, this schema mismatch will cause validation failures at runtime.

🔧 Proposed fix
-    `@Column`(name = "icon_url")
+    `@Column`(name = "icon_url", length = 500)
     private String iconUrl;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Column(name = "icon_url")
private String iconUrl;
`@Column`(name = "icon_url", length = 500)
private String iconUrl;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/in/koreatech/koin/domain/coopshop/model/CoopName.java` around
lines 30 - 31, The `@Column` for the iconUrl field in CoopName lacks a length
constraint and must match the DB migration; update the `@Column`(name =
"icon_url") annotation on the iconUrl field in class CoopName to include length
= 500 so Hibernate's schema validation (ddl-auto: validate) matches the V234
migration's VARCHAR(500).

@DHkimgit DHkimgit merged commit 8fe0d9c into develop Apr 28, 2026
9 checks passed
@DHkimgit DHkimgit deleted the feat/2226-coopshop-icon branch April 28, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Campus 캠퍼스 팀에서 작업할 이슈입니다 기능 새로운 기능을 개발합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[캠퍼스] 교내 시설물 아이콘 서빙

5 participants