Skip to content

Commit

Permalink
Merge pull request #307 from boostcampwm2023/AOS-refactor/package
Browse files Browse the repository at this point in the history
ํŒจํ‚ค์ง€ ๋ถ„๋ฆฌ ๋ฐ ์•ˆ์“ฐ๋Š” ํ•จ์ˆ˜ ์ œ๊ฑฐ
  • Loading branch information
yang1318 authored Dec 14, 2023
2 parents ab2c2ef + 1714a0e commit 00e899e
Show file tree
Hide file tree
Showing 61 changed files with 211 additions and 201 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package boostcamp.and07.mindsync.data.di

import boostcamp.and07.mindsync.data.network.BoardApi
import boostcamp.and07.mindsync.data.network.LoginApi
import boostcamp.and07.mindsync.data.network.LogoutApi
import boostcamp.and07.mindsync.data.network.ProfileApi
import boostcamp.and07.mindsync.data.network.ProfileSpaceApi
import boostcamp.and07.mindsync.data.network.SpaceApi
import boostcamp.and07.mindsync.data.network.TokenApi
import boostcamp.and07.mindsync.data.network.api.BoardApi
import boostcamp.and07.mindsync.data.network.api.LoginApi
import boostcamp.and07.mindsync.data.network.api.LogoutApi
import boostcamp.and07.mindsync.data.network.api.ProfileApi
import boostcamp.and07.mindsync.data.network.api.ProfileSpaceApi
import boostcamp.and07.mindsync.data.network.api.SpaceApi
import boostcamp.and07.mindsync.data.network.api.TokenApi
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package boostcamp.and07.mindsync.data.model

import boostcamp.and07.mindsync.data.NodeGenerator
import boostcamp.and07.mindsync.data.util.NodeGenerator
import boostcamp.and07.mindsync.ui.util.Dp
import boostcamp.and07.mindsync.ui.util.ExceptionMessage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package boostcamp.and07.mindsync.data.network

import android.util.Log
import boostcamp.and07.mindsync.BuildConfig
import boostcamp.and07.mindsync.data.network.request.JoinBoard
import boostcamp.and07.mindsync.data.network.request.UpdateMindMap
import boostcamp.and07.mindsync.data.network.request.socket.JoinBoardRequest
import boostcamp.and07.mindsync.data.network.request.socket.UpdateMindMapRequest
import boostcamp.and07.mindsync.data.network.response.mindmap.SerializedCrdtTree
import boostcamp.and07.mindsync.data.network.response.mindmap.SerializedOperation
import io.socket.client.IO
Expand Down Expand Up @@ -73,7 +73,7 @@ class MindMapSocketManager {
boardId: String,
boardName: String,
) {
socket.emit(EVENT_JOIN_BOARD, Json.encodeToString(JoinBoard(boardId, boardName)))
socket.emit(EVENT_JOIN_BOARD, Json.encodeToString(JoinBoardRequest(boardId, boardName)))
}

