diff --git a/entry/src/main/ets/api/canshuzhongxinjiekou.ts b/entry/src/main/ets/api/canshuzhongxinjiekou.ts deleted file mode 100644 index 156ee20f..00000000 --- a/entry/src/main/ets/api/canshuzhongxinjiekou.ts +++ /dev/null @@ -1,82 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -import request from '../common/utils/http'; - -/** 1.获取考车考点信息 获取考车gpsIP、udpIP、音视频端口等考车和考点参数配置 POST /para/initCarInfoCache.ws */ -export async function initCarInfoCacheUsingPost( - body: API.GpsIPUdpIP2, - options?: { [key: string]: any }, -) { - return request('/para/initCarInfoCache.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 3.初始化考车视频参数 初始化考车视频参数 POST /para/initCarParameter.ws */ -export async function initCarVideoParameterUsingPost( - body: API.Pinyin_7, - options?: { [key: string]: any }, -) { - return request('/para/initCarParameter.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 4.从参数平台获取参数 单个读表,读取其他 ma_ 开头的评判参数表 POST /para/initCenterCache.ws */ -export async function initCenterCacheFromParamUsingPost( - body: API.Pinyin_5, - options?: { [key: string]: any }, -) { - return request('/para/initCenterCache.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 2.初始化模型 初始化模型 POST /para/initEsModel.ws */ -export async function initModelUsingPost(body: API.Pinyin_32, options?: { [key: string]: any }) { - return request('/para/initEsModel.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 5.参数平台基础数据同步 被请求的 GET /param/baseDataSync */ -export async function paramBaseDataSyncUsingGet(options?: { [key: string]: any }) { - return request('/param/baseDataSync', { - method: 'GET', - ...(options || {}), - }); -} - -/** 6.参数平台参数数据同步 被请求的 GET /param/configDataSync/${param0} */ -export async function paramConfigDataSyncUsingGet( - // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) - params: API.paramConfigDataSyncUsingGETParams, - options?: { [key: string]: any }, -) { - const { tableName: param0, ...queryParams } = params; - return request(`/param/configDataSync/${param0}`, { - method: 'GET', - params: { ...queryParams }, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/api/checkCar.ets b/entry/src/main/ets/api/checkCar.ets new file mode 100644 index 00000000..4c426d35 --- /dev/null +++ b/entry/src/main/ets/api/checkCar.ets @@ -0,0 +1,61 @@ +import request from "../utils/Request" +import http from "@ohos.net.http" + + +export async function carConfigurationInfo(params: object) { + return request({ + url: '/der2/services/exam/carConfigurationInfo.ws', + data: params, + method: http.RequestMethod.POST, + xml: false, + }) +} + +interface registrationDeviceNoParams { + time: string + deviceName: string + type: string +} + +//设备注册 +export async function registrationDeviceNo(params: registrationDeviceNoParams) { + return request({ + url: '/der2/services/exam/registrationDeviceNo.ws', + data: ` + + + ${params.deviceName}${params.deviceName}${params.type} + `, + method: http.RequestMethod.POST, + xml: true + }) +} + +interface uploadExamCarCheckResultParams { + time: string + carId: string + examinationRoomId: string + plateNo: string + flag: string + condition: string +} + +//自检结果上传 +export async function uploadExamCarCheckResult(params: uploadExamCarCheckResultParams) { + return request({ + url: '/der2/services/exam/uploadExamCarCheckResult.ws', + data: ` + + + ${params.carId}${params.examinationRoomId}${params.plateNo}${params.flag} ${params.condition} + + `, + method: http.RequestMethod.POST, + xml: true + }) +} + + + + + diff --git a/entry/src/main/ets/api/checkCar.ts b/entry/src/main/ets/api/checkCar.ts deleted file mode 100644 index 59674094..00000000 --- a/entry/src/main/ets/api/checkCar.ts +++ /dev/null @@ -1,45 +0,0 @@ -import request from "../common/utils/request" - - -export async function carConfigurationInfo(params){ - return request({ - url:'/der2/services/exam/carConfigurationInfo.ws', - data:params, - method:'post', - xml:false, - }) -} - -//设备注册 -export async function registrationDeviceNo(params){ - return request({ - url:'/der2/services/exam/registrationDeviceNo.ws', - data:` - - - ${params.deviceName}${params.deviceName}${params.type} - `, - method:'post', - xml:true - }) -} - -//自检结果上传 -export async function uploadExamCarCheckResult(params){ - return request({ - url:'/der2/services/exam/uploadExamCarCheckResult.ws', - data:` - - - ${params.carId}${params.examinationRoomId}${params.plateNo}${params.flag} ${params.condition} - - `, - method:'post', - xml:true - }) -} - - - - - diff --git a/entry/src/main/ets/api/dashboard.ts b/entry/src/main/ets/api/dashboard.ts deleted file mode 100644 index 4df6c3d2..00000000 --- a/entry/src/main/ets/api/dashboard.ts +++ /dev/null @@ -1,15 +0,0 @@ -import request from "../common/utils/request" -import tempRequest from '../common/utils/tempRequest' - -export async function timeSynchronization(params){ - return request({ - url:'/der2/services/exam/timeSynchronization.ws', - data:` - - - - `, - method:'get', - xml:true - }) -} diff --git a/entry/src/main/ets/api/index.ets b/entry/src/main/ets/api/index.ets new file mode 100644 index 00000000..a887724e --- /dev/null +++ b/entry/src/main/ets/api/index.ets @@ -0,0 +1,150 @@ +import request from "../utils/Request" +import http from "@ohos.net.http" + +interface timeSynchronizationParams { + time: string + deviceNo: string + version: string + judgeVersion: string +} + +//同步时间 +export async function timeSynchronization(params: timeSynchronizationParams) { + return request({ + url: '/der2/services/exam/timeSynchronization.ws', + data: ` + + + ${params.deviceNo} + ${params.version} + ${params.judgeVersion} + + `, + method: http.RequestMethod.POST, + xml: true + }) +} + +interface timeSynchronizationHTTPParams { + time: string + deviceNo: string + version: string + judgeVersion: string +} + +//同步时间 +export async function timeSynchronizationHTTP(params: timeSynchronizationHTTPParams) { + return request({ + url: '/der2/services/exam/timeSynchronization.ws', + data: ` + + + ${params.deviceNo} + ${params.version} + ${params.judgeVersion} + + `, + method: http.RequestMethod.POST, + xml: true + }) +} + +interface obtainCarExamInfoParams { + time: string + deviceNo: string +} + +//获取考车信息 +export async function obtainCarExamInfo(params: obtainCarExamInfoParams) { + return request({ + url: '/der2/services/exam/obtainCarExamInfo.ws', + data: ` + + + ${params.deviceNo} + `, + method: http.RequestMethod.POST, + xml: true + }) +} + +interface initCarInfoCacheParams { + data: object + host: string +} + +//获取参数平台考车信息 +export async function initCarInfoCache(params: initCarInfoCacheParams) { + return request({ + url: '/para/initCarInfoCache.ws', + data: params.data, + method: http.RequestMethod.POST, + xml: false, + host: params.host + }) +} + + +//参数下发读表接口 +export async function initCenterCache(params: object, url: string) { + return await request({ + url: '/para/initCenterCache.ws', + data: params, + method: http.RequestMethod.POST, + xml: false, + host: url || globalThis.timeInfo.url as string, + }) +} + +//参数下发读表接口 +export async function initCenterCacheByKSPT(params: object, url: string) { + return await request({ + url: '/der2/services/para/initCenterCache.ws', + data: params, + method: http.RequestMethod.POST, + xml: false, + host: url + }) +} + + +//从参数平台获取模型 +export async function initEsModel(params) { + return await request({ + url: '/para/initEsModel.ws', + data: params, + method: http.RequestMethod.POST, + xml: false, + host: globalThis.timeInfo.url as string, + }) +} + +interface initializationParams { + carId: string + examinationRoomId: string + shellVersion: string + judgeVersion: string + videoVersion: string + host: string +} + +export async function initialization(params: initializationParams) { + return await request({ + url: '/der2/services/exam/initialization.ws', + data: `${params.carId}${params.examinationRoomId}${params.shellVersion}${params.judgeVersion}${params.videoVersion}`, + method: http.RequestMethod.POST, + host: params.host, + xml: true, + timeout: 1000 * 60 + }) +} + +//参数下发读表接口 +export async function initCarParameter(params: object) { + return await request({ + url: '/der2/services/para/initCarParameter.ws', + data: params, + method: http.RequestMethod.POST, + xml: false, + }) +} \ No newline at end of file diff --git a/entry/src/main/ets/api/index.ts b/entry/src/main/ets/api/index.ts deleted file mode 100644 index 1e114e86..00000000 --- a/entry/src/main/ets/api/index.ts +++ /dev/null @@ -1,113 +0,0 @@ -import request from "../common/utils/request" -import tempRequest from '../common/utils/tempRequest' - -//同步时间 -export async function timeSynchronization(params){ - return request({ - url:'/der2/services/exam/timeSynchronization.ws', - data:` - - - ${params.deviceNo} - ${params.version} - ${params.judgeVersion} - - `, - method:'post', - xml:true - }) -} - -//同步时间 -export async function timeSynchronizationHTTP(params){ - return tempRequest({ - url:'/der2/services/exam/timeSynchronization.ws', - data:` - - - ${params.deviceNo} - ${params.version} - ${params.judgeVersion} - - `, - method:'post', - xml:true - }) -} - -//获取考车信息 -export async function obtainCarExamInfo(params){ - return request({ - url:'/der2/services/exam/obtainCarExamInfo.ws', - data:` - - - ${params.deviceNo} - `, - method:'post', - xml:true - }) -} -//获取参数平台考车信息 -export async function initCarInfoCache(params){ - return request({ - url:'/para/initCarInfoCache.ws', - data:params.data, - method:'post', - xml:false, - host: params.host - }) -} -//参数下发读表接口 -export async function initCenterCache(params,url){ - return await request({ - url:'/para/initCenterCache.ws', - data:params, - method:'post', - xml:false, - host:url||globalThis.timeInfo.url, - }) -} -//参数下发读表接口 -export async function initCenterCacheByKSPT(params,url){ - return await request({ - url:'/der2/services/para/initCenterCache.ws', - data:params, - method:'post', - xml:false, - host:url - }) -} - - -//从参数平台获取模型 -export async function initEsModel(params){ - return await request({ - url:'/para/initEsModel.ws', - data:params, - method:'post', - xml:false, - host:globalThis.timeInfo.url, - }) -} - -export async function initialization(params){ - return await request({ - url:'/der2/services/exam/initialization.ws', - data:`${params.carId}${params.examinationRoomId}${params.shellVersion}${params.judgeVersion}${params.videoVersion}`, - method:'post', - host:params.host, - xml:true, - timeout: 1000 * 60 - }) -} - -//参数下发读表接口 -export async function initCarParameter(params){ - return await request({ - url:'/der2/services/para/initCarParameter.ws', - data:params, - method:'post', - xml:false, - }) -} \ No newline at end of file diff --git a/entry/src/main/ets/api/judge.ts b/entry/src/main/ets/api/judge.ets similarity index 78% rename from entry/src/main/ets/api/judge.ts rename to entry/src/main/ets/api/judge.ets index 0581b0c3..52383b63 100644 --- a/entry/src/main/ets/api/judge.ts +++ b/entry/src/main/ets/api/judge.ets @@ -1,20 +1,21 @@ -import request from '../common/utils/request'; +import request from '../utils/Request'; import { getCurrentTime } from '../common/utils/tools'; import { getSyncData } from '../common/service/initable'; import writeObjectOutNew from './judgeNew'; import FileUtil from '../common/utils/File'; import tempRequest from '../common/utils/tempRequest'; +import http from '@ohos.net.http'; let baseHost = globalThis.host; // 下载模型 export async function download() { - return request({ - host: baseHost, + return request({ + host: baseHost as string, url: '/para/initEsModel.ws', - method: 'post', - xml: false + method: http.RequestMethod.POST, + xml: false, }) } @@ -49,7 +50,7 @@ export async function writeObjectOut(params, filePath?: string): Promise { } }) } - const {xtlb,jkxlh,jkid,drvexam} = params; + const { xtlb, jkxlh, jkid, drvexam } = params; console.log('testsqlTag3') //新监管调用 @@ -64,17 +65,19 @@ export async function writeObjectOut(params, filePath?: string): Promise { .map((key: string) => ( `<${key}>${drvexam[key]}`)); - console.log('surenjun filePath=>', filePath); if (filePath) { const fileUtil = new FileUtil(globalThis.context); await fileUtil.initFolder(filePath); fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({ - xtlb, jkxlh, jkid, drvexam: { ...drvexam, zp: '' }, + xtlb, + jkxlh, + jkid, + drvexam: { ...drvexam, zp: '' }, }) + `\n`); } //对象转换成xml - const temp = await request({ + const temp = await request({ host: globalThis.JGHOST, url: '/dems_ws/services/TmriOutAccess?wsdl', data: ` @@ -101,7 +104,7 @@ export async function writeObjectOut(params, filePath?: string): Promise { `, - method: 'post', + method: http.RequestMethod.POST, xml: true },) if (filePath) { @@ -118,10 +121,21 @@ export async function writeObjectOut(params, filePath?: string): Promise { return temp } +interface uploadExamProgressDataParams{ + carId: string + examinationRoomId: string + type: string + time: string + cardNo: string + examData: string + examStartTime: string + examEndTime: string +} + // 过程文件上传 -export async function uploadExamProgressData(params) { +export async function uploadExamProgressData(params:uploadExamProgressDataParams) { const singlePlay = globalThis.singlePlay - const {carId,examinationRoomId,type,time,cardNo,examData,examStartTime,examEndTime} = params + const { carId, examinationRoomId, type, time, cardNo, examData, examStartTime, examEndTime } = params if (singlePlay) { return } @@ -129,29 +143,29 @@ export async function uploadExamProgressData(params) { url: '/der2/services/exam/uploadExamDataFile.ws', data: ` - + - ${carId} - ${examinationRoomId} - ${examData} - ${type} - ${cardNo} - ${examStartTime} - ${examEndTime} + ${params.carId} + ${params.examinationRoomId} + ${params.examData} + ${params.type} + ${params.cardNo} + ${params.examStartTime} + ${params.examEndTime} `, - method: 'post', + method: http.RequestMethod.POST, xml: true }) } export async function uploadExamProgressData2(params) { const singlePlay = globalThis.singlePlay - const {carId,examinationRoomId,type,time,cardNo,examData,examStartTime,examEndTime} = params + const { carId, examinationRoomId, type, time, cardNo, examData, examStartTime, examEndTime } = params if (singlePlay) { return } - return request({ + return request({ url: '/der2/services/exam/uploadExamDataFile.ws', data: ` @@ -166,7 +180,7 @@ export async function uploadExamProgressData2(params) { ${examEndTime} `, - method: 'post', + method: http.RequestMethod.POST, xml: true }) } @@ -178,7 +192,7 @@ export async function uploadExamMileage(params) { return } const time = await getCurrentTime() - return request({ + return request({ url: '/der2/services/exam/uploadExamMileage.ws', data: ` @@ -191,7 +205,7 @@ export async function uploadExamMileage(params) { ${params.kslc} `, - method: 'post', + method: http.RequestMethod.POST, xml: true }) } @@ -204,7 +218,7 @@ export async function uploadExamGrade(params) { } const paramsArrs = Reflect.ownKeys(params).map((key: string) => (`<${key}>${params[key]}`)) const time = await getCurrentTime() - return request({ + return request({ url: '/der2/services/exam/uploadExamGrade.ws', data: ` @@ -213,7 +227,7 @@ export async function uploadExamGrade(params) { ${paramsArrs} `, - method: 'post', + method: http.RequestMethod.POST, xml: true }) } @@ -226,9 +240,9 @@ function validateIP(path: string) { // 上传运行时常 export async function uploadHarmonyLiCheng(data) { - return request({ + return request({ url: '/der2/services/data/harmonyLiCheng.ws', data, - method: 'post', + method: http.RequestMethod.POST, }) } diff --git a/entry/src/main/ets/api/kaochechushihuaxiangguanjiekoukaoshizhongxin.ts b/entry/src/main/ets/api/kaochechushihuaxiangguanjiekoukaoshizhongxin.ts deleted file mode 100644 index 9e639180..00000000 --- a/entry/src/main/ets/api/kaochechushihuaxiangguanjiekoukaoshizhongxin.ts +++ /dev/null @@ -1,116 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -import request from '../common/utils/http'; - -/** 4.考车自检项目信息读取 考车自检项目信息读取 POST /exam/carConfigurationInfo.ws */ -export async function carConfigurationInfoUsingPost( - body: API.Pinyin_34, - options?: { [key: string]: any }, -) { - return request('/exam/carConfigurationInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 6.随车考试员登录 随车考试员登录 POST /exam/examinerLogin.ws */ -export async function examinerLoginUsingPost( - body: API.Pinyin_39, - options?: { [key: string]: any }, -) { - return request('/exam/examinerLogin.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 3.获取考点系统参数 考车从考试中心获取考点系统参数,即考试平台的exam_point_config表 POST /exam/initSysset300.ws */ -export async function initExamPointConfigUsingPost( - body: API.Pinyin_33, - options?: { [key: string]: any }, -) { - return request('/exam/initSysset300.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 8.考车考点信息查询 考车考点信息查询 POST /exam/queryVehiclePoint.ws */ -export async function queryVehiclePointUsingPost( - body: API.Pinyin_28, - options?: { [key: string]: any }, -) { - return request('/exam/queryVehiclePoint.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 1.终端设备注册 包括但不限于考车、闸机 POST /exam/registrationDeviceNo.ws */ -export async function registrationDeviceNoUsingPost( - body: API.Pinyin_23, - options?: { [key: string]: any }, -) { - return request('/exam/registrationDeviceNo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 2.终端初始化时间同步 终端初始化时间同步 POST /exam/timeSynchronization.ws */ -export async function timeSynchronizationUsingPost(options?: { [key: string]: any }) { - return request('/exam/timeSynchronization.ws', { - method: 'POST', - ...(options || {}), - }); -} - -/** 5.考车自检结果写入 考车自检结果写入 POST /exam/uploadExamCarCheckResult.ws */ -export async function uploadExamCarCheckResultUsingPost( - body: API.Pinyin_29, - options?: { [key: string]: any }, -) { - return request('/exam/uploadExamCarCheckResult.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 7.考车日志信息上传 考车日志信息上传 POST /exam/uploadVehicleLog.ws */ -export async function uploadVehicleLogUsingPost( - body: API.Pinyin_27, - options?: { [key: string]: any }, -) { - return request('/exam/uploadVehicleLog.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/api/kaoshiguochengshujujiekou.ts b/entry/src/main/ets/api/kaoshiguochengshujujiekou.ts deleted file mode 100644 index 49c1399f..00000000 --- a/entry/src/main/ets/api/kaoshiguochengshujujiekou.ts +++ /dev/null @@ -1,78 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -import request from '../common/utils/http'; - -/** 3.考车对考生缺考操作 考车对考生缺考操作 POST /exam/examinationStuAbsent.ws */ -export async function examinationStuAbsentUsingPost( - body: API.Pinyin_26, - options?: { [key: string]: any }, -) { - return request('/exam/examinationStuAbsent.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 2.断点续考 断点续考获取考试项目 POST /exam/getExaminationItem.ws */ -export async function getExaminationItemUsingPost( - body: API.Pinyin_18, - options?: { [key: string]: any }, -) { - return request('/exam/getExaminationItem.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 1.下载考生信息 考车端通过此接口下载监管(或本地随机)分配的考生信息 POST /exam/getExaminationStudentInfo.ws */ -export async function getExaminationStudentInfoUsingPost( - body: API.Pinyin_3, - options?: { [key: string]: any }, -) { - return request('/exam/getExaminationStudentInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 4.上传考试过程数据文件 上传考试过程数据文件 POST /exam/uploadExamDataFile.ws */ -export async function uploadExamDataFileUsingPost( - body: API.Pinyin_2, - options?: { [key: string]: any }, -) { - return request('/exam/uploadExamDataFile.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 5.上传考生考试里程 上传考生考试里程 POST /exam/uploadExamMileage.ws */ -export async function uploadExamMileageUsingPost( - body: API.Pinyin__, - options?: { [key: string]: any }, -) { - return request('/exam/uploadExamMileage.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/api/qitajiekou.ts b/entry/src/main/ets/api/qitajiekou.ts deleted file mode 100644 index 8032c14f..00000000 --- a/entry/src/main/ets/api/qitajiekou.ts +++ /dev/null @@ -1,46 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -// @ts-ignore -import request from '../common/utils/http'; - -/** 2.无锡所接口请求 无锡所通用接口请求 POST /common/callWxsRest.do */ -export async function callWxsRestUsingPost(body: API.Pinyin_20, options?: { [key: string]: any }) { - return request('/common/callWxsRest.do', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 3.无锡所接口请求测试 无锡所接口请求测试,返回测试数据 POST /common/callWxsRestTest.do */ -export async function callWxsRestTestUsingPost( - body: API.Pinyin_20, - options?: { [key: string]: any }, -) { - return request('/common/callWxsRestTest.do', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 1.大屏显示数据查询与控制 大屏显示数据查询与控制 POST /data/examInfoStandardDisplay.ws */ -export async function examInfoStandardDisplayUsingPost( - body: API.Pinyin_13, - options?: { [key: string]: any }, -) { - return request('/data/examInfoStandardDisplay.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/api/renlianshibiexiangguanjiekou.ts b/entry/src/main/ets/api/renlianshibiexiangguanjiekou.ts deleted file mode 100644 index 12dd4115..00000000 --- a/entry/src/main/ets/api/renlianshibiexiangguanjiekou.ts +++ /dev/null @@ -1,75 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -import request from '../common/utils/http'; - -/** 4.数据更新 数据更新:照片,指纹,随机序号,监管签到,状态等操作 POST /data/getAccessControlInfo.ws */ -export async function getAccessControlInfoUsingPost( - body: API.Pinyin_30, - options?: { [key: string]: any }, -) { - return request('/data/getAccessControlInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 2.身份合法性判断 身份合法性判断:约考信息下载,收费查询,场次控制等 POST /data/getAccessStuInfo.ws */ -export async function getAccessStuInfoUsingPost( - body: API.Pinyin_36, - options?: { [key: string]: any }, -) { - return request('/data/getAccessStuInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 1.门禁版本控制 门禁版本控制 POST /exam/gateLoginInit.ws */ -export async function getLoginInitUsingPost(body: API.Pinyin_38, options?: { [key: string]: any }) { - return request('/exam/gateLoginInit.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 3.门禁/考车终端人脸识别 门禁/考车终端人脸识别 POST /imageCompare/base64ImageStrCompare.ws */ -export async function base64ImageStrCompareUsingPost( - body: API.Pinyin_37, - options?: { [key: string]: any }, -) { - return request('/imageCompare/base64ImageStrCompare.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 5.考官/随车考试员闸机人脸识别 考官/随车考试员闸机人脸识别,此处安全员是代替没有身份证学员人脸识别 POST /pmUserCheckCardNoFace.ws */ -export async function examManFaceRecognitionUsingPost( - body: API.Pinyin_25, - options?: { [key: string]: any }, -) { - return request('/pmUserCheckCardNoFace.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/api/shipinronghexiangguanjiekou.ts b/entry/src/main/ets/api/shipinronghexiangguanjiekou.ts deleted file mode 100644 index be57c084..00000000 --- a/entry/src/main/ets/api/shipinronghexiangguanjiekou.ts +++ /dev/null @@ -1,63 +0,0 @@ -// @ts-ignore -/* eslint-disable */ -import request from '../common/utils/http'; - -/** 3.合成视频监测 合成视频监测 POST /data/compositedVideosMonitor.ws */ -export async function compositedVideosMonitorUsingPost( - body: API.Pinyin_11, - options?: { [key: string]: any }, -) { - return request('/data/compositedVideosMonitor.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 1.场地摄像头设备信息 场地摄像头设备信息--科目二三都调用此接口(科三只有贵州在用2022-10-13) POST /data/getKm2FieldGunCameraInfo.ws */ -export async function getKm2FieldGunCameraInfoUsingPost( - body: API.Pinyin_11, - options?: { [key: string]: any }, -) { - return request('/data/getKm2FieldGunCameraInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 4.获取考生考试信息 获取考生考试信息 POST /data/getStudExamInfo.ws */ -export async function getStudExamInfoUsingPost( - body: API.Pinyin_17, - options?: { [key: string]: any }, -) { - return request('/data/getStudExamInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} - -/** 2.小红求获取扣分信息(参数平台接口) 小红求获取扣分信息-(视频合成用-小红球程序-放在参数平台) POST /data/obtainMarkRuleSetInfo.ws */ -export async function obtainMarkRuleSetInfoUsingPost( - body: API.Pinyin_15, - options?: { [key: string]: any }, -) { - return request('/data/obtainMarkRuleSetInfo.ws', { - method: 'POST', - headers: { - 'Content-Type': 'application/json;charset=UTF-8', - }, - data: body, - ...(options || {}), - }); -} diff --git a/entry/src/main/ets/utils/Request.ets b/entry/src/main/ets/utils/Request.ets index dc123c01..1fc1d849 100644 --- a/entry/src/main/ets/utils/Request.ets +++ b/entry/src/main/ets/utils/Request.ets @@ -5,12 +5,12 @@ import promptAction from "@ohos.promptAction"; interface RequestOption { url: string - params: object - data: object | string + data?: object | string xml: boolean method: http.RequestMethod host?: string isNewCenter?: boolean + timeout?: number } const base: string = "" @@ -118,7 +118,8 @@ export default function Request(options: RequestOption): Promise { header: { "Content-Type": options.xml ? "text/xml" : 'application/json' }, - extraData: options.xml ? options.data : JSON.stringify(options.data) + extraData: options.xml ? options.data : JSON.stringify(options.data), + readTimeout: options.timeout || 30 * 1000 }).then(async data => { let result = options.xml ? xmlToJSON(data.result as string) : data.result let resObj: object