uploadEmoticonCustomize method
上传自定义表情
POST /api/v1/emoticon/customize/upload,字段:file(png/jpg/jpeg/gif,≤5MB)。
Implementation
Future<EmoticonUploadResult> uploadEmoticonCustomize({
required Uint8List bytes,
required String filename,
CancelToken? cancelToken,
void Function(int sent, int total)? onSendProgress,
}) async {
if (bytes.length > maxEmoticonBytes) {
throw GoChatException('表情文件不能超过 5MB');
}
final form = FormData.fromMap({
'file': MultipartFile.fromBytes(bytes, filename: filename),
});
final resp = await _net.http.postFormData(
'/api/v1/emoticon/customize/upload',
data: form,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
);
return EmoticonUploadResult.fromJson(resp);
}