import request from '@/packageCa/utilCa/request.js'

const api = {}

//根据openId,获取token,并判断用户是否已绑定账号
api.queryKaShiToken = (userId,name) => request.globalRequest(`/KaShi/QueryKaShiToken?userId=${userId}&name=${name}&schoolId=2268`,'GET', {})
// 获取ai面试路径
api.queryAIUrl = (userId,name) => request.globalRequest(`/KaShi/QueryAIUrl?userId=${userId}&name=${name}&schoolId=2268`,'GET', {})

//根据openId,获取token,并判断用户是否已绑定账号
api.getAccessTokenAndUser = (params) => request.globalRequest(`/WeChartToken/GetAccessTokenAndUser?openId=${params}`,'GET', {})

//获取用户token 生涯平台token
api.queryWechartToken = (userId,schoolId,userType) => request.globalRequest(`/Auth/QueryWechartToken?userId=${userId}&schoolId=${schoolId}&userType=${userType}`,'GET', {},1,4)
// 获取openid
api.getOpenId = (params) => request.globalRequest(`/WishOrder/GetOpenId?code=${params}`,'GET', {}, "")

// 微信支付
api.createWeiXinOrder = (data) => request.globalRequest(`/TenpayOrder/CreateWeiXinOrder`, 'POST', data)

// 用户绑定登录
api.userBindLogin = (data) => request.globalRequest(`/user/UserBindLogin`, 'POST', data)
//用户解绑账号或切换账号（有返回User, Token话,前端重新绑定到header上）
api.userUnBindOrChangeCodeNumber = (userId,type) => request.globalRequest(`/user/UserUnBindOrChangeCodeNumber?userId=${userId}&type=${type}`,'GET', {}, 1)
//获取当前微信用户已绑定的账号列表
api.getUserCodeNumber = () => request.globalRequest(`/user/GetUserCodeNumber`,'GET', {}, 1)
//根据学号获取学校列表
api.getSchoolByCodeNumber = (params) => request.globalRequest(`/user/GetSchoolByCodeNumber?codeNumber=${params}`,'GET', {}, 1)

// 判断学生是否完成生涯成熟度问卷, taskId大于0，需要进行问卷，taskId 等于0，不需要问卷
// api.getQuestionnaireTitlePower = () => request.globalRequest(`/CareerMaturityTask/GetQuestionnaireTitlePower`,'GET', {}, 1)
// 获取生涯成熟度题目
// api.getTestTitleListList = () => request.globalRequest(`/CareerMaturityTask/GetTestTitleListList`,'GET', {}, 1)
// 保存生涯成熟度测评结果
// api.saveCareerMaturityTestResult = (data) => request.globalRequest(`/CareerMaturityTask/SaveCareerMaturityTestResult`, 'POST', data, 1)

// 获取手机验证码
api.getMobileCode = (mobile) => request.globalRequest(`/WeChartUser/GetMobileCode?mobile=${mobile}&token=SQEIfNmlFufmOMNVPZCvNVWpDeldYjH`,'GET', {}, 1)
// 提交手机注册
api.checkSmsCode = (data) => request.globalRequest(`/user/CheckSmsCode`, 'POST', data, 1)

// 获取个人档案
api.queryStudentProfile = () => request.globalRequest(`/StudentResource/QueryStudentProfile`,'GET', {}, 2,4)
// 添加，取消个人意向
api.doIntention = (type,id,actionType) => request.globalRequest(`/StudentResource/DoIntention?type=${type}&actionType=${actionType}&id=${id}`,'GET', {}, 2,4)
//绑vip卡
api.bindCard = (data) => request.globalRequest(`/user/BindCard`,'POST', data, 1)

// 一体机激活 绑定 获取列表
api.queryMachineOrderCountList = (machineNumber) => request.globalRequest(`/Onemachine/QueryMachineOrderCountList?machineNumber=${machineNumber}`,'GET', {}, 1)
// 绑定设备
api.activityMachine = (data) => request.globalRequest(`/Onemachine/ActivityMachine`,'POST', data, 1)
// 解绑
api.removeMachine = (orderId,machineModelId,machineNumber) => request.globalRequest(`/Onemachine/RemoveMachine?orderId=${orderId}&machineModelId=${machineModelId}&machineNumber=${machineNumber}`,'POST', {}, 1)

// ai咨询问题
api.aISearch = (keyword,sessionId) => request.globalRequest(`/AIAgents/search?keyword=${keyword}&sessionId=${sessionId}`,'GET', {}, 1)
// ai获取历史咨询
api.aIGetHistoryRecord = (page) => request.globalRequest(`/AIAgents/GetHistoryRecord?page=${page}&pageSize=20`,'GET', {}, 1)

// 保存人脸图片
api.queryUploadPhoto = (address) => request.globalRequest(`/user/QueryUploadPhoto?address=${address}`,'GET', {}, 1)

// 保存操作日志
api.saveUserOperationLog = (data) => request.globalRequest(`/UserOperationLog/SaveUserOperationLog`,'POST', data, 3)
	
// 获取操作日志
api.getUserOperationLogList = (pageIndex,pageSize,keyword,operationType) => request.globalRequest(`/UserOperationLog/GetUserOperationLogList?pageIndex=${pageIndex}&pageSize=${pageSize}&keyword=${keyword}&operationType=${operationType}`,'GET', {}, 1)	
// 设备登录
api.loginOneMachine = (machineNo) => request.globalRequest(`/user/LoginOneMachine?machineNo=${machineNo}`,'POST', {}, 1)
// 获取系统菜单权限
api.querySchoolMenu = () => request.globalRequest(`/user/QuerySchoolMenu`,'GET', {}, 1)

// 保存高校个人信息
api.saveUserBasisInfo = (mobileCode,data) => request.globalRequest(`/user/SaveUserBasisInfo?mobileCode=${mobileCode}`,'POST', data, 1)

// 获取高校个人信息
api.getUserBasisInfo = () => request.globalRequest(`/user/GetUserBasisInfo`,'GET', {}, 1)
export default api


