You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TimeManager/src/timemanagerapp/lib/controller/NetWorkController.dart

85 lines
1.9 KiB

import 'dart:async';
import 'dart:async';
import 'dart:io';
import '../entity/Course.dart';
import '../entity/Team.dart';
import '../entity/User.dart';
import '../entity/Work.dart';
class NetWorkController{
final httpClient = HttpClient();
final Uri baseUri=Uri(scheme: "http", host: "www.tianqiapi.com",path:'/api/' , queryParameters: {
"version":"v1",
"appid":"97799796",
"appsecret":"mN3u09pY",
});
Future<int> login(User user) async {
return Future(() => 1);
}
Future<int> register(User user) async {
return Future(() => 1);
}
Future<List<Work>> getSameFreeWork(int teamid){
List<Work> workList = [];
return Future(() => workList);
}
Future<List<Work>> getTeamWorkList (int teamid){
List<Work> workList = [];
return Future(() => workList);
}
Future<List<Team>> getTeamList(int userid){
List<Team> teamList = [];
return Future(() => teamList);
}
Future<bool> insertTeam(Team team) async {
return true;
}
Future<bool> deleteTeam(int teamid) async {
return true;
}
Future<bool> updateTeam(Team team) async {
return true;
}
Future<List<User>> getTeamUserList(int teamid) async {
List<User> userList = [];
return userList;
}
Future<bool> insertTeamUser(int teamid,int userid) async {
return true;
}
Future<bool> deleteTeamUser(int teamid,int userid) async {
return true;
}
//todo
// Future<bool> deleteTeamUser(int teamid,int userid) async {
// return true;
// }
//app启动时调用,同步所有数据库
Future<bool> updateCourse(List<Course> courseList) async {
return true;
}
Future<bool> updateTask(List<Work> workList) async {
return true;
}
Future<String> getUserCoursejson(int stuid,String passwd,int year, int term){
String res = "";
return Future(() => res);
}
}