diff --git a/app/src/main/java/com/huanchengfly/tieba/post/adapters/UserLikeForumAdapter.java b/app/src/main/java/com/huanchengfly/tieba/post/adapters/UserLikeForumAdapter.java index e17c5130..1180ab49 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/adapters/UserLikeForumAdapter.java +++ b/app/src/main/java/com/huanchengfly/tieba/post/adapters/UserLikeForumAdapter.java @@ -17,10 +17,10 @@ public class UserLikeForumAdapter extends BaseSingleTypeAdapter + + /** + * 查看用户的所有主题贴/回复 + * + * @param uid 用户 ID + * @param page 分页页码(从 1 开始) + * @param isThread 是否查看主题贴 + */ + fun userPostFlow( + uid: Long, + page: Int = 1, + isThread: Boolean = true, + ): Flow + + fun userLikeForumFlow( + uid: String, + page: Int = 1, + ): Flow } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt index 7ccd2e31..b126cf8f 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt @@ -100,6 +100,9 @@ import com.huanchengfly.tieba.post.api.models.protos.topicList.TopicListResponse import com.huanchengfly.tieba.post.api.models.protos.userLike.UserLikeRequest import com.huanchengfly.tieba.post.api.models.protos.userLike.UserLikeRequestData import com.huanchengfly.tieba.post.api.models.protos.userLike.UserLikeResponse +import com.huanchengfly.tieba.post.api.models.protos.userPost.UserPostRequest +import com.huanchengfly.tieba.post.api.models.protos.userPost.UserPostRequestData +import com.huanchengfly.tieba.post.api.models.protos.userPost.UserPostResponse import com.huanchengfly.tieba.post.api.models.web.ForumBean import com.huanchengfly.tieba.post.api.models.web.ForumHome import com.huanchengfly.tieba.post.api.models.web.HotMessageListBean @@ -1350,4 +1353,38 @@ object MixedTiebaApiImpl : ITiebaApi { ) ) } + + override fun userPostFlow(uid: Long, page: Int, isThread: Boolean): Flow { + return RetrofitTiebaApi.OFFICIAL_PROTOBUF_TIEBA_V12_API.userPostFlow( + buildProtobufRequestBody( + UserPostRequest( + UserPostRequestData( + uid = uid, + rn = 20, + is_thread = if (isThread) 1 else 0, + need_content = 1, + pn = page, + common = buildCommonRequest(clientVersion = ClientVersion.TIEBA_V12), + scr_w = getScreenWidth(), + scr_h = getScreenHeight(), + scr_dip = App.ScreenInfo.DENSITY.toDouble(), + q_type = 1, + is_view_card = 1 + ) + ), + clientVersion = ClientVersion.TIEBA_V12, + needSToken = true + ) + ) + } + + override fun userLikeForumFlow(uid: String, page: Int): Flow { + val myUid = AccountUtil.getUid() + return RetrofitTiebaApi.OFFICIAL_TIEBA_API.userLikeForumFlow( + page = page, + uid = myUid, + friendUid = if (!TextUtils.equals(uid, myUid)) uid else null, + is_guest = if (!TextUtils.equals(uid, myUid)) "1" else null + ) + } } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.java b/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.java deleted file mode 100644 index e473f55b..00000000 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.huanchengfly.tieba.post.api.models; - -import com.google.gson.annotations.SerializedName; -import com.huanchengfly.tieba.post.models.BaseBean; - -import java.util.List; - -public class UserLikeForumBean extends BaseBean { - @SerializedName("error_code") - private String errorCode; - @SerializedName("error_msg") - private String errorMsg; - @SerializedName("has_more") - private String hasMore; - @SerializedName("forum_list") - private ForumListBean forumList; - @SerializedName("common_forum_list") - private ForumListBean commonForumList; - - public String getErrorCode() { - return errorCode; - } - - public String getErrorMsg() { - return errorMsg; - } - - public String getHasMore() { - return hasMore; - } - - public ForumListBean getForumList() { - return forumList; - } - - public ForumListBean getCommonForumList() { - return commonForumList; - } - - public static class ForumListBean { - @SerializedName("non-gconforum") - private List forumList; - - public List getForumList() { - return forumList; - } - } - - public static class ForumBean { - private String id; - private String name; - @SerializedName("level_id") - private String levelId; - @SerializedName("favo_type") - private String favoType; - @SerializedName("level_name") - private String levelName; - @SerializedName("cur_score") - private String curScore; - @SerializedName("levelup_score") - private String levelUpScore; - private String avatar; - private String slogan; - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public String getLevelId() { - return levelId; - } - - public String getFavoType() { - return favoType; - } - - public String getLevelName() { - return levelName; - } - - public String getCurScore() { - return curScore; - } - - public String getLevelUpScore() { - return levelUpScore; - } - - public String getAvatar() { - return avatar; - } - - public String getSlogan() { - return slogan; - } - } - -} diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.kt new file mode 100644 index 00000000..b5491c99 --- /dev/null +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/models/UserLikeForumBean.kt @@ -0,0 +1,75 @@ +package com.huanchengfly.tieba.post.api.models + +import com.google.gson.annotations.SerializedName +import com.huanchengfly.tieba.post.models.BaseBean +import kotlinx.collections.immutable.persistentListOf +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class UserLikeForumBean( + @SerialName("error_code") + @SerializedName("error_code") + val errorCode: String = "-1", + + @SerialName("error_msg") + @SerializedName("error_msg") + val errorMsg: String = "unknown error", + + @JvmField + @SerialName("has_more") + @SerializedName("has_more") + val hasMore: String = "0", + + @JvmField + @SerialName("forum_list") + @SerializedName("forum_list") + val forumList: ForumListBean = ForumListBean(), + + @SerialName("common_forum_list") + @SerializedName("common_forum_list") + val commonForumList: ForumListBean = ForumListBean(), +) : BaseBean() { + + @Serializable + data class ForumListBean( + @JvmField + @SerialName("non-gconforum") + @SerializedName("non-gconforum") + val forumList: List = persistentListOf(), + ) + + @Serializable + data class ForumBean( + val id: String? = null, + + @JvmField + val name: String? = null, + + @SerialName("level_id") + @SerializedName("level_id") + val levelId: String? = null, + + @SerialName("favo_type") + @SerializedName("favo_type") + val favoType: String? = null, + + @SerialName("level_name") + @SerializedName("level_name") + val levelName: String? = null, + + @SerialName("cur_score") + @SerializedName("cur_score") + val curScore: String? = null, + + @SerialName("levelup_score") + @SerializedName("levelup_score") + val levelUpScore: String? = null, + + @JvmField + val avatar: String? = null, + + @JvmField + val slogan: String? = null, + ) +} diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt index 5a980d47..94966397 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt @@ -11,6 +11,7 @@ import com.huanchengfly.tieba.post.api.models.OAID import com.huanchengfly.tieba.post.api.retrofit.adapter.DeferredCallAdapterFactory import com.huanchengfly.tieba.post.api.retrofit.adapter.FlowCallAdapterFactory import com.huanchengfly.tieba.post.api.retrofit.converter.gson.GsonConverterFactory +import com.huanchengfly.tieba.post.api.retrofit.converter.kotlinx.serialization.asConverterFactory import com.huanchengfly.tieba.post.api.retrofit.interceptors.AddWebCookieInterceptor import com.huanchengfly.tieba.post.api.retrofit.interceptors.CommonHeaderInterceptor import com.huanchengfly.tieba.post.api.retrofit.interceptors.CommonParamInterceptor @@ -37,6 +38,7 @@ import com.huanchengfly.tieba.post.utils.CuidUtils import com.huanchengfly.tieba.post.utils.DeviceUtils import com.huanchengfly.tieba.post.utils.MobileInfoUtil import com.huanchengfly.tieba.post.utils.UIDUtil +import kotlinx.serialization.json.Json import okhttp3.ConnectionPool import okhttp3.Interceptor import okhttp3.OkHttpClient @@ -332,12 +334,18 @@ object RetrofitTiebaApi { ) } + private val json = Json { + ignoreUnknownKeys = true + coerceInputValues = true + } + val SOFIRE_API: SofireApi by lazy { Retrofit.Builder() .baseUrl("https://sofire.baidu.com/") .addCallAdapterFactory(DeferredCallAdapterFactory()) .addCallAdapterFactory(FlowCallAdapterFactory.create()) .addConverterFactory(NullOnEmptyConverterFactory()) + .addConverterFactory(json.asConverterFactory()) .addConverterFactory(gsonConverterFactory) .client(OkHttpClient.Builder().apply { // addInterceptor() @@ -355,6 +363,7 @@ object RetrofitTiebaApi { .addCallAdapterFactory(DeferredCallAdapterFactory()) .addCallAdapterFactory(FlowCallAdapterFactory.create()) .addConverterFactory(NullOnEmptyConverterFactory()) + .addConverterFactory(json.asConverterFactory()) .addConverterFactory(gsonConverterFactory) .client(OkHttpClient.Builder().apply { readTimeout(READ_TIMEOUT, TimeUnit.SECONDS) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Factory.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Factory.kt new file mode 100644 index 00000000..b2b51e80 --- /dev/null +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Factory.kt @@ -0,0 +1,37 @@ +@file:OptIn(ExperimentalSerializationApi::class) + +package com.huanchengfly.tieba.post.api.retrofit.converter.kotlinx.serialization + +import android.util.Log +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.StringFormat +import okhttp3.ResponseBody +import retrofit2.Converter +import retrofit2.Retrofit +import java.lang.reflect.Type + +internal class Factory( + private val serializer: Serializer, +) : Converter.Factory() { + @Suppress("RedundantNullableReturnType") // Retaining interface contract. + override fun responseBodyConverter( + type: Type, + annotations: Array, + retrofit: Retrofit, + ): Converter? { + val delegate: Converter = + retrofit.nextResponseBodyConverter(this, type, annotations) + val loader = runCatching { serializer.serializer(type) }.getOrNull() + return Converter { body: ResponseBody -> + loader?.let { serializer.fromResponseBody(it, body) } ?: run { + Log.d("Serializer", "Failed to deserialize, falling back to delegate.") + delegate.convert(body) + } + } + } +} + +@JvmName("create") +fun StringFormat.asConverterFactory(): Converter.Factory { + return Factory(Serializer.FromString(this)) +} \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Serializer.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Serializer.kt new file mode 100644 index 00000000..26247351 --- /dev/null +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/converter/kotlinx/serialization/Serializer.kt @@ -0,0 +1,27 @@ +package com.huanchengfly.tieba.post.api.retrofit.converter.kotlinx.serialization + +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.KSerializer +import kotlinx.serialization.SerialFormat +import kotlinx.serialization.StringFormat +import kotlinx.serialization.serializer +import okhttp3.ResponseBody +import java.lang.reflect.Type + +internal sealed class Serializer { + abstract fun fromResponseBody(loader: DeserializationStrategy, body: ResponseBody): T + + protected abstract val format: SerialFormat + + fun serializer(type: Type): KSerializer = format.serializersModule.serializer(type) + + class FromString(override val format: StringFormat) : Serializer() { + override fun fromResponseBody( + loader: DeserializationStrategy, + body: ResponseBody, + ): T { + val string = body.string() + return format.decodeFromString(loader, string) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialProtobufTiebaApi.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialProtobufTiebaApi.kt index 44ba80c8..d2761179 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialProtobufTiebaApi.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialProtobufTiebaApi.kt @@ -17,6 +17,7 @@ import com.huanchengfly.tieba.post.api.models.protos.searchSug.SearchSugResponse import com.huanchengfly.tieba.post.api.models.protos.threadList.ThreadListResponse import com.huanchengfly.tieba.post.api.models.protos.topicList.TopicListResponse import com.huanchengfly.tieba.post.api.models.protos.userLike.UserLikeResponse +import com.huanchengfly.tieba.post.api.models.protos.userPost.UserPostResponse import com.huanchengfly.tieba.post.api.retrofit.body.MyMultipartBody import kotlinx.coroutines.flow.Flow import retrofit2.http.Body @@ -109,4 +110,9 @@ interface OfficialProtobufTiebaApi { fun forumRuleDetailFlow( @Body body: MyMultipartBody, ): Flow + + @POST("/c/u/feed/userpost?cmd=303002&format=protobuf") + fun userPostFlow( + @Body body: MyMultipartBody, + ): Flow } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt index d501f53f..22f217a0 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/interfaces/OfficialTiebaApi.kt @@ -523,4 +523,15 @@ interface OfficialTiebaApi { @Field("delete_my_post") deleteMyPost: Int, @Field("tbs") tbs: String? = AccountUtil.getLoginInfo()?.tbs, ): Flow + + @Headers("${Header.FORCE_LOGIN}: ${Header.FORCE_LOGIN_TRUE}") + @POST("/c/f/forum/like") + @FormUrlEncoded + fun userLikeForumFlow( + @Field("page_no") page: Int = 1, + @Field("page_size") pageSize: Int = 50, + @Field("uid") uid: String?, + @Field("friend_uid") friendUid: String?, + @Field("is_guest") is_guest: String?, + ): Flow } \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/post/fragments/UserLikeForumFragment.java b/app/src/main/java/com/huanchengfly/tieba/post/fragments/UserLikeForumFragment.java index 4df4ad5d..afc7d23a 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/fragments/UserLikeForumFragment.java +++ b/app/src/main/java/com/huanchengfly/tieba/post/fragments/UserLikeForumFragment.java @@ -80,7 +80,7 @@ public class UserLikeForumFragment extends BaseFragment { R.id.forum_item_card, (OnItemChildClickListener) (viewHolder, forumBean, position) -> - ForumActivity.launch(getAttachContext(), forumBean.getName()) + ForumActivity.launch(getAttachContext(), forumBean.name) ); recyclerView.setAdapter(userLikeForumAdapter); } @@ -95,9 +95,9 @@ public class UserLikeForumFragment extends BaseFragment { public void onResponse(@NotNull Call call, @NotNull Response response) { UserLikeForumBean data = response.body(); userLikeForumBean = data; - if (data.getForumList() != null) { - userLikeForumAdapter.setData(data.getForumList().getForumList()); - if ("0".equals(data.getHasMore())) { + if (data.forumList != null) { + userLikeForumAdapter.setData(data.forumList.forumList); + if ("0".equals(data.hasMore)) { //emptyTipView.setText(R.string.tip_empty); refreshLayout.finishRefreshWithNoMoreData(); } else { @@ -111,6 +111,7 @@ public class UserLikeForumFragment extends BaseFragment { @Override public void onFailure(@NotNull Call call, @NotNull Throwable t) { + t.printStackTrace(); Toast.makeText(getAttachContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); refreshLayout.finishRefresh(false); } @@ -126,9 +127,9 @@ public class UserLikeForumFragment extends BaseFragment { page += 1; UserLikeForumBean data = response.body(); userLikeForumBean = data; - if (data.getForumList() != null) { - userLikeForumAdapter.insert(data.getForumList().getForumList()); - if ("0".equals(data.getHasMore())) { + if (data.forumList != null) { + userLikeForumAdapter.insert(data.forumList.forumList); + if ("0".equals(data.hasMore)) { //emptyTipView.setText(R.string.tip_empty); refreshLayout.finishLoadMoreWithNoMoreData(); } else { diff --git a/app/src/main/protos/PostInfoList.proto b/app/src/main/protos/PostInfoList.proto index 018ad57d..18372797 100644 --- a/app/src/main/protos/PostInfoList.proto +++ b/app/src/main/protos/PostInfoList.proto @@ -4,6 +4,19 @@ import "PostInfoContent.proto"; import "PbContent.proto"; import "Abstract.proto"; import "Media.proto"; +import "PollInfo.proto"; +import "VideoInfo.proto"; +import "Agree.proto"; +import "OriginThreadInfo.proto"; +import "AlaLiveInfo.proto"; +import "ZhiBoInfoTW.proto"; +import "Quote.proto"; +import "Voice.proto"; +import "DealInfo.proto"; +import "BaijiahaoInfo.proto"; +import "Item.proto"; +import "PbLinkInfo.proto"; +import "HeadItem.proto"; package tieba; @@ -31,48 +44,48 @@ message PostInfoList { string user_portrait = 19; string post_type = 20; // LbsInfo lbs_info = 21; - // Quote quote = 22; - // repeated Voice voice_info = 23; + Quote quote = 22; + repeated Voice voice_info = 23; // AnchorInfo anchor_info = 24; - // int32 hide_post = 25; - // uint64 thread_type = 26; - // ZhiBoInfoTW twzhibo_info = 27; - // PollInfo poll_info = 28; - // VideoInfo video_info = 29; - // bool is_deal = 30; - // DealInfo deal_info = 31; + int32 hide_post = 25; + uint64 thread_type = 26; + ZhiBoInfoTW twzhibo_info = 27; + PollInfo poll_info = 28; + VideoInfo video_info = 29; + bool is_deal = 30; + DealInfo deal_info = 31; // repeated MultipleForum multiple_forum_list = 32; - // int32 freq_num = 33; - // uint64 v_forum_id = 34; - // string name_show = 35; - // AlaLiveInfo ala_info = 36; - // int32 agree_num = 37; - // int32 view_num = 38; - // int32 share_num = 39; - // Agree agree = 40; - // int32 is_remain = 41; - // OriginThreadInfo origin_thread_info = 42; - // int32 is_view_year = 43; - // int32 is_share_thread = 44; + int32 freq_num = 33; + uint64 v_forum_id = 34; + string name_show = 35; + AlaLiveInfo ala_info = 36; + int32 agree_num = 37; + int32 view_num = 38; + int32 share_num = 39; + Agree agree = 40; + int32 is_remain = 41; + OriginThreadInfo origin_thread_info = 42; + int32 is_view_year = 43; + int32 is_share_thread = 44; repeated PbContent rich_title = 45; repeated PbContent rich_abstract = 46; int32 is_ntitle = 47; - // string article_cover = 48; + string article_cover = 48; repeated PbContent first_post_content = 49; - // BaijiahaoInfo baijiahao_info = 50; - // string wonderful_post_info = 51; - // Item item = 52; - // repeated HeadItem item_star = 53; - // repeated PbLinkInfo pb_link_info = 54; + BaijiahaoInfo baijiahao_info = 50; + string wonderful_post_info = 51; + Item item = 52; + repeated HeadItem item_star = 53; + repeated PbLinkInfo pb_link_info = 54; // repeated PbGoodsInfo pb_goods_info = 55; repeated PrivSets priv_sets = 56; - // int32 is_author_view = 57; + int32 is_author_view = 57; // WorksInfo works_info = 58; int32 is_manager = 59; int32 is_origin_manager = 60; - // int32 good_types = 61; - // int32 top_types = 62; + int32 good_types = 61; + int32 top_types = 62; // UserPostPerm user_post_perm = 63; // VoiceRoom voice_room = 64; - // string target_scheme = 66; + string target_scheme = 66; } \ No newline at end of file diff --git a/app/src/main/protos/Quote.proto b/app/src/main/protos/Quote.proto new file mode 100644 index 00000000..c2aee8bf --- /dev/null +++ b/app/src/main/protos/Quote.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package tieba; + +option java_package = "com.huanchengfly.tieba.post.api.models.protos"; + +message Quote { + int64 post_id = 1; + string user_name = 2; + int64 user_id = 3; + string ip = 4; + string content = 5; +} diff --git a/app/src/main/protos/UserPost/UserPostRequest.proto b/app/src/main/protos/UserPost/UserPostRequest.proto new file mode 100644 index 00000000..3472eb56 --- /dev/null +++ b/app/src/main/protos/UserPost/UserPostRequest.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package tieba.userPost; + +option java_package = "com.huanchengfly.tieba.post.api.models.protos.userPost"; + +import "UserPost/UserPostRequestData.proto"; + +message UserPostRequest { + UserPostRequestData data = 1; +} diff --git a/app/src/main/protos/UserPost/UserPostRequestData.proto b/app/src/main/protos/UserPost/UserPostRequestData.proto new file mode 100644 index 00000000..2a082bb0 --- /dev/null +++ b/app/src/main/protos/UserPost/UserPostRequestData.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package tieba.userPost; + +option java_package = "com.huanchengfly.tieba.post.api.models.protos.userPost"; + +import "CommonRequest.proto"; + +message UserPostRequestData { + int64 uid = 1; + uint32 rn = 2; + uint32 offset = 3; + optional uint32 is_thread = 4; + uint32 need_content = 5; + uint64 forum_id = 6; + uint32 begin_time = 7; + uint32 end_time = 8; + uint32 subtype = 9; + uint32 check_login = 10; + string ip_str = 11; + uint32 ip_int = 12; + string module_name = 13; + uint32 st_type = 14; + uint32 st_param = 15; + uint32 smile_grade = 16; + uint32 support_noun = 17; + uint32 login = 18; + int64 user_id = 19; + string user_name = 20; + uint32 no_un = 21; + string portrait = 22; + string mobile = 23; + string email = 24; + string cookie = 25; + uint32 pn = 26; + CommonRequest common = 27; + uint32 is_twzhibo = 28; + int32 scr_w = 29; + int32 scr_h = 30; + double scr_dip = 31; + int32 q_type = 32; + int32 is_view_card = 33; + uint32 last_thread_time = 34; + uint32 work_tab_id = 35; + uint32 type = 36; + uint32 from_type = 37; + uint64 begin_thread_id = 38; +} diff --git a/app/src/main/protos/UserPost/UserPostResponse.proto b/app/src/main/protos/UserPost/UserPostResponse.proto new file mode 100644 index 00000000..fb083258 --- /dev/null +++ b/app/src/main/protos/UserPost/UserPostResponse.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package tieba.userPost; + +option java_package = "com.huanchengfly.tieba.post.api.models.protos.userPost"; + +import "Error.proto"; +import "UserPost/UserPostResponseData.proto"; + +message UserPostResponse { + Error error = 1; + UserPostResponseData data = 2; +} diff --git a/app/src/main/protos/UserPost/UserPostResponseData.proto b/app/src/main/protos/UserPost/UserPostResponseData.proto new file mode 100644 index 00000000..634d0fa6 --- /dev/null +++ b/app/src/main/protos/UserPost/UserPostResponseData.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package tieba.userPost; + +option java_package = "com.huanchengfly.tieba.post.api.models.protos.userPost"; + +import "PostInfoList.proto"; + +message UserPostResponseData { + repeated PostInfoList post_list = 1; + uint32 hide_post = 2; + uint64 time = 3; + uint64 ctime = 4; + uint64 logid = 5; + int32 mask_type = 6; + int32 view_card_num = 7; + int32 reddot_deleted_thread = 8; +}