package com.remax.visualnovel.api.service

import com.remax.visualnovel.BuildConfig
import com.remax.visualnovel.entity.request.AIGenerate
import com.remax.visualnovel.entity.request.AIGenerateImage
import com.remax.visualnovel.entity.request.AIHeadImgRequest
import com.remax.visualnovel.entity.request.AIIDRequest
import com.remax.visualnovel.entity.request.AlbumCreate
import com.remax.visualnovel.entity.request.AlbumDTO
import com.remax.visualnovel.entity.request.CardRequest
import com.remax.visualnovel.entity.request.ChatAlbum
import com.remax.visualnovel.entity.request.ClassificationRequest
import com.remax.visualnovel.entity.request.Gift
import com.remax.visualnovel.entity.request.QueryAlbumDTO
import com.remax.visualnovel.entity.request.SimpleCountDTO
import com.remax.visualnovel.entity.response.Album
import com.remax.visualnovel.entity.response.AlbumCreateCountOutput
import com.remax.visualnovel.entity.response.AppearanceImage
import com.remax.visualnovel.entity.response.Character
import com.remax.visualnovel.entity.response.ContentRes
import com.remax.visualnovel.entity.response.ExploreInfo
import com.remax.visualnovel.entity.response.MeetSdOutput
import com.remax.visualnovel.entity.response.Pageable
import com.remax.visualnovel.entity.response.base.Response
import retrofit2.http.Body
import retrofit2.http.POST

interface AIService {

    /**
     * 卡片上报绑定
     */
    @POST("/web/meet/bd")
    suspend fun cardBind(@Body request: AIIDRequest): Response<Character>

    /**
     * 卡片被喜欢推荐
     */
    @POST("/web/meet/rc")
    suspend fun cardLiked(): Response<Album>

    /**
     * 卡片上报
     */
    @POST("/web/meet/sd")
    suspend fun reportCard(@Body request: CardRequest): Response<MeetSdOutput>

    /**
     * 获取首页卡片列表
     */
    @POST("/web/home/rm-list")
    suspend fun getHomeCard(@Body request: ClassificationRequest): Response<List<Character>>


    /**
     * 获取单个首页卡片
     */
    @POST(" /web/home/meet-detail")
    suspend fun getHomeCardDetail(@Body request: AIIDRequest): Response<Character>

    /**
     * 获取分类列表
     */
    @POST("/web/home/classification-list")
    suspend fun getClassificationList(@Body request: ClassificationRequest): Response<List<Character>>

    /**
     * 获取榜单
     */
    @POST("/web/rank/heartbeat")
    suspend fun getHeartbeatRank(): Response<List<Character>>

    /**
     * 获取榜单
     */
    @POST("/web/rank/gift")
    suspend fun getGiftRank(): Response<List<Character>>

    /**
     * 获取榜单
     */
    @POST("/web/rank/chat")
    suspend fun getChatRank(): Response<List<Character>>

    /**
     * 获取发现页顶部数据
     */
    @POST("/web/explore/info")
    suspend fun getExploreInfo(): Response<ExploreInfo>

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

    /**
     * 解锁秘密爱慕者
     */
    @POST("/web/meet/unlock")
    suspend fun unlockSecret(@Body dto: AIIDRequest): Response<Album>

    /**
     * 设置当前图片价格
     */
    @POST("/web/ai-user/set-album-unlock-price")
    suspend fun setAlbumUnlockPrice(@Body dto: AlbumDTO): Response<Any>

    /**
     * 删除AI角色
     */
    @POST("/web/ai-user/del")
    suspend fun deleteAICharacter(@Body request: Character): Response<Any>

    /**
     * 设置当前默认图片
     */
    @POST("/web/ai-user/set-default-album")
    suspend fun setAlbumDefault(@Body dto: AlbumDTO): Response<Any>

    @POST("/web/ai-user/create-edit")
    suspend fun createOrEditAICharacter(@Body request: Character): Response<Character>

    @POST("/web/ai-user/edit-head-img")
    suspend fun editAIAvatar(@Body request: AIHeadImgRequest): Response<Any>


    @POST(BuildConfig.API_COW + "/web/gen/user-content-v1")
    suspend fun generateAICharacter(@Body request: AIGenerate): Response<ContentRes>

    /**
     * 编辑时获取我的ai角色信息
     */
    @POST("/web/ai-user/get-my-ai-user/info")
    suspend fun getAICharacter(@Body request: Character): Response<Character>

    /**
     * 访问AI个人主页时获取信息
     */
    @POST("/web/ai-user-search/base-info")
    suspend fun getAICharacterProfile(@Body request: Character): Response<Character>

    /**
     * 访问AI的统计信息
     */
    @POST("/web/ai-user/stat")
    suspend fun getAICharacterStat(@Body request: Character): Response<Character>

    /**
     * 修改点赞状态
     */
    @POST("/web/ai-user/like-or-cancel")
    suspend fun setAILikeOrCancel(@Body request: AlbumDTO): Response<Any>

    /**
     * 喜欢或取消喜欢相片
     */
    @POST("/web/album/like_or_cancel")
    suspend fun setLikeOrDislike(@Body dto: AlbumDTO): Response<Any>

    /**
     * 删除相片
     */
    @POST("/web/ai-user/album-del")
    suspend fun deleteAlbum(@Body dto: AlbumDTO): Response<Any>

    /**
     * 批量添加图片到相册
     */
    @POST("/web/ai-user/batch-add-album")
    suspend fun addAlbum(@Body dto: AlbumCreate): Response<Any>

    /**
     * 获取创作次数
     */
    @POST("/web/user/get-user-create-count")
    suspend fun getAlbumCreateCount(): Response<AlbumCreateCountOutput>

    /**
     * 购买创作次数
     */
    @POST("/web/ai/buy-create-image-count")
    suspend fun buyAlbumCreateCount(@Body dto: SimpleCountDTO): Response<Any>

    /**
     * 批量添加图片到聊天背景
     */
    @POST("/web/chat-background/batch-add")
    suspend fun addChatBackground(@Body dto: AlbumCreate): Response<Any>

    /**
     * 获取相册 分页
     */
    @POST("/web/ai-user/album-list")
    suspend fun getAlbumList(@Body dto: QueryAlbumDTO): Response<Pageable<Album>>

    /**
     * 获取用户礼物 分页
     */
    @POST("/web/ai-user-gift/list")
    suspend fun getUserGiftList(@Body dto: QueryAlbumDTO): Response<Pageable<Gift>>


    /**
     * AI一键生成-创建生成人物形象图片任务
     */
    @POST(BuildConfig.API_COW + "/web/gen/image-ct")
    suspend fun generateImageBatch(@Body request: AIGenerateImage): Response<AIGenerateImage>

    /**
     * AI一键生成-删除图片生成任务
     */
    @POST(BuildConfig.API_COW + "/web/gen/del")
    suspend fun generateImageBatchDel(@Body request: AIGenerateImage): Response<Any>

    /**
     * AI一键生成-轮询查询图片生成结果
     */
    @POST(BuildConfig.API_COW + "/web/gen/image-pl")
    suspend fun generateImageBatchQuery(@Body request: AIGenerateImage): Response<List<AppearanceImage>>

}