diff --git a/app/src/main/java/kr/co/nohorang/suryongfootprint/api/ApprovalService.kt b/app/src/main/java/kr/co/nohorang/suryongfootprint/api/ApprovalService.kt new file mode 100644 index 0000000..8340c6e --- /dev/null +++ b/app/src/main/java/kr/co/nohorang/suryongfootprint/api/ApprovalService.kt @@ -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 + + //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 + + //승인하기 + @POST("/s-footprint/approval") + fun userApproveCount( + @Body approval:Approval + ):Call + + //신고하기 + @POST("/s-footprint/report") + fun userReportCount( + @Body report:Report + ):Call +} \ No newline at end of file diff --git a/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Approval.kt b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Approval.kt new file mode 100644 index 0000000..94df9e5 --- /dev/null +++ b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Approval.kt @@ -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 { +} diff --git a/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Count.kt b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Count.kt index 6aef701..ab088e6 100644 --- a/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Count.kt +++ b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Count.kt @@ -5,7 +5,7 @@ import java.io.Serializable // JSON 타입 변환에 사용될 객체(DTO) // request의 편의성을 고려해서 선언할 것. -data class Count (@SerializedName("CountId")var count_id: String?, +data class Count (@SerializedName("CountId")var count_id: Int?, @SerializedName("userId")var user_id: String?, @SerializedName("challengeId")var challenge_id: Int?, @SerializedName("challengeCount")var challenge_count: Int?, diff --git a/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Report.kt b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Report.kt new file mode 100644 index 0000000..7ff0531 --- /dev/null +++ b/app/src/main/java/kr/co/nohorang/suryongfootprint/data/Report.kt @@ -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 { +}