fun updateMindMap(
Expand All @@ -82,7 +82,7 @@ class MindMapSocketManager {
) {
socket.emit(
EVENT_UPDATE_MIND_MAP,
Json.encodeToString(UpdateMindMap(serializedOperation, boardId)),
Json.encodeToString(UpdateMindMapRequest(serializedOperation, boardId)),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package boostcamp.and07.mindsync.data.network

import boostcamp.and07.mindsync.data.network.request.NewAccessTokenRequest
import boostcamp.and07.mindsync.data.network.api.TokenApi
import boostcamp.and07.mindsync.data.network.request.login.NewAccessTokenRequest
import boostcamp.and07.mindsync.data.repository.login.DataStoreConst
import boostcamp.and07.mindsync.data.repository.login.LogoutEventRepository
import boostcamp.and07.mindsync.data.repository.login.TokenRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.board.DeleteBoardRequest
import boostcamp.and07.mindsync.data.network.request.board.RestoreBoardRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.KakaoLoginRequest
import boostcamp.and07.mindsync.data.network.response.LoginResponse
import boostcamp.and07.mindsync.data.network.request.login.KakaoLoginRequest
import boostcamp.and07.mindsync.data.network.response.login.LoginResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.LogoutRequest
import boostcamp.and07.mindsync.data.network.request.login.LogoutRequest
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.response.ProfileData
import boostcamp.and07.mindsync.data.network.response.profile.ProfileData
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.GET
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.ProfileSpaceJoinRequest
import boostcamp.and07.mindsync.data.network.request.space.ProfileSpaceJoinRequest
import boostcamp.and07.mindsync.data.network.response.space.GetSpacesResponse
import boostcamp.and07.mindsync.data.network.response.space.ProfileSpaceJoinResponse
import boostcamp.and07.mindsync.data.network.response.user.UserResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.space.InviteCodeRequest
import boostcamp.and07.mindsync.data.network.response.space.InviteCodeResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package boostcamp.and07.mindsync.data.network
package boostcamp.and07.mindsync.data.network.api

import boostcamp.and07.mindsync.data.network.request.NewAccessTokenRequest
import boostcamp.and07.mindsync.data.network.response.NewAccessTokenResponse
import boostcamp.and07.mindsync.data.network.request.login.NewAccessTokenRequest
import boostcamp.and07.mindsync.data.network.response.login.NewAccessTokenResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.login

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.login

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.login

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.socket

import kotlinx.serialization.Serializable

@Serializable
data class JoinBoard(
data class JoinBoardRequest(
val boardId: String,
val boardName: String,
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.socket

import boostcamp.and07.mindsync.data.network.response.mindmap.SerializedOperation
import kotlinx.serialization.Serializable

@Serializable
data class UpdateMindMap(
data class UpdateMindMapRequest(
val operation: SerializedOperation,
val boardId: String,
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boostcamp.and07.mindsync.data.network.request
package boostcamp.and07.mindsync.data.network.request.space

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package boostcamp.and07.mindsync.data.network.response.board

import kotlinx.serialization.Serializable

@Serializable
data class BoardDto(
val boardId: String,
val boardName: String,
val createdAt: String,
val imageUrl: String,
val isDeleted: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,5 @@ import kotlinx.serialization.Serializable
data class BoardsResponse(
val statusCode: Int,
val message: String,
val data: List<BoardsData>,
)

@Serializable
data class BoardsData(
val boardId: String,
val boardName: String,
val createdAt: String,
val imageUrl: String,
val isDeleted: Boolean,
val data: List<BoardDto>,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package boostcamp.and07.mindsync.data.network.response.board

import kotlinx.serialization.Serializable

@Serializable
data class CreateBoardDto(
val boardId: String,
val date: String,
val imageUrl: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ import kotlinx.serialization.Serializable
data class CreateBoardResponse(
val message: String,
val statusCode: Int,
val data: CreateBoardData?,
)

@Serializable
data class CreateBoardData(
val boardId: String,
val date: String,
val imageUrl: String,
val data: CreateBoardDto?,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package boostcamp.and07.mindsync.data.network.response.login

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class LoginDto(
@SerialName("access_token")
val accessToken: String,
@SerialName("refresh_token")
val refreshToken: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package boostcamp.and07.mindsync.data.network.response.login

import kotlinx.serialization.Serializable

@Serializable
data class LoginResponse(
val statusCode: Int,
val message: String,
val error: String? = null,
val data: LoginDto? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package boostcamp.and07.mindsync.data.network.response.login

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class NewAccessTokenDto(
@SerialName("access_token")
val accessToken: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package boostcamp.and07.mindsync.data.network.response.login

import kotlinx.serialization.Serializable

@Serializable
data class NewAccessTokenResponse(
val statusCode: Int,
val message: String,
val error: String? = null,
val data: NewAccessTokenDto? = null,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package boostcamp.and07.mindsync.data.network.response.mindmap

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class NodeDto(
@SerialName("children")
val children: List<String>,
@SerialName("targetId")
val targetId: String,
@SerialName("parentId")
val parentId: String,
@SerialName("description")
val description: String = "",
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package boostcamp.and07.mindsync.data.network.response.mindmap

import boostcamp.and07.mindsync.data.IdGenerator
import boostcamp.and07.mindsync.data.crdt.CrdtTree
import boostcamp.and07.mindsync.data.crdt.Operation
import boostcamp.and07.mindsync.data.crdt.OperationAdd
Expand All @@ -14,6 +13,7 @@ import boostcamp.and07.mindsync.data.model.CircleNode
import boostcamp.and07.mindsync.data.model.Node
import boostcamp.and07.mindsync.data.model.RectangleNode
import boostcamp.and07.mindsync.data.model.Tree
import boostcamp.and07.mindsync.data.util.IdGenerator
import boostcamp.and07.mindsync.ui.util.ExceptionMessage

fun SerializedCrdtTree.toCrdtTree(): CrdtTree {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,3 @@ data class SerializedCrdtTree(
@SerialName("tree")
val tree: SerializedTree,
)

@Serializable
data class SerializedOperationLog(
val operation: SerializedOperation,
val oldDescription: String? = null,
val oldParentId: String? = null,
)

@Serializable
data class SerializedOperation(
val operationType: String,
val id: String,
val clock: Clock,
val description: String? = null,
val parentId: String? = null,
)

@Serializable
data class SerializedTree(
@SerialName("nodes")
val nodes: List<NodeDto>,
)

@Serializable
data class NodeDto(
@SerialName("children")
val children: List<String>,
@SerialName("targetId")
val targetId: String,
@SerialName("parentId")
val parentId: String,
@SerialName("description")
val description: String = "",
)
Loading

0 comments on commit 00e899e

Please sign in to comment.