-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] #75 approval, report data 및 service 구현
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/src/main/java/kr/co/nohorang/suryongfootprint/api/ApprovalService.kt
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,30 @@ | ||
package kr.co.nohorang.suryongfootprint.api | ||
|
||
import kr.co.nohorang.suryongfootprint.data.* | ||
import retrofit2.Call | ||
import retrofit2.http.* | ||
|
||
interface ApprovalService { | ||
|
||
//COUNT에 대한 USER의 승인 여부 가져오기 (버튼 비활성화용) -> 승인 여부 반환 | ||
@GET("/s-footprint/approval/count/{count_id}/user/{user_id}") | ||
fun getUserApproval(@Path("count_id") count_id:Int, | ||
@Path("user_id") user_id:String):Call<Approval> | ||
|
||
//COUNT에 대한 USER의 신고 여부 가져오기(버튼 비활성화용) | ||
@GET("/s-footprint/report/count/{count_id}/user/{user_id}") | ||
fun getUserReport(@Path("count_id") count_id:Int, | ||
@Path("user_id") user_id:String):Call<Report> | ||
|
||
//승인하기 | ||
@POST("/s-footprint/approval") | ||
fun userApproveCount( | ||
@Body approval:Approval | ||
):Call<String> | ||
|
||
//신고하기 | ||
@POST("/s-footprint/report") | ||
fun userReportCount( | ||
@Body report:Report | ||
):Call<String> | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/kr/co/nohorang/suryongfootprint/data/Approval.kt
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,9 @@ | ||
package kr.co.nohorang.suryongfootprint.data | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import java.io.Serializable | ||
|
||
data class Approval(@SerializedName("CountId")var count_id: Int?, | ||
@SerializedName("userId")var user_id: String? | ||
) : Serializable { | ||
} |
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/kr/co/nohorang/suryongfootprint/data/Report.kt
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,9 @@ | ||
package kr.co.nohorang.suryongfootprint.data | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import java.io.Serializable | ||
|
||
data class Report(@SerializedName("CountId")var count_id: Int?, | ||
@SerializedName("userId")var user_id: String? | ||
) : Serializable { | ||
} |