attention static method

dynamic attention(
  1. dynamic id,
  2. bool atten,
  3. dynamic callBack
)

@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
    });
  }
}