import 'package:cashier_reserve/common/request/request_manager.dart';
import 'package:cashier_reserve/data_model/login/login_result.dart';

/// LoginModel 登录相关请求
class LoginModel {

  /// 获取 登录验证码
  static Future<dynamic> getLoginAuthCode() async {
    final r = await RequestManager.get("/auth/code");
    return r;
  }

  static Future<LoginResult?> login(Map<String, dynamic> params) async {
    final r = await RequestManager.post("/auth/login", params);
    return r == null ? null : LoginResult.fromJson(r);
  }
}