[Modify]标签功能开发

This commit is contained in:
wushaocheng
2023-02-16 21:07:06 +08:00
parent 77bd3cc4fe
commit a7487ea785
78 changed files with 748 additions and 114 deletions

View File

@@ -14,6 +14,7 @@ import com.yizhuan.xchat_android_core.user.bean.ProtocolInfo;
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo;
import com.yizhuan.xchat_android_core.user.bean.UserGameInfo;
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
import com.yizhuan.xchat_android_core.user.bean.UserLabelInfo;
import com.yizhuan.xchat_android_core.user.bean.UserRandomConfig;
import java.util.List;
@@ -231,4 +232,9 @@ public interface IUserModel extends IModel {
Single<String> addReport(Long objId, int type);
/**
* 获取编辑标签
*/
Single<UserLabelInfo> getUserLabelInfo();
}

View File

@@ -30,6 +30,7 @@ import com.yizhuan.xchat_android_core.user.bean.ProtocolInfo;
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo;
import com.yizhuan.xchat_android_core.user.bean.UserGameInfo;
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
import com.yizhuan.xchat_android_core.user.bean.UserLabelInfo;
import com.yizhuan.xchat_android_core.user.bean.UserRandomConfig;
import com.yizhuan.xchat_android_core.user.event.CurrentUserInfoCompleteEvent;
import com.yizhuan.xchat_android_core.user.event.CurrentUserInfoCompleteFailEvent;
@@ -820,6 +821,13 @@ public final class UserModel extends BaseModel implements IUserModel {
.compose(RxHelper.handleSchedulers());
}
@Override
public Single<UserLabelInfo> getUserLabelInfo() {
return api.getUserLabelInfo()
.compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers());
}
private interface Api {
/**
* 获取某个用户的用户信息
@@ -1070,5 +1078,13 @@ public final class UserModel extends BaseModel implements IUserModel {
@POST("/user/black/add")
Single<ServiceResult<String>> addReport(@Query("objId") Long objId, @Query("type") int type);
/**
* 编辑标签
*
* @return -
*/
@GET("/label/edit")
Single<ServiceResult<UserLabelInfo>> getUserLabelInfo();
}
}

View File

@@ -0,0 +1,12 @@
package com.yizhuan.xchat_android_core.user.bean
import lombok.Data
import java.io.Serializable
@Data
data class UserLabelInfo(
val config: List<UserLabelItemInfo>,
val meLabels: List<String>
) : Serializable

View File

@@ -0,0 +1,12 @@
package com.yizhuan.xchat_android_core.user.bean
import lombok.Data
import java.io.Serializable
@Data
data class UserLabelItemInfo(
val label: String = "",
val picked: Boolean = false
) : Serializable