Merge branch 'main' into fix

This commit is contained in:
guozhigq
2024-10-31 23:24:47 +08:00
16 changed files with 427 additions and 19 deletions

View File

@ -606,4 +606,7 @@ class Api {
/// 番剧点赞投币收藏状态
static const String bangumiActionStatus = '/pgc/season/episode/community';
/// @我的
static const String messageAtAPi = '/x/msgfeed/at?';
}

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:pilipala/models/msg/at.dart';
import 'package:pilipala/models/msg/like.dart';
import 'package:pilipala/models/msg/reply.dart';
import 'package:pilipala/models/msg/system.dart';
@ -350,4 +351,24 @@ class MsgHttp {
return {'status': false, 'date': [], 'msg': res.data['message']};
}
}
// @我的
static Future messageAt() async {
var res = await Request().get(Api.messageAtAPi, data: {
'build': 0,
'mobi_app': 'web',
});
if (res.data['code'] == 0) {
try {
return {
'status': true,
'data': MessageAtModel.fromJson(res.data['data']),
};
} catch (err) {
return {'status': false, 'data': [], 'msg': err.toString()};
}
} else {
return {'status': false, 'data': [], 'msg': res.data['message']};
}
}
}

View File

@ -136,13 +136,13 @@ class ReplyHttp {
}
// 图片上传
static Future uploadImage({required XFile xFile, String type = 'im'}) async {
static Future uploadImage(
{required XFile xFile, String type = 'new_dyn'}) async {
var formData = FormData.fromMap({
'file_up': await xFileToMultipartFile(xFile),
'biz': type,
'csrf': await Request.getCsrf(),
'build': 0,
'mobi_app': 'web',
'category': 'daily',
});
var res = await Request().post(
Api.uploadImage,