-
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.
Browse files
Browse the repository at this point in the history
[Feat/#47] ai designer 기능 구현
- Loading branch information
Showing
80 changed files
with
2,350 additions
and
88 deletions.
There are no files selected for viewing
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
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
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
21 changes: 21 additions & 0 deletions
21
core/network/src/main/java/com/sample/network/di/AiModule.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,21 @@ | ||
package com.sample.network.di | ||
|
||
import com.hmh.hamyeonham.common.qualifier.Unsecured | ||
import com.sample.network.service.AiService | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import retrofit2.Retrofit | ||
import retrofit2.create | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object AiModule { | ||
@Provides | ||
@Singleton | ||
fun provideAiApi( | ||
@Unsecured retrofit: Retrofit, | ||
): AiService = retrofit.create() | ||
} |
24 changes: 24 additions & 0 deletions
24
core/network/src/main/java/com/sample/network/reponse/MeetingProgressResponse.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,24 @@ | ||
package com.sample.network.reponse | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class MeetingProgressResponse( | ||
@SerialName("introduceMyself") | ||
val introduceMyself: Int?, | ||
@SerialName("iceBreaking") | ||
val iceBreaking: Int?, | ||
@SerialName("brainstorming") | ||
val brainstorming: Int?, | ||
@SerialName("topicSelection") | ||
val topicSelection: Int, | ||
@SerialName("progressSharing") | ||
val progressSharing: Int?, | ||
@SerialName("roleDivision") | ||
val roleDivision: Int?, | ||
@SerialName("troubleShooting") | ||
val troubleShooting: Int?, | ||
@SerialName("feedback") | ||
val feedback: Int, | ||
) |
24 changes: 24 additions & 0 deletions
24
core/network/src/main/java/com/sample/network/request/MeetingProgressRequest.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,24 @@ | ||
package com.sample.network.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class MeetingProgressRequest( | ||
@SerialName("introduceMyself") | ||
val introduceMyself: Boolean, | ||
@SerialName("iceBreaking") | ||
val iceBreaking: Boolean, | ||
@SerialName("brainstorming") | ||
val brainstorming: Boolean, | ||
@SerialName("topicSelection") | ||
val topicSelection: Boolean, | ||
@SerialName("progressSharing") | ||
val progressSharing: Boolean, | ||
@SerialName("roleDivision") | ||
val roleDivision: Boolean, | ||
@SerialName("troubleShooting") | ||
val troubleShooting: Boolean, | ||
@SerialName("feedback") | ||
val feedback: Boolean, | ||
) |
42 changes: 42 additions & 0 deletions
42
core/network/src/main/java/com/sample/network/service/AiService.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,42 @@ | ||
package com.sample.network.service | ||
|
||
import com.sample.network.model.BaseResponse | ||
import com.sample.network.reponse.LoginResponse | ||
import com.sample.network.reponse.MeetingProgressResponse | ||
import com.sample.network.reponse.RefreshResponse | ||
import com.sample.network.request.MeetingProgressRequest | ||
import okhttp3.MultipartBody | ||
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.Query | ||
|
||
interface AiService { | ||
|
||
@GET("/api/assistant/pm/meeting") | ||
suspend fun getMeetingProgress( | ||
@Query("pmRequestDTO") setMeetingProgress: MeetingProgressRequest, | ||
@Query("time") time : Int?, | ||
@Query("numberOfParticipants") participants : Int?, | ||
): BaseResponse<MeetingProgressResponse> | ||
|
||
@Multipart | ||
@POST("/api/assistant/pm/summary") | ||
suspend fun sendMeetingRecordFile( | ||
@Part file: MultipartBody.Part, | ||
): BaseResponse<String> | ||
|
||
@GET("/api/assistant/designer/branding") | ||
suspend fun getBrandingData( | ||
@Query("projectInfo") brandingTextRequest : String?, | ||
): BaseResponse<String> | ||
|
||
@GET("/api/assistant/designer/makeImage") | ||
suspend fun getProjectImageData( | ||
@Query("imageInfo") imageTextRequest : String?, | ||
): BaseResponse<String> | ||
} |
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,54 @@ | ||
package com.zucchini.data | ||
|
||
import com.sample.network.service.AiService | ||
import com.zucchini.domain.model.ai.ProgressMeeting | ||
import com.zucchini.domain.model.ai.ProgressMeetingInfo | ||
import com.zucchini.domain.model.ai.SetProgressMeeting | ||
import com.zucchini.domain.repository.AiRepository | ||
import com.zucchini.mapper.toMeetingProgress | ||
import com.zucchini.mapper.toMeetingProgressRequest | ||
import okhttp3.MediaType.Companion.toMediaTypeOrNull | ||
import okhttp3.MultipartBody | ||
import okhttp3.RequestBody.Companion.asRequestBody | ||
import java.io.File | ||
import javax.inject.Inject | ||
|
||
class AiRepositoryImpl | ||
@Inject | ||
constructor( | ||
private val authService: AiService, | ||
) : AiRepository { | ||
override suspend fun getProgressMeetingData( | ||
setProgressMeeting: SetProgressMeeting?, | ||
progressMeetingInfo: ProgressMeetingInfo, | ||
): Result<ProgressMeeting> = | ||
runCatching { | ||
authService | ||
.getMeetingProgress( | ||
progressMeetingInfo.toMeetingProgressRequest(), | ||
setProgressMeeting?.meetingTime, | ||
setProgressMeeting?.participants, | ||
).data | ||
.toMeetingProgress() | ||
} | ||
|
||
override suspend fun sendMeetingRecordFile(recordFile: String): Result<String> { | ||
val recordingFile = File(recordFile) | ||
val requestFile = recordingFile.asRequestBody("audio/*".toMediaTypeOrNull()) | ||
val body = MultipartBody.Part.createFormData("file", recordingFile.name, requestFile) | ||
|
||
return runCatching { | ||
authService.sendMeetingRecordFile(body).data | ||
} | ||
} | ||
|
||
override suspend fun getProjectBranding(projectInfoTextRequest: String?): Result<String> = | ||
runCatching { | ||
authService.getBrandingData(projectInfoTextRequest).data | ||
} | ||
|
||
override suspend fun getProjectImage(projectImageRequest: String?): Result<String> = | ||
runCatching { | ||
authService.getProjectImageData(projectImageRequest).data | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
data/src/main/java/com/zucchini/data/DevelopersRepositoryImpl.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
4 changes: 2 additions & 2 deletions
4
data/src/main/java/com/zucchini/data/ProjectsRepositoryImpl.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
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,17 @@ | ||
package com.zucchini.di | ||
|
||
import com.zucchini.data.AiRepositoryImpl | ||
import com.zucchini.domain.repository.AiRepository | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract interface AiBinderModule { | ||
@Binds | ||
@Singleton | ||
abstract fun provideAiRepository(aiRepository: AiRepositoryImpl): AiRepository | ||
} |
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
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
30 changes: 30 additions & 0 deletions
30
data/src/main/java/com/zucchini/mapper/ProgressMeetingMapper.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 com.zucchini.mapper | ||
|
||
import com.sample.network.reponse.MeetingProgressResponse | ||
import com.sample.network.request.MeetingProgressRequest | ||
import com.zucchini.domain.model.ai.ProgressMeeting | ||
import com.zucchini.domain.model.ai.ProgressMeetingInfo | ||
|
||
internal fun MeetingProgressResponse.toMeetingProgress(): ProgressMeeting = | ||
ProgressMeeting( | ||
introduceMyself = introduceMyself, | ||
iceBreaking = iceBreaking, | ||
brainstorming = brainstorming, | ||
topicSelection = topicSelection, | ||
progressSharing = progressSharing, | ||
roleDivision = roleDivision, | ||
troubleShooting = troubleShooting, | ||
feedback = feedback, | ||
) | ||
|
||
internal fun ProgressMeetingInfo.toMeetingProgressRequest(): MeetingProgressRequest = | ||
MeetingProgressRequest( | ||
introduceMyself = introduceMyself, | ||
iceBreaking = iceBreaking, | ||
brainstorming = brainstorming, | ||
topicSelection = topicSelection, | ||
progressSharing = progressSharing, | ||
roleDivision = roleDivision, | ||
troubleShooting = troubleShooting, | ||
feedback = feedback , | ||
) |
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
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
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
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/zucchini/domain/model/ai/ProgressMeeting.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,12 @@ | ||
package com.zucchini.domain.model.ai | ||
|
||
data class ProgressMeeting( | ||
val introduceMyself: Int? = 600000, | ||
val iceBreaking: Int? = 600000, | ||
val brainstorming: Int? = 600000, | ||
val topicSelection: Int? = 600000, | ||
val progressSharing: Int? = 600000, | ||
val roleDivision: Int? = 600000, | ||
val troubleShooting: Int? = 600000, | ||
val feedback: Int? = 600000, | ||
) |
Oops, something went wrong.