feat: create/update/del follow tag

opt: owner follow page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-23 11:12:17 +08:00
parent e212144250
commit 0d27d88719
9 changed files with 405 additions and 87 deletions

View File

@@ -470,8 +470,8 @@ class MemberHttp {
if (res.data['code'] == 0) {
return {
'status': true,
'data': (res.data['data'] as List?)
?.map<MemberTagItemModel>((e) => MemberTagItemModel.fromJson(e))
'data': res.data['data']
.map<MemberTagItemModel>((e) => MemberTagItemModel.fromJson(e))
.toList()
};
} else {
@@ -525,7 +525,7 @@ class MemberHttp {
}
// 获取某分组下的up
static Future<LoadingState<List<FollowItemModel>?>> followUpGroup(
static Future<LoadingState<FollowDataModel>> followUpGroup(
int? mid,
int? tagid,
int? pn,
@@ -541,14 +541,82 @@ class MemberHttp {
},
);
if (res.data['code'] == 0) {
return LoadingState.success((res.data['data'] as List?)
?.map<FollowItemModel>((e) => FollowItemModel.fromJson(e))
.toList());
return LoadingState.success(FollowDataModel(
list: (res.data['data'] as List?)
?.map<FollowItemModel>((e) => FollowItemModel.fromJson(e))
.toList()));
} else {
return LoadingState.error(res.data['message']);
}
}
static Future createFollowTag(tagName) async {
var res = await Request().post(
Api.createFollowTag,
queryParameters: {
'x-bili-device-req-json':
'{"platform":"web","device":"pc","spmid":"333.1387"}',
},
data: {
'tag': tagName,
'csrf': Accounts.main.csrf,
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
if (res.data['code'] == 0) {
return {'status': true};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
static Future updateFollowTag(tagid, name) async {
var res = await Request().post(
Api.updateFollowTag,
queryParameters: {
'x-bili-device-req-json':
'{"platform":"web","device":"pc","spmid":"333.1387"}',
},
data: {
'tagid': tagid,
'name': name,
'csrf': Accounts.main.csrf,
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
if (res.data['code'] == 0) {
return {'status': true};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
static Future delFollowTag(tagid) async {
var res = await Request().post(
Api.delFollowTag,
queryParameters: {
'x-bili-device-req-json':
'{"platform":"web","device":"pc","spmid":"333.1387"}',
},
data: {
'tagid': tagid,
'csrf': Accounts.main.csrf,
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
if (res.data['code'] == 0) {
return {'status': true};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
// 获取up置顶
static Future getTopVideo(String? vmid) async {
var res = await Request().get(Api.getTopVideoApi);