|
@@ -94,140 +94,138 @@ import 'package:liftmanager/internal/wode/model/share_model.dart';
|
|
|
|
|
|
class ApiUrl {
|
|
class ApiUrl {
|
|
///上传图片
|
|
///上传图片
|
|
- static const String upload = "/business/common/upload";
|
|
|
|
- static const String uploads = "/business/common/uploads";
|
|
|
|
-
|
|
|
|
|
|
+ static const String upload = ":20227/common/upload";
|
|
|
|
+ static const String uploads = ":20227/common/uploads";
|
|
|
|
+// static const String upload = "http://121.40.159.228:20234/common/upload";
|
|
|
|
+// static const String uploads = "http://121.40.159.228:20234/common/uploads";
|
|
|
|
+// static const String upload = ":10111/upload";
|
|
|
|
+// static const String uploads = ":10111/uploads";
|
|
///banner
|
|
///banner
|
|
- static const String banner_list = "/system/banner/list";
|
|
|
|
|
|
+ static const String banner_list = ":20230/banner/list";
|
|
|
|
|
|
///统计
|
|
///统计
|
|
- static const String count_doing = "/business/common/countDoing";
|
|
|
|
|
|
+ static const String count_doing = ":20227/common/countDoing";
|
|
|
|
+
|
|
|
|
|
|
///登录
|
|
///登录
|
|
- static const String version = "/system/version";
|
|
|
|
- static const String account_login = "/system/login/login";
|
|
|
|
- static const String account_wxlogin = "/system/login/wxLogin";
|
|
|
|
- static const String account_smscode = "/system/login/smsCode";
|
|
|
|
- static const String account_register = "/system/login/register";
|
|
|
|
- static const String account_resetPassword = "/system/login/resetPassword";
|
|
|
|
- static const String account_appBindMobile = "/system/login/appBindMobile";
|
|
|
|
- static const String account_wxregister = "/system/login/wxRegister";
|
|
|
|
|
|
+ static const String version = ":20230/version";
|
|
|
|
+ static const String account_login = ":20230/login/login";
|
|
|
|
+ static const String account_wxlogin = ":20230/login/wxLogin";
|
|
|
|
+ static const String account_smscode = ":20230/login/smsCode";
|
|
|
|
+ static const String account_register = ":20230/login/register";
|
|
|
|
+ static const String account_wxregister = ":20230/login/wxRegister";
|
|
|
|
+ static const String account_resetPassword = ":20230/login/resetPassword";
|
|
|
|
+ static const String account_appBindMobile = ":20230/login/appBindMobile";
|
|
|
|
|
|
///用户信息相关
|
|
///用户信息相关
|
|
- static const String user_info = "/system/user/info";
|
|
|
|
- static const String modify_avatar = "/system/user/modifyAvatar";
|
|
|
|
- static const String modify_name = "/system/user/modifyName";
|
|
|
|
|
|
+ static const String user_info = ":20230/user/info";
|
|
|
|
+ static const String modify_avatar = ":20230/user/modifyAvatar";
|
|
|
|
+ static const String modify_name = ":20230/user/modifyName";
|
|
static const String user_update = "/system/user/update";
|
|
static const String user_update = "/system/user/update";
|
|
|
|
|
|
///操作证
|
|
///操作证
|
|
- static const String liftCertificate_add = "/enterprise/oa/liftCertificate/add";
|
|
|
|
- static const String liftCertificate_findByUser =
|
|
|
|
- "/enterprise/oa/liftCertificate/findByUser";
|
|
|
|
|
|
+ static const String liftCertificate_add = ":20229/oa/liftCertificate/add";
|
|
|
|
+ static const String liftCertificate_findByUser = ":20229/oa/liftCertificate/findByUser";
|
|
|
|
|
|
///消息中心列表
|
|
///消息中心列表
|
|
- static const String notification_list = "/system/notification/list";
|
|
|
|
|
|
+ static const String notification_list = ":20230/notification/list";
|
|
|
|
|
|
///团队
|
|
///团队
|
|
- static const String mtcompany_ownList = "/system/mtcompany/ownList";
|
|
|
|
- static const String mtcompany_list = "/system/mtcompany/list";
|
|
|
|
- static const String mtcompany_createTeam = "/system/mtcompany/createTeam";
|
|
|
|
- static const String mtcompany_changeTeam = "/system/login/changeTeam";
|
|
|
|
- static const String mtcompany_applyTeam = "/system/userapply/applyTeam";
|
|
|
|
- static const String mtcompany_applyAudit = "/system/attestation/applyAudit";
|
|
|
|
- static const String mtcompany_teamInfo = "/system/mtcompany/teamInfo";
|
|
|
|
- static const String mtcompany_auditResult = "/system/attestation/auditResult";
|
|
|
|
- static const String mtcompany_userList =
|
|
|
|
- "/system/companyuser/app/getCompanyMembers";
|
|
|
|
|
|
+ static const String mtcompany_ownList = ":20230/mtcompany/ownList";
|
|
|
|
+ static const String mtcompany_list = ":20230/mtcompany/list";
|
|
|
|
+ static const String mtcompany_createTeam = ":20230/mtcompany/createTeam";
|
|
|
|
+ static const String mtcompany_changeTeam = ":20230/login/changeTeam";
|
|
|
|
+ static const String mtcompany_applyTeam = ":20230/userapply/applyTeam";
|
|
|
|
+ static const String mtcompany_auditResult = ":20230/attestation/auditResult";
|
|
|
|
+ static const String mtcompany_applyAudit = ":20230/attestation/applyAudit";
|
|
|
|
+ static const String mtcompany_teamInfo = ":20230/mtcompany/teamInfo";
|
|
|
|
+ static const String mtcompany_userList = ":20230/companyuser/app/getCompanyMembers";
|
|
|
|
|
|
///项目
|
|
///项目
|
|
- static const String project_list = "/business/app/project/list";
|
|
|
|
- static const String project_detail = "/business/app/project/detail";
|
|
|
|
- static const String project_user = "/business/app/project/user/list";
|
|
|
|
|
|
+ static const String project_list = ":20227/app/project/list";
|
|
|
|
+ static const String project_detail = ":20227/app/project/detail";
|
|
|
|
+ static const String project_user = ":20227/app/project/user/list";
|
|
|
|
|
|
///电梯
|
|
///电梯
|
|
- static const String lift_list = "/business/app/lift/list";
|
|
|
|
- static const String lift_detail = "/business/lift/detail";
|
|
|
|
- static const String lift_brand = "/business/common/brand/list";
|
|
|
|
- static const String lift_add = "/business/app/lift/add";
|
|
|
|
- static const String lift_modify = "/business/app/lift/modify";
|
|
|
|
|
|
+ static const String lift_brand = ":20227/common/brand/list";
|
|
|
|
+
|
|
|
|
+ static const String lift_list = ":20227/app/lift/list";
|
|
|
|
+ static const String lift_detail = ":20227/lift/detail";
|
|
|
|
+ static const String lift_add = ":20227/app/lift/add";
|
|
|
|
+ static const String lift_modify = ":20227/lift/modify";
|
|
|
|
|
|
///急修
|
|
///急修
|
|
static const String repair_count =
|
|
static const String repair_count =
|
|
- "/business/emergency/emergency-repair/count";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/count";
|
|
static const String repair_list =
|
|
static const String repair_list =
|
|
- "/business/emergency/emergency-repair/pageWorker";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/pageWorker";
|
|
static const String repair_add =
|
|
static const String repair_add =
|
|
- "/business/emergency/emergency-repair/add";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/add";
|
|
static const String repair_taking =
|
|
static const String repair_taking =
|
|
- "/business/emergency/emergency-repair/taking";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/taking";
|
|
static const String repair_arrive =
|
|
static const String repair_arrive =
|
|
- "/business/emergency/emergency-repair/arrive";
|
|
|
|
- static const String repair_stop = "/business/emergency/emergency-repair/stop";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/arrive";
|
|
|
|
+ static const String repair_stop = ":20227/emergency/emergency-repair/stop";
|
|
static const String repair_fault_tree =
|
|
static const String repair_fault_tree =
|
|
- "/business/emergency/emergency-repair/fault/tree";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/fault/tree";
|
|
static const String repair_fault_list =
|
|
static const String repair_fault_list =
|
|
- "/business/emergency/emergency-repair/fault/list";
|
|
|
|
- static const String repair_repairOrder =
|
|
|
|
- "/business/emergency/emergency-repair/repairOrder";
|
|
|
|
- static const String repair_detail =
|
|
|
|
- "/business/emergency/emergency-repair/findOne";
|
|
|
|
- static const String repair_evaluate =
|
|
|
|
- "/business/emergency/emergency-repair/evaluate";
|
|
|
|
|
|
+ ":20227/emergency/emergency-repair/fault/list";
|
|
|
|
+ static const String repair_repairOrder = ":20227/emergency/emergency-repair/repairOrder";
|
|
|
|
+ static const String repair_detail = ":20227/emergency/emergency-repair/findOne";
|
|
|
|
+ static const String repair_evaluate = ":20227/emergency/emergency-repair/evaluate";
|
|
|
|
|
|
///日常保养
|
|
///日常保养
|
|
- static const String maintenance_count = "/business/app/maintenance/count";
|
|
|
|
- static const String maintenance_planTask_list = "/business/app/maintenance/planTask";
|
|
|
|
- static const String maintenance_recordTask_list = "/business/app/maintenance/recordTask";
|
|
|
|
- static const String maintenance_list = "/business/app/maintenance/task";
|
|
|
|
|
|
+ static const String maintenance_count = ":20227/app/maintenance/count";
|
|
|
|
+ static const String maintenance_planTask_list = ":20227/app/maintenance/planTask";
|
|
|
|
+ static const String maintenance_recordTask_list = ":20227/app/maintenance/recordTask";
|
|
|
|
+// static const String maintenance_list = ":20227/app/maintenance/task";
|
|
static const String maintenance_record_info =
|
|
static const String maintenance_record_info =
|
|
- "/business/app/maintenance/record/info";
|
|
|
|
- static const String maintenance_options = "/enterprise/maintenance-option/options";
|
|
|
|
- static const String maintenance_record_add = "/business/app/record/add";
|
|
|
|
- static const String maintenance_record_modify = "/business/app/record/modify";
|
|
|
|
- static const String maintenance_record_detail = "/business/app/record/detail";
|
|
|
|
- static const String maintenance_record_evaluate = "/business/maintenance/record/evaluate";
|
|
|
|
-
|
|
|
|
|
|
+ ":20227/app/maintenance/record/info";
|
|
|
|
+ static const String maintenance_options = ":20229/maintenance-option/options";
|
|
|
|
+ static const String maintenance_record_add = ":20227/app/record/add";
|
|
|
|
+ static const String maintenance_record_modify = ":20227/app/record/modify";
|
|
|
|
+ static const String maintenance_record_detail = ":20227/maintenance/record/one";
|
|
|
|
+ static const String maintenance_record_evaluate = ":20227/maintenance/record/evaluate";
|
|
|
|
|
|
///年检
|
|
///年检
|
|
static const String yearly_list =
|
|
static const String yearly_list =
|
|
- "/business/annualinspection/annual-inspection/pageWorker";
|
|
|
|
|
|
+ ":20227/annualinspection/annual-inspection/pageWorker";
|
|
static const String yearly_toConfirmList =
|
|
static const String yearly_toConfirmList =
|
|
- "/business/annualinspection/annual-inspection/toConfirm";
|
|
|
|
|
|
+ ":20227/annualinspection/annual-inspection/toConfirm";
|
|
static const String yearly_confirm =
|
|
static const String yearly_confirm =
|
|
- "/business/annualinspection/annual-inspection/confirm";
|
|
|
|
|
|
+ ":20227/annualinspection/annual-inspection/confirm";
|
|
static const String yearly_selfcheck =
|
|
static const String yearly_selfcheck =
|
|
- "/business/annualinspection/annual-inspection/selfcheck";
|
|
|
|
|
|
+ ":20227/annualinspection/annual-inspection/selfcheck";
|
|
static const String yearly_check =
|
|
static const String yearly_check =
|
|
- "/business/annualinspection/annual-inspection/check";
|
|
|
|
- static const String yearly_finish =
|
|
|
|
- "/business/annualinspection/annual-inspection/finish";
|
|
|
|
- static const String yearly_count = "/business/annualinspection/annual-inspection/count";
|
|
|
|
|
|
+ ":20227/annualinspection/annual-inspection/check";
|
|
|
|
+ static const String yearly_finish = ":20227/annualinspection/annual-inspection/finish";
|
|
|
|
+ static const String yearly_count = ":20227/annualinspection/annual-inspection/count";
|
|
|
|
|
|
///新闻
|
|
///新闻
|
|
- static const String news_city = "/quan/news/location";
|
|
|
|
- static const String news_list = "/quan/news/app/list";
|
|
|
|
- static const String news_detail = "/quan/news";
|
|
|
|
- static const String news_zan = "/quan/news/like";
|
|
|
|
|
|
+ static const String news_city = ":20232/news/location";
|
|
|
|
+ static const String news_list = ":20232/news/app/list";
|
|
|
|
+ static const String news_detail = ":20232/news";
|
|
|
|
+ static const String news_zan = ":20232/news/like";
|
|
|
|
+
|
|
|
|
+ ///考勤签到
|
|
|
|
+ static const String sign_list = ":20229/oa/attendance/pageByUser";
|
|
|
|
+ static const String sign_config = ":20229/oa/attendance/time";
|
|
|
|
+ static const String sign_add = ":20229/oa/attendance/clock";
|
|
|
|
|
|
///大修
|
|
///大修
|
|
- static const String capital_count = "/business/app/capital/count";
|
|
|
|
- static const String capital_project_list = "/business/app/capital/project/list";
|
|
|
|
- static const String capital_lift_list = "/business/app/capital/lift/list";
|
|
|
|
- static const String capital_attendance_list = "/business/app/capital/attendance/list";
|
|
|
|
- static const String capital_sign_in = "/business/app/capital/sign/in";
|
|
|
|
- static const String capital_overdueApply = "/business/app/capital/overdueApply";
|
|
|
|
- static const String capital_project_detail = "/business/app/capital/project/detail";
|
|
|
|
- static const String capital_begin = "/business/app/capital/begin";
|
|
|
|
- static const String capital_completed = "/business/app/capital/completed";
|
|
|
|
|
|
+ static const String capital_count = ":20227/app/capital/count";
|
|
|
|
+ static const String capital_project_list = ":20227/app/capital/project/list";
|
|
|
|
+ static const String capital_lift_list = ":20227/app/capital/lift/list";
|
|
|
|
+ static const String capital_attendance_list = ":20227/app/capital/attendance/list";
|
|
|
|
+ static const String capital_sign_in = ":20227/app/capital/sign/in";
|
|
|
|
+ static const String capital_overdueApply = ":20227/app/capital/overdueApply";
|
|
|
|
+ static const String capital_project_detail = ":20227/app/capital/project/detail";
|
|
|
|
+ static const String capital_begin = ":20227/app/capital/begin";
|
|
|
|
+ static const String capital_completed = ":20227/app/capital/completed";
|
|
|
|
|
|
///消息
|
|
///消息
|
|
static const String push_msg_list = "/push/message/list";
|
|
static const String push_msg_list = "/push/message/list";
|
|
static const String push_msg = "/push/message";
|
|
static const String push_msg = "/push/message";
|
|
-
|
|
|
|
- ///考勤签到
|
|
|
|
- static const String sign_list = "/enterprise/oa/attendance/pageByUser";
|
|
|
|
- static const String sign_config = "/enterprise/oa/attendance/time";
|
|
|
|
- static const String sign_add = "/enterprise/oa/attendance/clock";
|
|
|
|
}
|
|
}
|
|
|
|
|
|
class ApiService {
|
|
class ApiService {
|
|
@@ -673,7 +671,10 @@ class ApiService {
|
|
params: {},
|
|
params: {},
|
|
isList: true,
|
|
isList: true,
|
|
onSuccessList: onSuccess,
|
|
onSuccessList: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError:(code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///添加电梯
|
|
///添加电梯
|
|
@@ -685,8 +686,14 @@ class ApiService {
|
|
"projectId": projectId,
|
|
"projectId": projectId,
|
|
"lift": lift
|
|
"lift": lift
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.lift_add,
|
|
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ await DioUtils().requestNetwork<bool>(
|
|
|
|
+ Method.post, ApiUrl.lift_add,
|
|
|
|
+ params: data,
|
|
|
|
+ onSuccess: onSuccess,
|
|
|
|
+ onError:(code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///编辑电梯
|
|
///编辑电梯
|
|
@@ -698,8 +705,14 @@ class ApiService {
|
|
"projectId": projectId,
|
|
"projectId": projectId,
|
|
"lift": lift
|
|
"lift": lift
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.lift_modify,
|
|
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ await DioUtils().requestNetwork<bool>(
|
|
|
|
+ Method.post, ApiUrl.lift_modify,
|
|
|
|
+ params: data,
|
|
|
|
+ onSuccess: onSuccess,
|
|
|
|
+ onError:(code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///获取消息中心列表
|
|
///获取消息中心列表
|
|
@@ -711,7 +724,11 @@ class ApiService {
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<TeamItem>(
|
|
await DioUtils().requestNetwork<TeamItem>(
|
|
Method.post, ApiUrl.notification_list,
|
|
Method.post, ApiUrl.notification_list,
|
|
- params: data, onSuccessList: onSuccess, onError: onError);
|
|
|
|
|
|
+ objectFromJson: (res) => TeamItem.fromJsonMap(res),
|
|
|
|
+ params: data, onSuccessList: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///已加入的团队列表
|
|
///已加入的团队列表
|
|
@@ -723,11 +740,11 @@ class ApiService {
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<TeamItem>(
|
|
await DioUtils().requestNetwork<TeamItem>(
|
|
Method.post, ApiUrl.mtcompany_ownList,
|
|
Method.post, ApiUrl.mtcompany_ownList,
|
|
- params: data,
|
|
|
|
- isList: true,
|
|
|
|
objectFromJson: (res) => TeamItem.fromJsonMap(res),
|
|
objectFromJson: (res) => TeamItem.fromJsonMap(res),
|
|
- onSuccessList: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, isList: true, onSuccessList: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///搜索团队列表
|
|
///搜索团队列表
|
|
@@ -740,7 +757,11 @@ class ApiService {
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
Method.post, ApiUrl.mtcompany_list,
|
|
Method.post, ApiUrl.mtcompany_list,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ objectFromJson: (res) => TeamEntity.fromJsonMap(res),
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///团队创建
|
|
///团队创建
|
|
@@ -756,7 +777,12 @@ class ApiService {
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
Method.post, ApiUrl.mtcompany_createTeam,
|
|
Method.post, ApiUrl.mtcompany_createTeam,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ objectFromJson: (res) => TeamEntity.fromJsonMap(res),
|
|
|
|
+ params: data, onSuccess: onSuccess, onError
|
|
|
|
+ : (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///切换团队
|
|
///切换团队
|
|
@@ -766,9 +792,13 @@ class ApiService {
|
|
"companyId": companyId,
|
|
"companyId": companyId,
|
|
"userId": SpUtil.getString(Constant.userId)
|
|
"userId": SpUtil.getString(Constant.userId)
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<TeamCurrentEntity>(
|
|
|
|
|
|
+ await DioUtils().requestNetwork<UserEntity>(
|
|
Method.post, ApiUrl.mtcompany_changeTeam,
|
|
Method.post, ApiUrl.mtcompany_changeTeam,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ objectFromJson: (res) => UserEntity.fromJsonMap(res),
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///申请加入团队
|
|
///申请加入团队
|
|
@@ -781,7 +811,11 @@ class ApiService {
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
await DioUtils().requestNetwork<TeamEntity>(
|
|
Method.post, ApiUrl.mtcompany_applyTeam,
|
|
Method.post, ApiUrl.mtcompany_applyTeam,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ objectFromJson: (res) => TeamEntity.fromJsonMap(res),
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -796,9 +830,10 @@ class ApiService {
|
|
await DioUtils().requestNetwork<TeamUserEntity>(
|
|
await DioUtils().requestNetwork<TeamUserEntity>(
|
|
Method.post, ApiUrl.mtcompany_userList,
|
|
Method.post, ApiUrl.mtcompany_userList,
|
|
objectFromJson: (res) => TeamUserEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => TeamUserEntity.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -961,7 +996,10 @@ class ApiService {
|
|
objectFromJson: (res) => MaintenanceLastEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => MaintenanceLastEntity.fromJsonMap(res),
|
|
params: data,
|
|
params: data,
|
|
onSuccess: onSuccess,
|
|
onSuccess: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///保养项目
|
|
///保养项目
|
|
@@ -978,7 +1016,10 @@ class ApiService {
|
|
params: data,
|
|
params: data,
|
|
isList: true,
|
|
isList: true,
|
|
onSuccessList: onSuccess,
|
|
onSuccessList: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///保养项目
|
|
///保养项目
|
|
@@ -1075,7 +1116,10 @@ class ApiService {
|
|
objectFromJson: (res) => RepairListEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => RepairListEntity.fromJsonMap(res),
|
|
params: data,
|
|
params: data,
|
|
onSuccess: onSuccess,
|
|
onSuccess: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///新增急修
|
|
///新增急修
|
|
@@ -1110,7 +1154,10 @@ class ApiService {
|
|
"takingTime": takingTime,
|
|
"takingTime": takingTime,
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_taking,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_taking,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///到达
|
|
///到达
|
|
@@ -1118,7 +1165,10 @@ class ApiService {
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
var data = {"id": id, "arriveTime": arriveTime, "position": position};
|
|
var data = {"id": id, "arriveTime": arriveTime, "position": position};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_arrive,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_arrive,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///停梯
|
|
///停梯
|
|
@@ -1126,7 +1176,10 @@ class ApiService {
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
var data = {"id": id, "stopDate": stopDate, "safetyConfirm": safetyConfirm};
|
|
var data = {"id": id, "stopDate": stopDate, "safetyConfirm": safetyConfirm};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_stop,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_stop,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///获取急修故障
|
|
///获取急修故障
|
|
@@ -1139,7 +1192,10 @@ class ApiService {
|
|
params: data,
|
|
params: data,
|
|
isList: true,
|
|
isList: true,
|
|
onSuccessList: onSuccess,
|
|
onSuccessList: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///保存急修单
|
|
///保存急修单
|
|
@@ -1170,10 +1226,12 @@ class ApiService {
|
|
"faultNature": faultNature,
|
|
"faultNature": faultNature,
|
|
"faultDuty": faultDuty,
|
|
"faultDuty": faultDuty,
|
|
};
|
|
};
|
|
- print(data);
|
|
|
|
await DioUtils().requestNetwork<bool>(
|
|
await DioUtils().requestNetwork<bool>(
|
|
Method.post, ApiUrl.repair_repairOrder,
|
|
Method.post, ApiUrl.repair_repairOrder,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///获取急修单
|
|
///获取急修单
|
|
@@ -1183,9 +1241,10 @@ class ApiService {
|
|
await DioUtils().requestNetwork<RepairItem>(
|
|
await DioUtils().requestNetwork<RepairItem>(
|
|
Method.post, ApiUrl.repair_detail,
|
|
Method.post, ApiUrl.repair_detail,
|
|
objectFromJson: (res) => RepairItem.fromJsonMap(res),
|
|
objectFromJson: (res) => RepairItem.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///急修评价
|
|
///急修评价
|
|
@@ -1200,8 +1259,12 @@ class ApiService {
|
|
"starLevel": starLevel,
|
|
"starLevel": starLevel,
|
|
"imgUrl": imgUrl,
|
|
"imgUrl": imgUrl,
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.repair_evaluate,
|
|
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ await DioUtils().requestNetwork<bool>(
|
|
|
|
+ Method.post, ApiUrl.repair_evaluate,
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///年检列表
|
|
///年检列表
|
|
@@ -1218,7 +1281,10 @@ class ApiService {
|
|
objectFromJson: (res) => YearlyListEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => YearlyListEntity.fromJsonMap(res),
|
|
params: data,
|
|
params: data,
|
|
onSuccess: onSuccess,
|
|
onSuccess: onSuccess,
|
|
- onError: onError);
|
|
|
|
|
|
+ onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///年检列表
|
|
///年检列表
|
|
@@ -1266,7 +1332,10 @@ class ApiService {
|
|
"selfcheckReportImg": "${imgUrl}"
|
|
"selfcheckReportImg": "${imgUrl}"
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_selfcheck,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_selfcheck,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///上传检验结果
|
|
///上传检验结果
|
|
@@ -1278,7 +1347,10 @@ class ApiService {
|
|
"checkResultImg": "${imgUrl}"
|
|
"checkResultImg": "${imgUrl}"
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_check,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_check,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///上传检验结果
|
|
///上传检验结果
|
|
@@ -1290,7 +1362,10 @@ class ApiService {
|
|
"annualInspectionImg": "${imgUrl2}"
|
|
"annualInspectionImg": "${imgUrl2}"
|
|
};
|
|
};
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_finish,
|
|
await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.yearly_finish,
|
|
- params: data, onSuccess: onSuccess, onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///年检统计
|
|
///年检统计
|
|
@@ -1313,12 +1388,12 @@ class ApiService {
|
|
"title": title,
|
|
"title": title,
|
|
"district": city
|
|
"district": city
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<NewsCommEntity>(
|
|
|
|
- Method.post, ApiUrl.news_list,
|
|
|
|
|
|
+ await DioUtils().requestNetwork<NewsCommEntity>(Method.post, ApiUrl.news_list,
|
|
objectFromJson: (res) => NewsCommEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => NewsCommEntity.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
Future newsDetail(id,
|
|
Future newsDetail(id,
|
|
@@ -1326,12 +1401,12 @@ class ApiService {
|
|
var data = {
|
|
var data = {
|
|
"id": id,
|
|
"id": id,
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<NewsDetailItem>(
|
|
|
|
- Method.post, ApiUrl.news_detail,
|
|
|
|
|
|
+ await DioUtils().requestNetwork<NewsDetailItem>(Method.post, ApiUrl.news_detail,
|
|
objectFromJson: (res) => NewsDetailItem.fromJsonMap(res),
|
|
objectFromJson: (res) => NewsDetailItem.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
Future newsZan(id,
|
|
Future newsZan(id,
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
{Function onSuccess, Function(int code, String msg) onError}) async {
|
|
@@ -1355,12 +1430,12 @@ class ApiService {
|
|
"userId": int.parse(SpUtil.getString(Constant.userId)),
|
|
"userId": int.parse(SpUtil.getString(Constant.userId)),
|
|
"clockTime": clockTime,
|
|
"clockTime": clockTime,
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<SignListEntity>(
|
|
|
|
- Method.post, ApiUrl.sign_list,
|
|
|
|
|
|
+ await DioUtils().requestNetwork<SignListEntity>(Method.post, ApiUrl.sign_list,
|
|
objectFromJson: (res) => SignListEntity.fromJsonMap(res),
|
|
objectFromJson: (res) => SignListEntity.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
Future signConfig(
|
|
Future signConfig(
|
|
@@ -1368,12 +1443,12 @@ class ApiService {
|
|
var data = {
|
|
var data = {
|
|
"mtCompanyId": SpUtil.getString(Constant.companyId),
|
|
"mtCompanyId": SpUtil.getString(Constant.companyId),
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<SignConfigItem>(
|
|
|
|
- Method.post, ApiUrl.sign_config,
|
|
|
|
|
|
+ await DioUtils().requestNetwork<SignConfigItem>(Method.post, ApiUrl.sign_config,
|
|
objectFromJson: (res) => SignConfigItem.fromJsonMap(res),
|
|
objectFromJson: (res) => SignConfigItem.fromJsonMap(res),
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
Future signAdd(coordinate, address, type,
|
|
Future signAdd(coordinate, address, type,
|
|
@@ -1385,12 +1460,11 @@ class ApiService {
|
|
"address": address,
|
|
"address": address,
|
|
"type": type
|
|
"type": type
|
|
};
|
|
};
|
|
- await DioUtils().requestNetwork<SignConfigItem>(
|
|
|
|
- Method.post, ApiUrl.sign_add,
|
|
|
|
- objectFromJson: (res) => SignConfigItem.fromJsonMap(res),
|
|
|
|
- params: data,
|
|
|
|
- onSuccess: onSuccess,
|
|
|
|
- onError: onError);
|
|
|
|
|
|
+ await DioUtils().requestNetwork<bool>(Method.post, ApiUrl.sign_add,
|
|
|
|
+ params: data, onSuccess: onSuccess, onError: (code,msg){
|
|
|
|
+ loginExpire(code);
|
|
|
|
+ onError(code,msg);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///大修统计
|
|
///大修统计
|