diff --git a/src/main/kotlin/com/hiczp/bilibili/api/app/AppAPI.kt b/src/main/kotlin/com/hiczp/bilibili/api/app/AppAPI.kt index 650602a..d329031 100644 --- a/src/main/kotlin/com/hiczp/bilibili/api/app/AppAPI.kt +++ b/src/main/kotlin/com/hiczp/bilibili/api/app/AppAPI.kt @@ -143,4 +143,25 @@ interface AppAPI { @Field("dislike") dislike: Int = 0, @Field("from") from: Int? = null ): Deferred + + /** + * 投币 + * 一个视频能投几个硬币是怎么获得的未知 + * + * @param multiply 投币数量 + * @param selectLike 为 1 表示投币的同时为视频点赞, 对番剧投币时, 该值总为 0 + * @param upId 该值似乎总为 0 + */ + @Suppress("SpellCheckingInspection") + @POST("/x/v2/view/coin/add") + @FormUrlEncoded + @Headers(Header.FORCE_FORM_BODY) + fun addCoin( + @Field("aid") aid: Long, + @Field("avtype") avType: Int = 1, + @Field("from") from: Int? = null, + @Field("multiply") multiply: Int, + @Field("select_like") selectLike: Int = 0, + @Field("upid") upId: Long? = 0 + ): Deferred } diff --git a/src/main/kotlin/com/hiczp/bilibili/api/app/model/AddCoinResponse.kt b/src/main/kotlin/com/hiczp/bilibili/api/app/model/AddCoinResponse.kt new file mode 100644 index 0000000..ef511a5 --- /dev/null +++ b/src/main/kotlin/com/hiczp/bilibili/api/app/model/AddCoinResponse.kt @@ -0,0 +1,21 @@ +package com.hiczp.bilibili.api.app.model + +import com.google.gson.annotations.SerializedName + +data class AddCoinResponse( + @SerializedName("code") + var code: Int, // 0 + @SerializedName("data") + var `data`: Data, + @SerializedName("message") + var message: String, // 0 + @SerializedName("ttl") + var ttl: Int // 1 +) { + data class Data( + @SerializedName("like") + var like: Boolean, // false + @SerializedName("prompt") + var prompt: Boolean? // true + ) +} diff --git a/src/main/kotlin/com/hiczp/bilibili/api/main/MainAPI.kt b/src/main/kotlin/com/hiczp/bilibili/api/main/MainAPI.kt index 0dbdda5..a058239 100644 --- a/src/main/kotlin/com/hiczp/bilibili/api/main/MainAPI.kt +++ b/src/main/kotlin/com/hiczp/bilibili/api/main/MainAPI.kt @@ -200,4 +200,68 @@ interface MainAPI { @Field("rpid") replyId: Long, @Field("type") type: Int = 1 ): Deferred + + /** + * 查看视频的删除日志 + * 这个 API 看起来有翻页, 其实没有页 + * 视频 -> 评论 -> 右上角三个点 ->查看删除日志 + * + * @return 有$replyCount条评论因$reportCount次举报已被管理员移除 + */ + @GET("/x/v2/reply/log") + fun deleteLog( + @Query("oid") oid: Long, + @Query("pn") pn: Int = 1, + @Query("ps") pageSize: Int = 20, + @Query("type") type: Int = 1 + ): Deferred + + /** + * 改变与某用户的关系(关注, 取消关注) + * + * @param action 动作类型(1: 关注;2: 取消关注) + * @param followId 操作对象的 ID(例如欲关注的那个用户的 ID) + * @param reSrc 不明确 + */ + @POST("/x/relation/modify") + @FormUrlEncoded + @Headers(Header.FORCE_FORM_BODY) + fun modifyRelation( + @Field("act") action: Int, + @Field("fid") followId: Long, + @Field("re_src") reSrc: Int? = 32 + ): Deferred + + /** + * 关注的分组 + * 默认分组永远是 0 + */ + @GET("/x/relation/tag/m/tags") + fun relationTags(): Deferred + + /** + * 创建关注分组 + * + * @param tag 不能包含绝大部分符号 + */ + @POST("/x/relation/tag/create") + @FormUrlEncoded + @Headers(Header.FORCE_FORM_BODY) + fun createRelationTag(@Field("tag") tag: String): Deferred + + /** + * 设置分组(对某个用户的关注的分组) + * 用户 -> 关注 -> 设置分组 + * + * @param followIds 关注的人(不明确能不能有多个) + * @param tagIds 分组 id. 可以有多个, 用逗号隔开, 例如 "-10,110641" + */ + @Suppress("SpellCheckingInspection") + @POST("/x/relation/tags/addUsers") + @FormUrlEncoded + @Headers(Header.FORCE_FORM_BODY) + fun relationAddUsers( + @Field("fids") followIds: String, + @Field("tagids") tagIds: String + ): Deferred } diff --git a/src/main/kotlin/com/hiczp/bilibili/api/main/model/CreateRelationTagResponse.kt b/src/main/kotlin/com/hiczp/bilibili/api/main/model/CreateRelationTagResponse.kt new file mode 100644 index 0000000..2275f29 --- /dev/null +++ b/src/main/kotlin/com/hiczp/bilibili/api/main/model/CreateRelationTagResponse.kt @@ -0,0 +1,20 @@ +package com.hiczp.bilibili.api.main.model + +import com.google.gson.annotations.SerializedName + +data class CreateRelationTagResponse( + @SerializedName("code") + var code: Int, // 0 + @SerializedName("data") + var `data`: Data, + @SerializedName("message") + var message: String, // 0 + @SerializedName("ttl") + var ttl: Int // 1 +) { + @Suppress("SpellCheckingInspection") + data class Data( + @SerializedName("tagid") + var tagid: Int // 110641 + ) +} diff --git a/src/main/kotlin/com/hiczp/bilibili/api/main/model/DeleteLog.kt b/src/main/kotlin/com/hiczp/bilibili/api/main/model/DeleteLog.kt new file mode 100644 index 0000000..5cd403a --- /dev/null +++ b/src/main/kotlin/com/hiczp/bilibili/api/main/model/DeleteLog.kt @@ -0,0 +1,36 @@ +package com.hiczp.bilibili.api.main.model + +import com.google.gson.annotations.SerializedName + +data class DeleteLog( + @SerializedName("code") + var code: Int, // 0 + @SerializedName("data") + var `data`: Data, + @SerializedName("message") + var message: String, // 0 + @SerializedName("ttl") + var ttl: Int // 1 +) { + data class Data( + @SerializedName("logs") + var logs: Any?, // null + @SerializedName("page") + var page: Page, + @SerializedName("reply_count") + var replyCount: Int, // 11 + @SerializedName("report_count") + var reportCount: Int // 28 + ) { + data class Page( + @SerializedName("num") + var num: Int, // 1 + @SerializedName("pages") + var pages: Int, // 0 + @SerializedName("size") + var size: Int, // 20 + @SerializedName("total") + var total: Int // 0 + ) + } +} diff --git a/src/main/kotlin/com/hiczp/bilibili/api/main/model/RelationTags.kt b/src/main/kotlin/com/hiczp/bilibili/api/main/model/RelationTags.kt new file mode 100644 index 0000000..5839ae9 --- /dev/null +++ b/src/main/kotlin/com/hiczp/bilibili/api/main/model/RelationTags.kt @@ -0,0 +1,38 @@ +package com.hiczp.bilibili.api.main.model + +import com.google.gson.annotations.SerializedName + +data class RelationTags( + @SerializedName("code") + var code: Int, // 0 + @SerializedName("data") + var `data`: Data, + @SerializedName("message") + var message: String, // 0 + @SerializedName("ttl") + var ttl: Int // 1 +) { + data class Data( + /** + * all 不是指全部, 而是指 公开关注 + */ + @SerializedName("all") + var all: List, + @SerializedName("default") + var default: List, + @SerializedName("list") + var list: List, + @SerializedName("special") + var special: List + ) { + @Suppress("SpellCheckingInspection") + data class Tag( + @SerializedName("count") + var count: Int, // 28 + @SerializedName("name") + var name: String, // 公开关注 + @SerializedName("tagid") + var tagid: Int // -1 + ) + } +}