logo和名称替换
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import 'package:hgmj/hj_model/list_base_model.dart';
|
||||
import 'package:hgmj/hj_model/mine/exchange_record_model.dart';
|
||||
import 'package:hgmj/hj_model/user/user_income_info_model.dart';
|
||||
import 'package:hgmj/hj_model/user/user_info_model.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:hgmj/tools_base/event_bus/events.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/net/http_manager.dart';
|
||||
import 'package:wydj/hj_model/list_base_model.dart';
|
||||
import 'package:wydj/hj_model/mine/exchange_record_model.dart';
|
||||
import 'package:wydj/hj_model/user/user_income_info_model.dart';
|
||||
import 'package:wydj/hj_model/user/user_info_model.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_page/main_page/provider/msg_provider.dart';
|
||||
import 'package:wydj/tools_base/event_bus/event_bus_util.dart';
|
||||
import 'package:wydj/tools_base/event_bus/events.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/net/http_manager.dart';
|
||||
|
||||
import '../../hj_model/cartoon_media_info.dart';
|
||||
import '../../hj_model/message/message_dynamic_list.dart';
|
||||
@@ -79,7 +79,9 @@ class MineService {
|
||||
}
|
||||
|
||||
static Future<bool> reduceDownloadCount() async {
|
||||
return (await httpManager.fetchResponseByPOST('/mine/download/use', param: <String, dynamic>{})).isSuccess;
|
||||
return (await httpManager.fetchResponseByPOST('/mine/download/use',
|
||||
param: <String, dynamic>{}))
|
||||
.isSuccess;
|
||||
}
|
||||
|
||||
/// 获取用户信息
|
||||
@@ -96,7 +98,8 @@ class MineService {
|
||||
}
|
||||
|
||||
/// 提现明细
|
||||
static Future<WithdrawDetailsModel?> getWithdrawDetails({int pageNumber = 1, int pageSize = 10}) async {
|
||||
static Future<WithdrawDetailsModel?> getWithdrawDetails(
|
||||
{int pageNumber = 1, int pageSize = 10}) async {
|
||||
final result = await httpManager.fetchResponseByGET(
|
||||
'/withdraw/order',
|
||||
param: {
|
||||
@@ -159,7 +162,13 @@ class MineService {
|
||||
}
|
||||
|
||||
static Future<UserInfoModel?> mobileLogin(
|
||||
String? mobile, String? code, String? devID, String? devType, String? sysType, String? ver, String? buildID,
|
||||
String? mobile,
|
||||
String? code,
|
||||
String? devID,
|
||||
String? devType,
|
||||
String? sysType,
|
||||
String? ver,
|
||||
String? buildID,
|
||||
[String? cutInfos = ""]) async {
|
||||
final param = {
|
||||
'mobile': mobile,
|
||||
@@ -172,34 +181,45 @@ class MineService {
|
||||
'cutInfos': cutInfos
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST('/mine/mobileLoginOnly',
|
||||
param: param, jsonTransformation: (json) => UserInfoModel.fromJson(json['userInfo']));
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/mine/mobileLoginOnly',
|
||||
param: param,
|
||||
jsonTransformation: (json) => UserInfoModel.fromJson(json['userInfo']));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
/// 积分兑换商品
|
||||
static Future<bool> integralExchange(String id, {String? name, String? tel, String? address}) async {
|
||||
final param = <String, dynamic>{"id": id, "name": name, "tel": tel, "address": address};
|
||||
static Future<bool> integralExchange(String id,
|
||||
{String? name, String? tel, String? address}) async {
|
||||
final param = <String, dynamic>{
|
||||
"id": id,
|
||||
"name": name,
|
||||
"tel": tel,
|
||||
"address": address
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST('/integral/exchangeIntegral', param: param);
|
||||
final result = await httpManager
|
||||
.fetchResponseByPOST('/integral/exchangeIntegral', param: param);
|
||||
return result.isSuccess;
|
||||
}
|
||||
|
||||
//收藏类型 SP:长视频 SHORT:短视频 COVER:图文帖子 PIC:图集帖子 SEED_LINK:种子/黄油帖子
|
||||
static Future<bool> postCollect(String? objID, String? type, bool? isCollect) async {
|
||||
static Future<bool> postCollect(
|
||||
String? objID, String? type, bool? isCollect) async {
|
||||
final param = {'objID': objID, 'type': type, 'isCollect': isCollect};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/mine/collect',
|
||||
param: param,
|
||||
);
|
||||
eventBus.emit(CollectStatusModel(id: objID, isCollected: isCollect, type: type));
|
||||
eventBus.emit(
|
||||
CollectStatusModel(id: objID, isCollected: isCollect, type: type));
|
||||
return result.isSuccess;
|
||||
}
|
||||
|
||||
static Future<WalletModel?> fetchWalletData() async {
|
||||
final result =
|
||||
await httpManager.fetchResponseByGET('/mine/wallet', param: {}, jsonTransformation: (json) => WalletModel.fromJson(json));
|
||||
final result = await httpManager.fetchResponseByGET('/mine/wallet',
|
||||
param: {}, jsonTransformation: (json) => WalletModel.fromJson(json));
|
||||
if (result.data is WalletModel) {
|
||||
globalStore.wallet = result.data;
|
||||
}
|
||||
@@ -218,7 +238,8 @@ class MineService {
|
||||
}
|
||||
|
||||
//推广记录
|
||||
static Future<ListBaseModel<Promotion>?> getBindRecord(int? pageSize, int? pageNumber) async {
|
||||
static Future<ListBaseModel<Promotion>?> getBindRecord(
|
||||
int? pageSize, int? pageNumber) async {
|
||||
final param = {'pageSize': pageSize, 'pageNumber': pageNumber};
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/userinvite/userlist',
|
||||
@@ -234,18 +255,22 @@ class MineService {
|
||||
// newsType: SEED_LINK 游戏, MOVIE 视频,抖音:SP,图文:COVER
|
||||
|
||||
static Future<UserIncomeModel?> fetchIncomeInfo() async {
|
||||
final result =
|
||||
await httpManager.fetchResponseByPOST('/userinvite/info', param: {}, jsonTransformation: (json) => UserIncomeModel.fromJson(json));
|
||||
final result = await httpManager.fetchResponseByPOST('/userinvite/info',
|
||||
param: {},
|
||||
jsonTransformation: (json) => UserIncomeModel.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
/// 获取用户分享列表
|
||||
|
||||
static Future<InviteIncomeModel?> fetchIncomeList({int page = 1, int size = 10}) async {
|
||||
static Future<InviteIncomeModel?> fetchIncomeList(
|
||||
{int page = 1, int size = 10}) async {
|
||||
final param = <String, dynamic>{'pageSize': page, 'pageNumber': size};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST('/userinvite/incomelist',
|
||||
param: param, jsonTransformation: (json) => InviteIncomeModel.fromJson(json));
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/userinvite/incomelist',
|
||||
param: param,
|
||||
jsonTransformation: (json) => InviteIncomeModel.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -294,7 +319,8 @@ class MineService {
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByGET('/mine/buyVid',
|
||||
param: param, jsonTransformation: (json) => ListBaseModel<VideoModel>.fromJson(json));
|
||||
param: param,
|
||||
jsonTransformation: (json) => ListBaseModel<VideoModel>.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -312,8 +338,10 @@ class MineService {
|
||||
'month': DateTime.now().month
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result =
|
||||
await httpManager.fetchResponseByGET('/mine/zhangdan', param: param, jsonTransformation: (json) => ListBaseModel<BillItemModel>.fromJson(json));
|
||||
final result = await httpManager.fetchResponseByGET('/mine/zhangdan',
|
||||
param: param,
|
||||
jsonTransformation: (json) =>
|
||||
ListBaseModel<BillItemModel>.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -327,7 +355,8 @@ class MineService {
|
||||
'pageSize': pageSize,
|
||||
};
|
||||
final result = await httpManager.fetchResponseByPOST('/mine/transaction',
|
||||
param: param, jsonTransformation: (json) => WithdrawDetailsModel.fromJson(json));
|
||||
param: param,
|
||||
jsonTransformation: (json) => WithdrawDetailsModel.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -374,7 +403,8 @@ class MineService {
|
||||
static Future<RechargeListModel?> getChatRechargeTypes(int? type) async {
|
||||
final param = {'type': type};
|
||||
final result = await httpManager.fetchResponseByGET('/mine/currencys',
|
||||
param: param, jsonTransformation: (json) => RechargeListModel.fromJson(json));
|
||||
param: param,
|
||||
jsonTransformation: (json) => RechargeListModel.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -418,7 +448,8 @@ class MineService {
|
||||
'contentId': track?.contentId,
|
||||
'checkoutContextId': track?.checkoutContextId,
|
||||
'experimentId': (expId != null && expId.isNotEmpty) ? expId : null,
|
||||
'experimentVariant': (expVariant != null && expVariant.isNotEmpty) ? expVariant : null,
|
||||
'experimentVariant':
|
||||
(expVariant != null && expVariant.isNotEmpty) ? expVariant : null,
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
@@ -457,7 +488,8 @@ class MineService {
|
||||
}
|
||||
|
||||
//积分兑换记录
|
||||
static Future<List<CreditRecordModel>> getCreditRecords({int pageNumber = 1, int pageSize = 20}) async {
|
||||
static Future<List<CreditRecordModel>> getCreditRecords(
|
||||
{int pageNumber = 1, int pageSize = 20}) async {
|
||||
final param = {'pageNumber': pageNumber, 'pageSize': pageSize};
|
||||
final result = await httpManager.fetchResponseByGET(
|
||||
'/integral/record/list',
|
||||
@@ -466,7 +498,8 @@ class MineService {
|
||||
final List<CreditRecordModel> list = [];
|
||||
if (result.isSuccess) {
|
||||
List? values = result.data as List?;
|
||||
list.addAll(values?.map((e) => CreditRecordModel.fromJson(e)).toList() ?? []);
|
||||
list.addAll(
|
||||
values?.map((e) => CreditRecordModel.fromJson(e)).toList() ?? []);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -484,7 +517,8 @@ class MineService {
|
||||
}
|
||||
|
||||
/// VIP 卡片统计事件批量上报
|
||||
static Future<bool> reportAnalyticsEvents(List<VipCardAnalyticsEvent> events) async {
|
||||
static Future<bool> reportAnalyticsEvents(
|
||||
List<VipCardAnalyticsEvent> events) async {
|
||||
if (events.isEmpty) return true;
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/analytics/events',
|
||||
@@ -504,7 +538,8 @@ class MineService {
|
||||
final List<IntegralExchangeModel> list = [];
|
||||
if (result.isSuccess) {
|
||||
List? values = result.data as List?;
|
||||
list.addAll(values?.map((e) => IntegralExchangeModel.fromJson(e)).toList() ?? []);
|
||||
list.addAll(
|
||||
values?.map((e) => IntegralExchangeModel.fromJson(e)).toList() ?? []);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -521,7 +556,8 @@ class MineService {
|
||||
final List<OfficialListItemModel> list = [];
|
||||
if (result.isSuccess) {
|
||||
List? values = result.data as List?;
|
||||
list.addAll(values?.map((e) => OfficialListItemModel.fromJson(e)).toList() ?? []);
|
||||
list.addAll(
|
||||
values?.map((e) => OfficialListItemModel.fromJson(e)).toList() ?? []);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -571,7 +607,12 @@ class MineService {
|
||||
|
||||
//绑定手机
|
||||
static Future<bool> bindPhone(String phone, String code,
|
||||
{String? devID, String? smsId, String? sysType, String? ver, String? devType, String? applicationID}) async {
|
||||
{String? devID,
|
||||
String? smsId,
|
||||
String? sysType,
|
||||
String? ver,
|
||||
String? devType,
|
||||
String? applicationID}) async {
|
||||
final param = {
|
||||
'mobile': "+86$phone",
|
||||
'code': code,
|
||||
@@ -591,7 +632,8 @@ class MineService {
|
||||
}
|
||||
|
||||
//动态、收益列表
|
||||
static Future<ListBaseModel<MessageDynamicList>?> getDynamicList({int pageNumber = 1, int pageSize = 20, int? msgType}) async {
|
||||
static Future<ListBaseModel<MessageDynamicList>?> getDynamicList(
|
||||
{int pageNumber = 1, int pageSize = 20, int? msgType}) async {
|
||||
final param = {
|
||||
'pageNumber': pageNumber,
|
||||
'pageSize': pageSize,
|
||||
@@ -599,7 +641,9 @@ class MineService {
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByGET('/msg/dynamic/list',
|
||||
param: param, jsonTransformation: (json) => ListBaseModel<MessageDynamicList>.fromJson(json));
|
||||
param: param,
|
||||
jsonTransformation: (json) =>
|
||||
ListBaseModel<MessageDynamicList>.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -614,7 +658,8 @@ class MineService {
|
||||
}
|
||||
|
||||
/// 黑料社获取用户优惠券
|
||||
static Future<List<CouponModel>> fetchUserCoupons(int type, {int page = 1, int size = 0}) async {
|
||||
static Future<List<CouponModel>> fetchUserCoupons(int type,
|
||||
{int page = 1, int size = 0}) async {
|
||||
final param = <String, dynamic>{
|
||||
'type': type,
|
||||
'pageNumber': page,
|
||||
@@ -622,7 +667,12 @@ class MineService {
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByGET('/coupon/list',
|
||||
param: param, jsonTransformation: (json) => (json['list'] as List?)?.map((e) => CouponModel.fromJson(e)).toList() ?? []);
|
||||
param: param,
|
||||
jsonTransformation: (json) =>
|
||||
(json['list'] as List?)
|
||||
?.map((e) => CouponModel.fromJson(e))
|
||||
.toList() ??
|
||||
[]);
|
||||
//返回类型非空,给不了 null:失败时这里抛,由调用方 try/catch 兜底(改可空要连调用方一起改)
|
||||
return result.data;
|
||||
}
|
||||
@@ -639,7 +689,8 @@ class MineService {
|
||||
|
||||
static Future<ApBankListModel?> getBankCards() async {
|
||||
final result = await httpManager.fetchResponseByGET('/mine/txnact/yh/get',
|
||||
param: {}, jsonTransformation: (json) => ApBankListModel.fromJson(json));
|
||||
param: {},
|
||||
jsonTransformation: (json) => ApBankListModel.fromJson(json));
|
||||
return result.isSuccess ? result.data : null;
|
||||
}
|
||||
|
||||
@@ -649,7 +700,12 @@ class MineService {
|
||||
String? bankCode,
|
||||
String? cardType,
|
||||
) async {
|
||||
final param = <String, dynamic>{'act': act, 'actName': actName, 'bankCode': bankCode, 'cardType': cardType};
|
||||
final param = <String, dynamic>{
|
||||
'act': act,
|
||||
'actName': actName,
|
||||
'bankCode': bankCode,
|
||||
'cardType': cardType
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/mine/txnact/yh/add',
|
||||
@@ -659,7 +715,8 @@ class MineService {
|
||||
}
|
||||
|
||||
//获取兑换码记录
|
||||
static Future<ExchangeRecordList?> getExchangeRecord(int pageNumber, int pageSize) async {
|
||||
static Future<ExchangeRecordList?> getExchangeRecord(
|
||||
int pageNumber, int pageSize) async {
|
||||
final result = await httpManager.fetchResponseByGET(
|
||||
'/code/userRecord',
|
||||
param: {
|
||||
@@ -725,10 +782,17 @@ class MineService {
|
||||
String? newsType,
|
||||
int? uid,
|
||||
}) async {
|
||||
final param = <String, dynamic>{'pageNumber': page, 'pageSize': size, 'status': status, 'uid': uid, 'newsType': newsType};
|
||||
final param = <String, dynamic>{
|
||||
'pageNumber': page,
|
||||
'pageSize': size,
|
||||
'status': status,
|
||||
'uid': uid,
|
||||
'newsType': newsType
|
||||
};
|
||||
param.removeWhere((k, v) => v == null);
|
||||
final result = await httpManager.fetchResponseByGET('/mine/publish',
|
||||
param: param, jsonTransformation: (json) => ListBaseModel<VideoModel>.fromJson(json));
|
||||
param: param,
|
||||
jsonTransformation: (json) => ListBaseModel<VideoModel>.fromJson(json));
|
||||
//返回类型非空,给不了 null:失败时这里抛,由调用方 try/catch 兜底(改可空要连调用方一起改)
|
||||
return result.data;
|
||||
}
|
||||
@@ -737,7 +801,8 @@ class MineService {
|
||||
List<String>? ids,
|
||||
}) async {
|
||||
final param = <String, dynamic>{'ids': ids};
|
||||
final result = await httpManager.fetchResponseByPOST('/mine/publish/delete', param: param);
|
||||
final result = await httpManager.fetchResponseByPOST('/mine/publish/delete',
|
||||
param: param);
|
||||
if (result.isSuccess) {
|
||||
return '';
|
||||
}
|
||||
@@ -800,7 +865,8 @@ class MineService {
|
||||
final List<ExtraSignRewardItem> list = [];
|
||||
if (result.isSuccess) {
|
||||
List? values = result.data as List?;
|
||||
list.addAll(values?.map((e) => ExtraSignRewardItem.fromJson(e)).toList() ?? []);
|
||||
list.addAll(
|
||||
values?.map((e) => ExtraSignRewardItem.fromJson(e)).toList() ?? []);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user