/*
 * @author lsy
 * @date   2019-09-04
 **/
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/userModel/service/remote/api/UserLoginApi.serv.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/TestUserEntity.dart';
import 'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart';
import 'package:rxdart/rxdart.dart';

class UserRemote {
  static UserRemote _userRemote;

  UserRemote._() {}

  static UserRemote getInstance() {
    if (_userRemote == null) {
      _userRemote = new UserRemote._();
    }
    return _userRemote;
  }

  Observable<UserEntity> getUserInfo(String token) {
    return UserLoginApiImpl().getUserInfo(token);
  }

  Observable<TestUserEntity> resignUser(
      String name, String word, String reWord) {
    return UserLoginApiImpl().resign(name, word, reWord);
  }

  Observable<SimpleResponce> logout() {
    return UserLoginApiImpl().logout();
  }
}
