Skip to content

Commit f7671ba

Browse files
author
nimuy99
committed
#131 Fix: 바이낸스 api 응답 소수점 출력
1 parent ce30ede commit f7671ba

File tree

6 files changed

+63
-0
lines changed

6 files changed

+63
-0
lines changed

src/main/java/com/memesphere/domain/collection/dto/response/CollectionGridPreviewResponse.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.collection.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
@@ -15,20 +16,33 @@
1516
public class CollectionGridPreviewResponse {
1617
@Schema(description = "밈코인 id", example = "1")
1718
Long coinId;
19+
1820
@Schema(description = "밈코인 name", example = "도지코인")
1921
String name;
22+
2023
@Schema(description = "밈코인 symbol", example = "DOGE")
2124
String symbol;
25+
2226
@Schema(description = "밈코인 image", example = "https://bucketname.s3.region.amazonaws.com/image1.jpg")
2327
String image;
28+
2429
@Schema(description = "차트 데이터의 price", example = "2000")
30+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2531
Double currentPrice;
32+
2633
@Schema(description = "차트 데이터의 high_price", example = "2500")
34+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2735
Double highPrice;
36+
2837
@Schema(description = "차트 데이터의 low_price", example = "1500")
38+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2939
Double lowPrice;
40+
3041
@Schema(description = "차트 데이터의 price_change", example = "500")
42+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3143
Double priceChange;
44+
3245
@Schema(description = "차트 데이터의 price_change_rate", example = "2.4")
46+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3347
Double priceChangeRate;
3448
}

src/main/java/com/memesphere/domain/collection/dto/response/CollectionListPreviewResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.collection.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
@@ -15,16 +16,25 @@
1516
public class CollectionListPreviewResponse {
1617
@Schema(description = "밈코인 id", example = "1")
1718
Long coinId;
19+
1820
@Schema(description = "밈코인 name", example = "도지코인")
1921
String name;
22+
2023
@Schema(description = "밈코인 symbol", example = "DOGE")
2124
String symbol;
25+
2226
@Schema(description = "차트 데이터의 price", example = "2000")
27+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2328
Double currentPrice;
29+
2430
@Schema(description = "차트 데이터의 price_change_rate", example = "+2.4%")
31+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2532
Double priceChangeRate;
33+
2634
@Schema(description = "차트 데이터의 weighted average price", example = "10000")
35+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2736
Double weightedAveragePrice; // market cap 대신 사용
37+
2838
@Schema(description = "차트 데이터의 volume", example = "5")
2939
BigDecimal volume;
3040
}

src/main/java/com/memesphere/domain/dashboard/dto/response/DashboardTrendResponse.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.dashboard.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.Builder;
56
import lombok.Getter;
@@ -25,18 +26,22 @@ public class DashboardTrendResponse {
2526
private BigDecimal volume;
2627

2728
@Schema(description = "현재가", example = "0.20")
29+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2830
private Double price;
2931

3032
@Schema(description = "가격 변화량", example = "-0.03")
33+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3134
private Double priceChange;
3235

3336
@Schema(description = "가격 변화량 절대값", example = "0.03")
37+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3438
private Double priceChangeAbsolute;
3539

3640
@Schema(description = "가격 변화 방향", example = "down")
3741
private String priceChangeDirection;
3842

3943
@Schema(description = "가격 변화율", example = "-6.35")
44+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
4045
private Double priceChangeRate;
4146

4247
@Schema(description = "순위 변화 방향", example = "down")

src/main/java/com/memesphere/domain/detail/dto/response/PriceInfoResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.detail.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.Builder;
56
import lombok.Getter;
@@ -13,26 +14,33 @@ public class PriceInfoResponse {
1314
private Long coinId;
1415

1516
@Schema(description = "현재가", example = "0.20")
17+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
1618
private Double price;
1719

1820
@Schema(description = "가격 변화량", example = "-0.03")
21+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
1922
private Double priceChange;
2023

2124
@Schema(description = "가격 변화량 절대값", example = "0.03")
25+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2226
private Double priceChangeAbsolute;
2327

2428
@Schema(description = "가격 변화 방향", example = "down")
2529
private String priceChangeDirection;
2630

2731
@Schema(description = "가격 변화율", example = "-6.35")
32+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2833
private Double priceChangeRate;
2934

3035
@Schema(description = "거래량 가중 평균 가격", example = "-942.38")
36+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3137
private Double weightedAveragePrice;
3238

3339
@Schema(description = "24h 최고가", example = "2500")
40+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3441
private Double highPrice;
3542

3643
@Schema(description = "24h 최저가", example = "1500")
44+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3745
private Double lowPrice;
3846
}

src/main/java/com/memesphere/domain/search/dto/response/SearchGridPreviewResponse.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.search.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
@@ -15,22 +16,36 @@
1516
public class SearchGridPreviewResponse {
1617
@Schema(description = "밈코인 id", example = "1")
1718
Long coinId;
19+
1820
@Schema(description = "밈코인 name", example = "도지코인")
1921
String name;
22+
2023
@Schema(description = "밈코인 symbol", example = "DOGE")
2124
String symbol;
25+
2226
@Schema(description = "밈코인 image", example = "https://bucketname.s3.region.amazonaws.com/image1.jpg")
2327
String image;
28+
2429
@Schema(description = "차트 데이터의 price", example = "2000")
30+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2531
Double currentPrice;
32+
2633
@Schema(description = "차트 데이터의 high_price", example = "2500")
34+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2735
Double highPrice;
36+
2837
@Schema(description = "차트 데이터의 low_price", example = "1500")
38+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2939
Double lowPrice;
40+
3041
@Schema(description = "차트 데이터의 price_change", example = "500")
42+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3143
Double priceChange;
44+
3245
@Schema(description = "차트 데이터의 price_change_rate", example = "+2.4%")
46+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
3347
Double priceChangeRate;
48+
3449
@Schema(description = "collection에 해당 밈코인 유무", example = "true / false")
3550
Boolean isCollected;
3651
}

src/main/java/com/memesphere/domain/search/dto/response/SearchListPreviewResponse.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.memesphere.domain.search.dto.response;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import io.swagger.v3.oas.annotations.media.Schema;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
@@ -15,18 +16,28 @@
1516
public class SearchListPreviewResponse {
1617
@Schema(description = "밈코인 id", example = "1")
1718
Long coinId;
19+
1820
@Schema(description = "밈코인 name", example = "도지코인")
1921
String name;
22+
2023
@Schema(description = "밈코인 symbol", example = "DOGE")
2124
String symbol;
25+
2226
@Schema(description = "차트 데이터의 price", example = "2000")
27+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2328
Double currentPrice;
29+
2430
@Schema(description = "차트 데이터의 weighted average price", example = "10000")
31+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2532
Double weightedAveragePrice;
33+
2634
@Schema(description = "차트 데이터의 volume", example = "5")
2735
BigDecimal volume;
36+
2837
@Schema(description = "차트 데이터의 price_change_rate", example = "+2.4%")
38+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "0.00000000")
2939
Double priceChangeRate;
40+
3041
@Schema(description = "collection에 해당 밈코인 유무", example = "true / false")
3142
Boolean isCollected;
3243
}

0 commit comments

Comments
 (0)