feat: 动态点赞/取消赞
This commit is contained in:
@ -50,4 +50,31 @@ class DynamicsHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 动态点赞
|
||||
static Future likeDynamic({
|
||||
required String? dynamicId,
|
||||
required int? up,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.likeDynamic,
|
||||
queryParameters: {
|
||||
'dynamic_id': dynamicId,
|
||||
'up': up,
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data'],
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user