27 lines
914 B
Dart
27 lines
914 B
Dart
import 'package:get/get.dart';
|
|
import 'package:starwork_flutter/api/api_path.dart';
|
|
import 'package:starwork_flutter/api/api_response.dart';
|
|
import 'package:starwork_flutter/api/base_api_service.dart';
|
|
import 'package:starwork_flutter/api/model/user/request/validation_code_login.dart';
|
|
import 'package:starwork_flutter/api/model/user/response/token_response.dart';
|
|
import 'package:starwork_flutter/common/constant/http_constant.dart';
|
|
|
|
class UserApiService {
|
|
final BaseApiService _api;
|
|
|
|
UserApiService(this._api); // 通过构造函数注入
|
|
|
|
// 验证码登录
|
|
Future<ApiResponse<LoginResponse>> validationCodeLogin({
|
|
required ValidationCodeLoginRequest request,
|
|
}) {
|
|
return _api.makeRequest(
|
|
// 通过实例调用
|
|
path: ApiPath.validationCodeLogin,
|
|
method: HttpConstant.post,
|
|
data: request.toJson(),
|
|
fromJson: (data) => LoginResponse.fromJson(data),
|
|
);
|
|
}
|
|
}
|