-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from HyunJunSon/feature/mainPageTestCode
Feature/main page test code
- Loading branch information
Showing
28 changed files
with
653 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
== Main API | ||
|
||
// [[]] 안에는 a 태그 이름 들어갑니다 (http://localhost:8080/docs/index#공통코드-조회) | ||
[[Banner-조회]] | ||
=== Banner 조회 | ||
|
||
===== HTTP Request | ||
include::{snippets}/banner/get-banner/http-request.adoc[] | ||
|
||
==== Response | ||
include::{snippets}/banner/get-banner/response-fields-value.adoc[] | ||
|
||
===== HTTP Response 예시 | ||
include::{snippets}/banner/get-banner/http-response.adoc[] | ||
|
||
|
||
[[Recommend-Product-조회]] | ||
=== Recommend-Product-조회 | ||
|
||
===== HTTP Request | ||
include::{snippets}/recommend-products/get-recommend-products/http-request.adoc[] | ||
|
||
==== Response | ||
include::{snippets}/recommend-products/get-recommend-products/response-fields.adoc[] | ||
|
||
===== HTTP Response 예시 | ||
include::{snippets}/recommend-products/get-recommend-products/http-response.adoc[] | ||
|
||
|
||
[[Products-rank-최신순]] | ||
== Products-rank-최신순 | ||
|
||
===== HTTP Request | ||
include::{snippets}/products/get-products-view-count-order/http-request.adoc[] | ||
|
||
===== Response | ||
include::{snippets}/products/get-products-view-count-order/response-fields.adoc[] | ||
|
||
===== HTTP Response 예시 | ||
include::{snippets}/products/get-products-view-count-order/http-response.adoc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
module-api/src/main/java/com/kernel360/main/code/ConverterErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.kernel360.main.code; | ||
|
||
import com.kernel360.code.ErrorCode; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum ConverterErrorCode implements ErrorCode { | ||
|
||
NOT_FOUND_CONVERTER(HttpStatus.BAD_REQUEST.value(), "CMB001", "적절한 조회타입이 존재하지 않습니다."); | ||
|
||
private final int status; | ||
private final String code; | ||
private final String message; | ||
|
||
ConverterErrorCode(int status, String code, String message) { | ||
this.status = status; | ||
this.code = code; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
module-api/src/main/java/com/kernel360/main/config/WebConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.kernel360.main.config; | ||
|
||
import com.kernel360.main.conveter.StringToSortConverter; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.format.FormatterRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addFormatters(FormatterRegistry registry) { | ||
registry.addConverter(new StringToSortConverter()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
module-api/src/main/java/com/kernel360/main/conveter/StringToSortConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.kernel360.main.conveter; | ||
|
||
import com.kernel360.exception.BusinessException; | ||
import com.kernel360.main.code.ConverterErrorCode; | ||
import com.kernel360.main.controller.Sort; | ||
import org.springframework.core.convert.converter.Converter; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class StringToSortConverter implements Converter<String, Sort> { | ||
|
||
@Override | ||
public Sort convert(String source) { | ||
for (Sort sort : Sort.values()) { | ||
if (sort.getOrderType().equalsIgnoreCase(source)) { | ||
return sort; | ||
} | ||
} | ||
throw new BusinessException(ConverterErrorCode.NOT_FOUND_CONVERTER); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
module-api/src/main/java/com/kernel360/member/dto/MemberInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.kernel360.member.dto; | ||
|
||
public record MemberInfo( String id, | ||
String password | ||
) { | ||
static MemberInfo of( | ||
String id, | ||
String password | ||
) { | ||
return new MemberInfo(id, password); | ||
} | ||
} |
Oops, something went wrong.