package com.remax.visualnovel.api.service

import com.remax.visualnovel.BuildConfig
import com.remax.visualnovel.entity.request.AIFeedback
import com.remax.visualnovel.entity.request.AIIDRequest
import com.remax.visualnovel.entity.request.AIIsShowDTO
import com.remax.visualnovel.entity.request.ChatAlbum
import com.remax.visualnovel.entity.request.ChatSetting
import com.remax.visualnovel.entity.request.HeartbeatBuy
import com.remax.visualnovel.entity.request.RTCRequest
import com.remax.visualnovel.entity.request.SearchPage
import com.remax.visualnovel.entity.request.SimpleDataDTO
import com.remax.visualnovel.entity.request.VoiceTTS
import com.remax.visualnovel.entity.response.Album
import com.remax.visualnovel.entity.response.Character
import com.remax.visualnovel.entity.response.ChatBackground
import com.remax.visualnovel.entity.response.ChatSet
import com.remax.visualnovel.entity.response.Friends
import com.remax.visualnovel.entity.response.HeartbeatLevelOutput
import com.remax.visualnovel.entity.response.Pageable
import com.remax.visualnovel.entity.response.Token
import com.remax.visualnovel.entity.response.VoiceASR
import com.remax.visualnovel.entity.response.base.Response
import retrofit2.http.Body
import retrofit2.http.POST

interface ChatService {

    /**
     * 发送开场白消息
     */
    @POST("/web/chat/send-dialogue-prologue-message")
    suspend fun sendDialogueMsg(@Body request: AIIDRequest): Response<Any>

    /**
     * 获取IM中AI的基础信息
     */
    @POST("/web/ai-user-search/im-base-info")
    suspend fun getIMAICharacterProfile(@Body request: Character): Response<Character>

    /**
     * 访问解锁加密图片
     */
    @POST("/web/ai-user/view-unlock-album-img")
    suspend fun viewAlbumImg(@Body request: ChatAlbum): Response<Album>

    /**
     * 关系列表
     */
    @POST("/web/ai-user/heartbeat-relation-list")
    suspend fun getMyFriends(@Body request: SearchPage): Response<Pageable<Friends>>


    @POST("/web/ai-user/heartbeat-rank")
    suspend fun getMyFriendRank(): Response<Double>

    /**
     * 生成提示词
     */
    @POST(BuildConfig.API_COW + "/web/gen/sup-content-v2")
    suspend fun getPrompts(@Body request: AIIDRequest): Response<List<String>>

    /**
     * AI回话点赞/点踩
     */
    @POST(BuildConfig.API_PIGEON + "/web/fb/v1")
    suspend fun aiFeedback(@Body request: AIFeedback): Response<Any>

    /**
     * 获取RTC
     */
    @POST(BuildConfig.API_COW + "/web/voice-chat/gen-rtc-tk")
    suspend fun getRTCToken(@Body request: RTCRequest): Response<Token>

    /**
     * 操作通话
     */
    @POST(BuildConfig.API_COW + "/web/voice-chat/opt")
    suspend fun voiceChatOpt(@Body request: RTCRequest): Response<Any>

    /**
     * 获取聊天背景列表
     */
    @POST("/web/chat-background/list")
    suspend fun getChatBackgroundList(@Body request: AIIDRequest): Response<List<ChatBackground>>

    /**
     * 获取聊天设置
     */
    @POST("/web/chat-set/get-my")
    suspend fun getChatSetting(@Body request: ChatSetting): Response<ChatSet>

    /**
     * 修改聊天设置
     */
    @POST("/web/chat-set/set")
    suspend fun setChatSetting(@Body request: ChatSet): Response<Any>

    /**
     * 修改聊天气泡
     */
    @POST("/web/chat-set/set-chat-bubble")
    suspend fun setChatBubble(@Body request: ChatSetting): Response<Any>

    /**
     * 修改聊天模型
     */
    @POST("/web/chat-set/set-chat-model")
    suspend fun setChatModel(@Body request: ChatSetting): Response<Any>

    /**
     * 修改是否自动播放语音
     */
    @POST("/web/chat-set/auto-play-voice")
    suspend fun setChatAutoPlay(@Body request: ChatSetting): Response<Any>

    /**
     * 修改聊天背景图
     */
    @POST("/web/chat-background/set-background")
    suspend fun setChatBackground(@Body request: ChatSetting): Response<Any>

    /**
     * 删除聊天背景图
     */
    @POST("/web/chat-background/del")
    suspend fun deleteChatBackground(@Body request: ChatSetting): Response<Any>

    /**
     * 展示心动关系开关
     */
    @POST("/web/ai-user/heartbeat-relation-switch")
    suspend fun relationSwitch(@Body request: AIIsShowDTO): Response<Any>

    /**
     * 语音转文本
     */
    @POST(BuildConfig.API_COW + "/web/voice/asr-v2")
    suspend fun voiceASR(@Body request: SimpleDataDTO): Response<VoiceASR>

    /**
     * 生成语音
     */
    @POST(BuildConfig.API_COW + "/web/voice/tts-v2")
    suspend fun voiceTTS(@Body request: VoiceTTS): Response<String>

    /**
     * 获取心动等级
     */
    @POST("/web/ai-user/heartbeat-level")
    suspend fun getHeartbeatLevel(@Body request: Character): Response<HeartbeatLevelOutput>

    /**
     * 购买心动值
     */
    @POST("/web/ai-user/buy-heartbeat-val")
    suspend fun buyHeartbeatVal(@Body request: HeartbeatBuy): Response<Any>

}