import 'dart:async'; // import 'package:google_sign_in/google_sign_in.dart'; import 'package:bytedesk_kefu/model/codeResult.dart'; import 'package:bytedesk_kefu/model/jsonResult.dart'; import 'package:bytedesk_kefu/model/user.dart'; import 'package:bytedesk_kefu/http/bytedesk_user_api.dart'; import 'package:bytedesk_kefu/model/oauth.dart'; // import 'package:meta/meta.dart'; class UserRepository { final BytedeskUserHttpApi bytedeskHttpApi = BytedeskUserHttpApi(); UserRepository(); Future login(String? username, String? password) { return bytedeskHttpApi.oauth(username, password); } Future smsOAuth(String? mobile, String? code) { return bytedeskHttpApi.smsOAuth(mobile, code); } Future unionIdOAuth(String? unionid) { return bytedeskHttpApi.unionIdOAuth(unionid); } Future register(String? mobile, String? password) { return bytedeskHttpApi.register(mobile, password); } Future changePassword(String? mobile, String? password) { return bytedeskHttpApi.changePassword(mobile, password); } Future requestCode(String? mobile) { return bytedeskHttpApi.requestCode(mobile); } Future bindMobile(String? mobile) { return bytedeskHttpApi.bindMobile(mobile); } Future upload(String? filePath) { return bytedeskHttpApi.upload(filePath); } Future updateAvatar(String? avatar) { return bytedeskHttpApi.updateAvatar(avatar); } Future updateNickname(String? nickname) { return bytedeskHttpApi.updateNickname(nickname); } Future updateDescription(String? description) { return bytedeskHttpApi.updateDescription(description); } Future updateSex(bool? sex) { return bytedeskHttpApi.updateSex(sex); } Future updateLocation(String? location) { return bytedeskHttpApi.updateLocation(location); } Future updateBirthday(String? birthday) { return bytedeskHttpApi.updateBirthday(birthday); } Future updateMobile(String? mobile) { return bytedeskHttpApi.updateMobile(mobile); } Future isFollowed(String? uid) { return bytedeskHttpApi.isFollowed(uid); } Future follow(String? uid) { return bytedeskHttpApi.follow(uid); } Future unfollow(String? uid) { return bytedeskHttpApi.unfollow(uid); } Future logout() { // BytedeskUtils.printLog("user_repository logout"); return Future.wait([bytedeskHttpApi.logout()]); } // Future isLogin() { // BytedeskUtils.printLog("user_repository isSignedIn"); // // final currentUser = BytedeskHttpApi.currentUser(); // // return currentUser != null; // } Future getProfile() { return bytedeskHttpApi.getProfile(); } // Future getUsername() { // BytedeskUtils.printLog("user_repository getUsername"); // return (BytedeskHttpApi.currentUser()).username; // } }