-
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.
Showing
10 changed files
with
407 additions
and
16 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
24 changes: 24 additions & 0 deletions
24
Server/src/docs/asciidoc/snippets/adjustment/videoadjustment.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:doctype: book | ||
:icons: font | ||
:source-highlighter: highlightjs | ||
:toc: left | ||
:toclevels: 2 | ||
:sectlinks: | ||
:docinfo: shared-head | ||
|
||
[[Video-Adjustment]] | ||
= 비디오별 정산 내역 API | ||
|
||
IMPORTANT: month 를 null 로 주면 연도별 조회, year 을 null 로 주면 전체 조회 | ||
|
||
== 비디오별 정산 내역 비율 | ||
=== HTTP Request | ||
include::{snippets}/adjustment/calculatevideorate/http-request.adoc[] | ||
==== Request Headers | ||
include::{snippets}/adjustment/calculatevideorate/request-headers.adoc[] | ||
==== Request Query Parameters | ||
include::{snippets}/adjustment/calculatevideorate/request-parameters.adoc[] | ||
=== HTTP Response | ||
include::{snippets}/adjustment/calculatevideorate/http-response.adoc[] | ||
==== Response Fields | ||
include::{snippets}/adjustment/calculatevideorate/response-fields.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
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
Server/src/main/java/com/server/domain/adjustment/repository/dto/VideoAdjustmentData.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.server.domain.adjustment.repository.dto; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class VideoAdjustmentData { | ||
|
||
private Long videoId; | ||
private String videoName; | ||
private Integer amount; | ||
|
||
@QueryProjection | ||
public VideoAdjustmentData(Long videoId, String videoName, Integer amount) { | ||
this.videoId = videoId; | ||
this.videoName = videoName; | ||
this.amount = amount; | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
.../main/java/com/server/domain/adjustment/service/dto/response/VideoAdjustmentResponse.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,29 @@ | ||
package com.server.domain.adjustment.service.dto.response; | ||
|
||
import com.server.domain.adjustment.repository.dto.VideoAdjustmentData; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Builder | ||
@Getter | ||
public class VideoAdjustmentResponse { | ||
|
||
private Long videoId; | ||
private String videoName; | ||
private Integer amount; | ||
private Float portion; | ||
|
||
public static VideoAdjustmentResponse of(VideoAdjustmentData data, int total) { | ||
|
||
float portion = ((float) (data.getAmount())) / total; | ||
|
||
return VideoAdjustmentResponse.builder() | ||
.videoId(data.getVideoId()) | ||
.videoName(data.getVideoName()) | ||
.amount(data.getAmount()) | ||
.portion(portion) | ||
.build(); | ||
} | ||
} |
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
Oops, something went wrong.