QinGang_interested/lib/http/modules/basic_info_api.dart

260 lines
7.1 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:dio/dio.dart';
import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/HttpManager.dart';
import 'package:qhd_prevention/services/SessionService.dart';
class BasicInfoApi {
/// 注册
static Future<Map<String, dynamic>> register(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/register',
method: Method.post,
data: {...data},
);
}
/// 注销
static Future<Map<String, dynamic>> logout(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/logOut',
method: Method.post,
data: {
...data
},
);
}
/// 发送验证码
static Future<Map<String, dynamic>> sendRegisterSms(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/sendPhoneCode',
method: Method.post,
data: {...data},
);
}
/// 完善个人信息
static Future<Map<String, dynamic>> updateUserInfo(Map data, String userIdCard) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/perfectUserInfo',
method: Method.post,
data: {...data,
'userIdCard' : userIdCard
},
);
}
// 入职
static Future<Map<String, dynamic>> userFirmEntry(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/onboarding',
method: Method.post,
data: {...data},
);
}
/// 获取用户信息
static Future<Map<String, dynamic>> getUserMessage(String value) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/user/$value',
method: Method.get,
data: {},
);
}
// 问题反馈
static Future<Map<String, dynamic>> feedback(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/problemFeedback',
method: Method.post,
data: {...data},
);
}
/// 获取企业列表
static Future<Map<String, dynamic>> getFirmList(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/app/corpInfo/list',
method: Method.post,
data: {...data},
);
}
/// 就职单位列表
static Future<Map<String, dynamic>> getFirmListByUser(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/app/userCorpRecord/list',
method: Method.post,
data: {...data},
);
}
/// 企业入职详情
static Future<Map<String, dynamic>> getFirmInfo(String id) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/app/userCorpRecord/getInfoById/$id',
method: Method.get,
data: {},
);
}
/// 离职申请
static Future<Map<String, dynamic>> leaveApply(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/appUserResignation',
method: Method.post,
data: {...data},
);
}
/// 在职企业列表
static Future<Map<String, dynamic>> getJoinFirmList() {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/appuser/getUserCorpList/${SessionService.instance.accountId}',
method: Method.post,
data: {},
);
}
/// 部门树状图
static Future<Map<String, dynamic>> getDeptTree(Map data) {
return HttpManager().request(
ApiService.basePath + (ApiService.isProduct ? '/basicInfo' : '/basicInfo') ,
'/department/listTree',
method: Method.post,
data: {...data},
);
}
/// 获取部门下所有用户
static Future<Map<String, dynamic>> getDeptUsers(final departmentId, {int isMyCorp = 0, String corpinfoId = ''}) {
final data = {
'departmentId': departmentId,
'corpinfoId' : corpinfoId
};
if (isMyCorp == 1) {
data['isMyCorp'] = 1;
}
return HttpManager().request(
ApiService.basePath,
'/basicInfo/user/listAll',
method: Method.get,
data: {
...data,
},
);
}
/// 数据字典获取
static Future<Map<String, dynamic>> getDictValues(String value) {
return HttpManager().request(
ApiService.basePath,
'/config/dict-trees/list/by/dictValues',
method: Method.get,
data: {'appKey': ApiService.appKey, 'dictValue': value},
);
}
}
/// 证照相关
class CertificateApi {
// 人员证照类表
static Future<Map<String, dynamic>> getCertificateList(Map data) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/listPage',
method: Method.post,
data: {...data},
);
}
// 添加证照
static Future<Map<String, dynamic>> addCertificate(Map data) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/save',
method: Method.post,
data: {...data},
);
}
// 查看证照getCertificateDetail
static Future<Map<String, dynamic>> getCertificateDetail(String id) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/getInfoById/$id',
method: Method.get,
data: {},
);
}
/// 更新证照updateCertificate
static Future<Map<String, dynamic>> updateCertificate(Map data) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/edit',
method: Method.put,
data: {...data},
);
}
/// 删除证照deleteCertificate
static Future<Map<String, dynamic>> deleteCertificate(String id) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/delete/$id',
method: Method.delete,
data: {},
);
}
// 删除证照验证
static Future<Map<String, dynamic>> deleteCertificateVerify(String eqUserId) {
return HttpManager().request(
ApiService.basePath,
'/xgfManager/project/projectHasUser?eqUserId=$eqUserId',
method: Method.get,
data: {},
);
}
// 持证人员列表
// corpinfoId、certificateType指定证照类型不指定不传
static Future<Map<String, dynamic>> getCertificateUserList(Map data) {
return HttpManager().request(
ApiService.basePath + '/certificate',
'/userCertificate/certifiedPersonnelList',
method: Method.post,
data: {
...data
},
);
}
}
// 待办事项
class TodoApi {
static Future<Map<String, dynamic>> getTodoList(Map data) {
return HttpManager().request(
ApiService.basePath + '/appmenu',
'/todoList/list',
method: Method.post,
data: {
...data
},
);
}
}