-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#4 community
- Loading branch information
Showing
30 changed files
with
1,366 additions
and
652 deletions.
There are no files selected for viewing
49 changes: 0 additions & 49 deletions
49
app/src/main/java/com/example/energy/data/CommunityPostDatabase.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
app/src/main/java/com/example/energy/data/repository/community/Comment.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
app/src/main/java/com/example/energy/data/repository/community/CommentDao.kt
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
app/src/main/java/com/example/energy/data/repository/community/CommunityInterface.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,89 @@ | ||
package com.example.energy.data.repository.community | ||
|
||
import com.example.energy.data.repository.map.ListResponse | ||
import okhttp3.MultipartBody | ||
import retrofit2.Call | ||
import retrofit2.http.Body | ||
import retrofit2.http.DELETE | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.Multipart | ||
import retrofit2.http.POST | ||
import retrofit2.http.Part | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface CommunityInterface { | ||
|
||
//전체 커뮤니티 조회 api | ||
@GET("/api/v1/boards") | ||
fun getListCommunity( | ||
@Header("Authorization") accessToken: String, | ||
@Query("category") category: String, | ||
@Query("cursor") cursor: Int? = 0, | ||
@Query("limit") limit: Int? = 10, | ||
@Query("sort") sort: String? = "LATEST", | ||
): Call<CommunityResponse> | ||
|
||
|
||
//개별 상세 커뮤니티 조회 api | ||
@GET("/api/v1/boards/{boardId}") | ||
fun getDetailCommunity( | ||
@Header("Authorization") accessToken: String, | ||
@Path("boardId") boardId: Int, | ||
): Call<DetailResponse> | ||
|
||
|
||
//게시글 작성 api | ||
@POST("/api/v1/boards") | ||
fun postBoard( | ||
@Header("Authorization") accessToken: String, | ||
@Body request: PostBoardRequest, | ||
): Call<UploadResponse> | ||
|
||
|
||
// //게시글 삭제 api | ||
// @DELETE("/api/v1/boards/{boardId}") | ||
// fun deleteBoard( | ||
// @Header("Authorization") accessToken: String, | ||
// @Path("boardId") boardId: Int, | ||
// ) | ||
|
||
|
||
//이미지 업로드 api | ||
@Multipart | ||
@POST("/api/v1/boards/images") | ||
fun uploadImages( | ||
@Header("Authorization") accessToken: String, | ||
@Part("images") images: UploadImagesRequest | ||
): Call<UploadImagesResponse> | ||
|
||
|
||
//게시글 좋아요 추가 api | ||
@POST("/api/v1/boards/{boardId}/likes") | ||
fun postLikeBoard( | ||
@Header("Authorization") accessToken: String, | ||
@Path("boardId") boardId: Int, | ||
): Call<LikeResponse> | ||
//게시글 좋아요 삭제 api | ||
@DELETE("/api/v1/boards/{boardId}/likes") | ||
fun deleteLikeBoard( | ||
@Header("Authorization") accessToken: String, | ||
@Path("boardId") boardId: Int, | ||
): Call<LikeResponse> | ||
|
||
//커뮤니티 댓글 조회 api | ||
@GET("/api/v1/boards/{boardId}/comments") | ||
fun getListComment( | ||
@Header("Authorization") accessToken: String, | ||
@Path("boardId") boardId: Int, | ||
): Call<CommentListResponse> | ||
|
||
//댓글 작성 api | ||
@POST("/api/v1/boards/{boardId}/comments") | ||
fun writeCommentBoard( | ||
@Header("Authorization") accessToken: String, | ||
@Path("boardId") boardId: Int, | ||
@Body request: WriteCommentRequest, | ||
): Call<CommentResponse> | ||
} |
23 changes: 0 additions & 23 deletions
23
app/src/main/java/com/example/energy/data/repository/community/CommunityPost.kt
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
app/src/main/java/com/example/energy/data/repository/community/CommunityPostDao.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.