attention static method
@Author: yuer @description: id:用户ID, atten:是否取消关注 @return {*}
Implementation
static attention(id, bool atten, callBack) {
if (atten) {
//取消关注
DioManager().request<dynamic>(RequestType.POST, RequestApi.apiAttentionDel, params: {"followedUserIds": id}, onSuccess: (data) {
callBack(data);
// onSuccess
}, onError: (error) {
// when called , already show toast, then do another things
}, onStart: () {
// onStart
}, onFinish: () {
// onFinish
});
} else {
//关注
DioManager().request<dynamic>(RequestType.POST, RequestApi.apiAttentionAdd, params: {"followedUserIds": id}, onSuccess: (data) {
// onSuccess
callBack(data);
}, onError: (error) {
// when called , already show toast, then do another things
}, onStart: () {
// onStart
}, onFinish: () {
// onFinish
});
}
}