111
This commit is contained in:
@@ -2,13 +2,13 @@ import '../../core/constants/api_endpoints.dart';
|
||||
import '../../core/network/api_response.dart';
|
||||
import '../../core/network/dio_client.dart';
|
||||
|
||||
/// 福利中心服务
|
||||
/// 福利中心服務
|
||||
class BonusService {
|
||||
final DioClient _client;
|
||||
|
||||
BonusService(this._client);
|
||||
|
||||
/// 获取福利中心状态
|
||||
/// 獲取福利中心狀態
|
||||
Future<ApiResponse<Map<String, dynamic>>> getWelfareStatus() async {
|
||||
final response = await _client.get<Map<String, dynamic>>(
|
||||
ApiEndpoints.bonusWelfare,
|
||||
@@ -16,10 +16,10 @@ class BonusService {
|
||||
if (response.success && response.data != null) {
|
||||
return ApiResponse.success(response.data!, response.message);
|
||||
}
|
||||
return ApiResponse.fail(response.message ?? '获取福利状态失败');
|
||||
return ApiResponse.fail(response.message ?? '獲取福利狀態失敗');
|
||||
}
|
||||
|
||||
/// 领取首充福利
|
||||
/// 領取首充福利
|
||||
Future<ApiResponse<Map<String, dynamic>>> claimNewUserBonus() async {
|
||||
return _client.post<Map<String, dynamic>>(
|
||||
ApiEndpoints.bonusClaim,
|
||||
@@ -27,7 +27,7 @@ class BonusService {
|
||||
);
|
||||
}
|
||||
|
||||
/// 领取推广奖励
|
||||
/// 領取推廣獎勵
|
||||
Future<ApiResponse<Map<String, dynamic>>> claimReferralBonus(
|
||||
int referredUserId,
|
||||
int milestone,
|
||||
@@ -41,4 +41,21 @@ class BonusService {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// 領取間接推廣獎勵
|
||||
Future<ApiResponse<Map<String, dynamic>>> claimIndirectReferralBonus(
|
||||
int directReferralId,
|
||||
int indirectReferredUserId,
|
||||
int milestone,
|
||||
) async {
|
||||
return _client.post<Map<String, dynamic>>(
|
||||
ApiEndpoints.bonusClaim,
|
||||
data: {
|
||||
'type': 'indirect_referral',
|
||||
'directReferralId': directReferralId,
|
||||
'indirectReferredUserId': indirectReferredUserId,
|
||||
'milestone': milestone,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user