Skip to content

Commit

Permalink
[ADD] #75 approval, report data 및 service 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jioniy committed Mar 27, 2022
1 parent 0eb4bcb commit 478a7fc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
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>
}
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 {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand Down
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 {
}

0 comments on commit 478a7fc

Please sign in to comment.