Skip to content

Conversation

@chaen-ing
Copy link
Member

@chaen-ing chaen-ing commented Jul 17, 2025

๐Ÿชบ Summary

  1. ๋ณต์ˆ˜๋Š” ~s ex) ids
  2. ์—”ํ‹ฐํ‹ฐ ์ •๋ณด๋Š” ์ œ์™ธ ex) seedID -> id
  3. ๋‹ค๋ฅธ ์—”ํ‹ฐํ‹ฐ์˜ ๊ฒฝ์šฐ ์ด๋ฆ„ + ํ•„๋“œ ex)tagNames

์œ„์— ๊ธฐ์ค€ ๋ฐ”ํƒ•์œผ๋กœ ์”จ๋“œ์กฐํšŒ ๊ด€๋ จ api๋“ค ์‘๋‹ต, ์š”์ฒญ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
์”จ๋“œ ๋ฆฌ์ŠคํŠธ ์กฐํšŒํ•˜๋Š” ๊ฒฝ์šฐ๋“ค ๋ชจ๋‘ ๊ฑฐ์˜ ๋น„์Šทํ•˜๋‹ค๊ณ  ๋ด๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”

swagger๋„ ์ •๋ ฌ + ๋กœ์ปฌ์—์„œ๋Š” ๋กœ์ปฌ๋งŒ ์“ธ์ˆ˜์žˆ๊ฒŒ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค

๐ŸŒฑ Issue Number

๐Ÿ™ To Reviewers

  • api ๋ช…์„ธ์„œ๋„ ์ˆ˜์ •ํ•ด๋†จ๋Š”๋ฐ ํ•„ํ„ฐ๋ง ๋ฐ ๊ฒ€์ƒ‰ ์ชฝ Response, request body๊ธฐ์ค€์œผ๋กœ ๋ด์ฃผ์„ธ์š” (์˜ˆ์‹œ๋Š” ๋„˜ ๋งŽ์•„์„œ ๋‹ค๋ชป๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค)
  • category, filter์—์„œ๋„ ์œ„์— ๊ธฐ์ค€์— ๋ถ€ํ•ฉํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๊ธดํ•œ๋ฐ ์ด๊ฒƒ๋„ ๋ฐ”๊พธ๋ฉด ๋„ˆ๋ฌด ์ผ์ด์ปค์งˆ๊ฒƒ๊ฐ™์•„..์ผ๋‹จ ๋’€์Šต๋‹ˆ๋‹ค
  • swagger ๊ด€๋ จ ์„œ๋ฒ„ env ์ถ”๊ฐ€ํ•ด๋†จ๊ณ  ๋กœ์ปฌ์— ์ถ”๊ฐ€ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

@chaen-ing chaen-ing requested review from Copilot and gyuseon25 July 17, 2025 08:51
@chaen-ing chaen-ing self-assigned this Jul 17, 2025
@chaen-ing chaen-ing added the Refactor โ™ป๏ธ ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง label Jul 17, 2025
@chaen-ing chaen-ing linked an issue Jul 17, 2025 that may be closed by this pull request
2 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors request/response DTOs to use unified field names and enhances Swagger configuration.

  • Standardized field names across APIs (e.g., seedId โ†’ id, seedName โ†’ name, tags โ†’ tagNames, seedLink โ†’ link, seedDetail โ†’ detail)
  • Added Swagger UI sorting options and external server URL support via swagger.server.url
  • Disabled the V2 simplification controller by commenting out its Spring annotations

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/resources/application.yml Added Swagger UI sorting options (groups-order, tags_sorter, operations_sorter) and new swagger.server.url property
src/main/java/com/adoonge/seedzip/simplification/controller/SimplificationControllerV2.java Commented out controller annotations, effectively disabling V2 endpoints
src/main/java/com/adoonge/seedzip/seed/service/SeedService.java Updated service logic to use renamed request fields (type, name, link, detail) and builder responses
src/main/java/com/adoonge/seedzip/seed/repository/SeedRepositoryImpl.java Refactored filtering methods to use tagNames instead of tags
src/main/java/com/adoonge/seedzip/seed/dto/response/SeedResponse.java Renamed response DTO records to unified field names (e.g., id, name, link, detail)
src/main/java/com/adoonge/seedzip/seed/dto/request/SeedUpdateRequest.java, SeedRequest.java, SeedFilteringRequest.java, SeedDeleteListRequest.java Renamed request DTO records to match naming conventions (type, name, categoryNames, tagNames, ids)
src/main/java/com/adoonge/seedzip/seed/dto/SeedDTO.java Updated internal DTO field names to unified conventions
src/main/java/com/adoonge/seedzip/global/config/SwaggerConfig.java Changed property key to swagger.server.url and added conditional logic for local vs. production URLs
Comments suppressed due to low confidence (2)

src/main/java/com/adoonge/seedzip/seed/dto/response/SeedResponse.java:22

  • After renaming response fields, ensure that existing API tests and JSON serialization/deserialization tests are updated to cover these new property names (id, name, link, detail) to prevent regressions.
    public record SeedInfoSimple(Long id, String name){}

src/main/java/com/adoonge/seedzip/simplification/controller/SimplificationControllerV2.java:26

  • Commenting out @RestController disables the controllerโ€”if the intention is to deprecate or remove v2 endpoints, consider deleting this class or adding a clear deprecation notice; otherwise, re-enable the annotations so the API remains available.
//@RestController

Comment on lines +32 to +35
if(swaggerServerUrl.contains("localhost")){
servers.add(new Server().url(swaggerServerUrl).description("Local Server"));
}else{
servers.add(new Server().url("https://"+swaggerServerUrl).description("AdoongE Server"));
Copy link

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

Using a substring check to detect localhost URLs is brittle; consider relying on an explicit environment/profile flag or parsing the URL scheme so you can handle various formats and avoid accidental mismatches.

Suggested change
if(swaggerServerUrl.contains("localhost")){
servers.add(new Server().url(swaggerServerUrl).description("Local Server"));
}else{
servers.add(new Server().url("https://"+swaggerServerUrl).description("AdoongE Server"));
try {
java.net.URI uri = new java.net.URI(swaggerServerUrl);
String host = uri.getHost();
if ("localhost".equals(host) || "127.0.0.1".equals(host) || "[::1]".equals(host)) {
servers.add(new Server().url(swaggerServerUrl).description("Local Server"));
} else {
servers.add(new Server().url("https://" + swaggerServerUrl).description("AdoongE Server"));
}
} catch (java.net.URISyntaxException e) {
throw new IllegalArgumentException("Invalid URL format for swaggerServerUrl: " + swaggerServerUrl, e);

Copilot uses AI. Check for mistakes.
Copy link
Member

@gyuseon25 gyuseon25 left a comment

Choose a reason for hiding this comment

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

๊ณ ์ƒ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค ๐Ÿ’ฏ๐Ÿ‘

@chaen-ing chaen-ing merged commit f1a37c6 into develop Jul 20, 2025
1 check passed
@chaen-ing chaen-ing deleted the refactor/response-variable-unification-#162 branch January 3, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor โ™ป๏ธ ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] ์‘๋‹ต ๋ณ€์ˆ˜๋ช… ํ†ต์ผ

3 participants