mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 19:46:47 +08:00
feat: at user
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -915,4 +915,6 @@ class Api {
|
||||
static const String spaceComic = '${HttpString.appBaseUrl}/x/v2/space/comic';
|
||||
|
||||
static const String spaceAudio = '/audio/music-service/web/song/upper';
|
||||
|
||||
static const String dynMention = '/x/polymer/web-dynamic/v1/mention/search';
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import 'package:PiliPlus/models/dynamics/vote_model.dart';
|
||||
import 'package:PiliPlus/models_new/article/article_info/data.dart';
|
||||
import 'package:PiliPlus/models_new/article/article_list/data.dart';
|
||||
import 'package:PiliPlus/models_new/article/article_view/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/group.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_reserve/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/topic_card_list.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/top_details.dart';
|
||||
@@ -141,11 +143,12 @@ class DynamicsHttp {
|
||||
"dyn_req": {
|
||||
"content": {
|
||||
"contents": [
|
||||
{
|
||||
"raw_text": rawText,
|
||||
"type": 1,
|
||||
"biz_id": "",
|
||||
},
|
||||
if (rawText != null)
|
||||
{
|
||||
"raw_text": rawText,
|
||||
"type": 1,
|
||||
"biz_id": "",
|
||||
},
|
||||
...?extraContent,
|
||||
],
|
||||
if (title?.isNotEmpty == true) 'title': title,
|
||||
@@ -488,4 +491,22 @@ class DynamicsHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<List<MentionGroup>?>> dynMention(
|
||||
{String? keyword}) async {
|
||||
final res = await Request().get(
|
||||
Api.dynMention,
|
||||
queryParameters: {
|
||||
if (keyword?.isNotEmpty == true) 'keyword': keyword,
|
||||
'web_location': 333.1365,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(
|
||||
DynMentionData.fromJson(res.data['data']).groups,
|
||||
);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,6 +510,7 @@ class VideoHttp {
|
||||
int? parent,
|
||||
List? pictures,
|
||||
bool? syncToDynamic,
|
||||
Map? atNameToMid,
|
||||
}) async {
|
||||
if (message == '') {
|
||||
return {'status': false, 'msg': '请输入评论内容'};
|
||||
@@ -520,13 +521,16 @@ class VideoHttp {
|
||||
if (root != null && root != 0) 'root': root,
|
||||
if (parent != null && parent != 0) 'parent': parent,
|
||||
'message': message,
|
||||
if (atNameToMid != null)
|
||||
'at_name_to_mid': jsonEncode(atNameToMid), // {"name":uid}
|
||||
if (pictures != null) 'pictures': jsonEncode(pictures),
|
||||
if (syncToDynamic == true) 'sync_to_dynamic': 1,
|
||||
'csrf': Accounts.main.csrf,
|
||||
};
|
||||
var res = await Request().post(
|
||||
Api.replyAdd,
|
||||
data: FormData.fromMap(data),
|
||||
data: data,
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
log(res.toString());
|
||||
if (res.data['code'] == 0) {
|
||||
|
||||
Reference in New Issue
Block a user