/*
 * @Author: XianKaiQun
 * @Date: 2020-07-24 09:23:41
 * @LastEditors  : WuWei
 * @LastEditTime : 2022-01-19 16:29:00
 * @Description: 
 */
import 'package:app_package/app_package.dart';
import 'package:app_package/src/models/current_userinfo.dart';

class PersonalApi {
  static var _prefix = '/app/admin/personal';

  ///当前登录用户信息
  static Future<ResModel<CurrentUserinfoModel>> getCurrentUserinfo() async {
    var res = await HttpUtil.instance.get(
      '$_prefix/v1/employee',
    );
    return ResModel<CurrentUserinfoModel>(
      json: res.data,
      to: (v) => v.toJson(),
      from: (v) => CurrentUserinfoModel.fromJson(v),
    );
  }

  ///解绑微信
  static Future<ResModel<int?>> postUnbind(data) async {
    var res = await HttpUtil.instance.post(
      '$_prefix/unbind',
      queryParameters: data,
    );

    return ResModel<int?>(
      json: res.data,
      to: (v) => v,
      from: (v) => v,
    );
  }
}
