Releases: ryulkim/LibCC
Releases ยท ryulkim/LibCC
Release list
Release v1.1.0 โ ๋ชจ๋๋ก์์์ ๋ฉํฐ ๋ชจ๋๋ก migration
๐ฆ Release v1.1.0
Release date: 2025-05-07
Previous version: lib-v1.0.6, jwt-v1.0.1
๐ Overview
๋ฐฐํฌ ๋ฐฉ์์ด ๋ฐ๋๋ฉด์ jwt, lib jar ํ์ผ ๋ ์ค ํ๋๋ง ๋ฐ์์ง๋ ๋ฒ๊ทธ ์์ ํ์ต๋๋ค.
๐ Bug Fixes
- issue: jwt, lib jar ํ์ผ ๋ ์ค ํ๋๋ง ๋ฐ์ ์ ์๊ฒ ๋จ:
- git package๋ก ๋ฐฐํฌํ๋ ๋ฐฉ์์ด jitpack์ผ๋ก ๋ฐ๋๊ฒ ๋๋ฉด์ ํ ๋ ํฌ ๋น jar ํ์ผ ํ ๊ฐ๋ง ๋น๋ํ ์ ์์ด, ๋ฉํฐ๋ชจ๋๋ก ๋ฐ๊พธ๊ฒ ๋์์ต๋๋ค.
๐ง Migration
- ์์ ์ build.gradle
repositories {
mavenCentral()
// ์ด ๋ถ๋ถ ์ถ๊ฐ
maven {
url 'https://jitpack.io'
}
}
implementation 'com.github.ryulkim:LibCC:1.0.5:plain'
- ์์ ํ build.gradle
repositories {
mavenCentral()
// ์ด ๋ถ๋ถ ์ถ๊ฐ
maven {
url 'https://jitpack.io'
}
}
implementation 'com.github.ryulkim.LibCC:lib:v1.1.0'
implementation 'com.github.ryulkim.LibCC:jwt:v1.1.0'
Release v1.0.5 โ ๊ณตํต ์๋ต์ฝ๋ ๋ฐ ์์ธ ํธ๋ค๋ฌ ์ถ๊ฐ
๐ฆ Release 1.0.5
Release date: 2025-05-05
Previous version: ์์
๐ Overview
Spring ๊ธฐ๋ฐ ์๋น์ค์์ ๊ณตํต์ ์ผ๋ก ์ฌ์ฉ๋๋ ์์ธ ์ฒ๋ฆฌ ๋ฐ ์ ํธ ๊ธฐ๋ฅ์ ๋ชจ๋ํํ ์ฒซ ๋ฆด๋ฆฌ์ฆ์ ๋๋ค.
๐ง ์ค์น ๋ฐ ์ฌ์ฉ
Gradle์ ๋ค์ ์์กด์ฑ์ ์ถ๊ฐํ์ธ์:
repositories {
mavenCentral()
// ์ด ๋ถ๋ถ ์ถ๊ฐ
maven {
url 'https://jitpack.io'
}
}
implementation 'com.github.ryulkim:LibCC:1.0.5:plain'์์ธ ํธ๋ค๋ฌ๋ฅผ ์ฌ์ฉํ๊ณ ์ถ๋ค๋ฉด,
SpringBootApplication์์ ๋ค์์ ์ถ๊ฐํด์ฃผ์ธ์:
@SpringBootApplication(scanBasePackages = {
"com.mycompany.app", // ์ฌ๋ฌ๋ถ ์ฑ์ ํจํค์ง
"com.library.lib.exception" // ๋ชจ๋์ ํจํค์ง
})โจ New Features
โ ๊ณตํต ์์ธ ์ฒ๋ฆฌ
1. ๊ณตํต ์์ธ ํธ๋ค๋ฌ (GlobalExceptionHandler)
@RestControllerAdvice๊ธฐ๋ฐ์ ์์ธ ์ฒ๋ฆฌ ์ง์- ๋ฐ์ํ ์์ธ์ ๋ํด ๋ก๊ทธ ์๋ ์ถ๋ ฅ
-
์ถ๋ ฅ ํ์:
{Exception ํด๋์ค๋ช }: {์ง์ ํ ์๋ฌ ๋ฉ์์ง}
-
2. ๊ณตํต ์ฝ๋ ์ ์
-
์ ๊ณต๋๋ ๊ธฐ๋ณธ ์๋ฌ ์ฝ๋:
SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "์๋ฒ ์๋ฌ๊ฐ ๋ฐ์ํ์์ต๋๋ค.")
-
์ ๊ณต๋๋ ๊ธฐ๋ณธ ์ฑ๊ณต ์ฝ๋:
SUCCESS(HttpStatus.OK, "์ฑ๊ณตํ์ต๋๋ค.")
-
์ ๊ณต๋๋ ApiResponseEntity ํํ
-
์ถ๋ ฅ ํ์:
{ "code": "{enum_name}", "message": "{message}", "result": "{data}" } -
์ฌ์ฉ ์์:
-
์ฑ๊ณต ์๋ต
ApiResponseEntity.onSuccess(Object result); ApiResponseEntity.onSuccess(null);
-
์คํจ ์๋ต
ApiResponseEntity.onFailure(StatusCode code);
-
์๋ต ์ปค์คํ
ApiResponseEntity.from(StatusCode code, Object result); ApiResponseEntity.from(StatusCode code, null);
-
-
3. ์ฌ์ฉ ๋ฐฉ๋ฒ ์์
(1) ๊ณตํต ์์ธ ์ฌ์ฉ
@GetMapping
public ResponseEntity<ApiResponse<Object>> test() {
throw new GlobalException(ErrorCode.SERVER_ERROR);
}(2) ์๋ฌ ์ฝ๋ ํ์ฅ
StatusCode๋ฅผ ๊ตฌํํ enum์ ์๋ก ์ ์
@Getter
@RequiredArgsConstructor
public enum ERORORO implements StatusCode {
TEST(NOT_FOUND, "test๋ค. test"),
TEST2(NOT_FOUND, "testtesttest๋ค.");
private final HttpStatus httpStatus;
private final String message;
@Override
public String getName() {
return this.name();
}
}- ์ฌ์ฉ ์:
@GetMapping
public ResponseEntity<ApiResponse<Object>> test() {
throw new GlobalException(ERORORO.TEST2);
}(3) ์ปค์คํ ์์ธ ํด๋์ค ์ฌ์ฉ
@Getter
public class AError extends GlobalException {
public AError(StatusCode errorCode) {
super(errorCode);
}
}@GetMapping
public ResponseEntity<ApiResponse<Object>> test() {
throw new AError(ERORORO.TEST2);
}๐ฃ ๋๋ค ๋๋ค์ ์์ฑ๊ธฐ
1. ์ ๊ณต ํฌ๋งท
- ํ์: ํ์ฉ์ฌ + ๋ช ์ฌ
- ํ์ฉ์ฌ ์์:
"ํ๋ณตํ", "์ฆ๊ฑฐ์ด", "์ ๋๋", "๋ฉ์ง", "์ฉ๊ฐํ", "์น์ ํ", "์ฑ์คํ", "์ ๋จธ๋ฌ์คํ"... - ๋ช
์ฌ ์์:
"ํธ๋์ด", "๊ณ ์์ด", "ํญ๊ท", "๋๊ณ ๋", "์ํ์นด", "์๋ฌ", "์ ๊ธฐ๋ฑ์ฅ์ด"...
2. ์ฌ์ฉ ๋ฐฉ๋ฒ
NickGenerator.generateUniqueNickname();Release lib-v1.0.6 โ ๊ณตํต ์๋ต์ฝ๋์ Create ์ถ๊ฐ
๐ฆ Release lib-v1.0.6
Release date: 2025-05-05
Previous version: 1.0.5
๐ Overview
- ๊ณตํต ์๋ต์ฝ๋์ create๊ฐ ์ถ๊ฐ ๋์์ต๋๋ค.
- ๋ฒ์ ๋ 1.0.5์์ ๊ธฐ๋ฅ ์ด๋ฆ์ ๊ตฌ๋ถํ lib-v1.0.6์ผ๋ก ๋ฐ๋์์ต๋๋ค
๐ How to Upgrade
dependencies {
implementation "com.github.ryulkim:LibCC:lib-v1.0.6:plain"
}โจ New Features
- ApiResponseEntity.class:
public static <T> ResponseEntity<ApiResponse<T>> create(StatusCode code, String url, T result) {
return ResponseEntity.created(URI.create(url))
.body(new ApiResponse<>(code.getName(), code.getMessage(), result));
}- ์ฌ์ฉ๋ฒ ์
@GetMapping
public ResponseEntity<ApiResponse<Object>> test() {
long resourceId=1L;
return ApiResponseEntity.create(ERORORO.CREATE,"/located/"+resourceId, null);
}







