@be-link/pos-cli-nodejs 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/JMeter.yml +92 -0
- package/.husky/commit-msg +4 -0
- package/.versionrc +22 -0
- package/CHANGELOG.md +584 -0
- package/Makefile +4 -0
- package/ceshi.jmx +326 -0
- package/ci/index.ts +73 -0
- package/commitlint.config.js +3 -0
- package/dist/README.md +40 -0
- package/dist/package.json +53 -0
- package/{pos → dist/pos}/http.js +3 -2
- package/{pos → dist/pos}/modules/orderFulfill/service.d.ts +1 -0
- package/{pos → dist/pos}/modules/orderFulfill/service.js +3 -0
- package/{pos → dist/pos}/modules/orderFulfill/types.d.ts +14 -0
- package/{types.d.ts → dist/types.d.ts} +5 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +71 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1383 -0
- package/docs/classes/_internal_.OrderCoreService.html +351 -0
- package/docs/classes/_internal_.OrderFulfillService.html +489 -0
- package/docs/classes/_internal_.OrderJobService.html +229 -0
- package/docs/classes/_internal_.OrderNoteService.html +177 -0
- package/docs/classes/_internal_.QueryByCommodityService.html +311 -0
- package/docs/classes/_internal_.QueryByStoreService.html +133 -0
- package/docs/classes/_internal_.QueryByUserService.html +283 -0
- package/docs/classes/_internal_.QueryByWebService.html +133 -0
- package/docs/classes/_internal_.default.html +82 -0
- package/docs/enums/_internal_.Constants.ApplicablePeopleEnum.html +90 -0
- package/docs/enums/_internal_.Constants.ItineraryTypeEnum.html +82 -0
- package/docs/enums/_internal_.Constants.ModifyOperatorRoleEnum.html +114 -0
- package/docs/enums/_internal_.Constants.NoteStatusEnum.html +82 -0
- package/docs/enums/_internal_.Constants.NoteTypeEnum.html +106 -0
- package/docs/enums/_internal_.Constants.OperatorRoleEnum.html +114 -0
- package/docs/enums/_internal_.Constants.PayToolEnum.html +82 -0
- package/docs/enums/_internal_.Constants.PaymentTypeEnum.html +98 -0
- package/docs/enums/_internal_.Constants.PromotionTypeEnum.html +82 -0
- package/docs/enums/_internal_.Constants.PurchaseSkuStatusEnum.html +82 -0
- package/docs/enums/_internal_.Constants.ShuttleTypeEnum.html +82 -0
- package/docs/enums/_internal_.Constants.TradeOperatorRoleEnum.html +98 -0
- package/docs/enums/_internal_.Constants.TradeOrderStatusEnum.html +146 -0
- package/docs/enums/_internal_.Constants.TransportationTypeEnum.html +114 -0
- package/docs/enums/_internal_.QueryDataBlock.html +121 -0
- package/docs/index.html +68 -0
- package/docs/interfaces/_internal_.Content.html +81 -0
- package/docs/interfaces/_internal_.CostInclusionJson.html +81 -0
- package/docs/interfaces/_internal_.CouponSnapShotInfo.html +133 -0
- package/docs/interfaces/_internal_.CreditInfo.html +73 -0
- package/docs/interfaces/_internal_.IPositiveAttributes.html +161 -0
- package/docs/interfaces/_internal_.IPositiveChangeSkuRecord.html +145 -0
- package/docs/interfaces/_internal_.IPositiveItemInfo.html +413 -0
- package/docs/interfaces/_internal_.IPositiveOrder.html +263 -0
- package/docs/interfaces/_internal_.IPositivePaymentInfo.html +153 -0
- package/docs/interfaces/_internal_.IPositivePromotionInfo.html +129 -0
- package/docs/interfaces/_internal_.IPositiveSkuInfo.html +332 -0
- package/docs/interfaces/_internal_.IWxPaymentInfo.html +95 -0
- package/docs/interfaces/_internal_.ItinerarySchedule.html +89 -0
- package/docs/interfaces/_internal_.OrderCoreController.html +321 -0
- package/docs/interfaces/_internal_.OrderJobController.html +201 -0
- package/docs/interfaces/_internal_.OrderNoteController.html +156 -0
- package/docs/interfaces/_internal_.ProductDetail.html +81 -0
- package/docs/interfaces/_internal_.PurchasingInstruction.html +81 -0
- package/docs/interfaces/_internal_.QueryByCommodityController.html +284 -0
- package/docs/interfaces/_internal_.QueryByStoreController.html +115 -0
- package/docs/interfaces/_internal_.QueryByUserController.html +258 -0
- package/docs/interfaces/_internal_.QueryByWebController.html +115 -0
- package/docs/interfaces/_internal_.QueryDataBlockTypeMap.html +125 -0
- package/docs/interfaces/_internal_.SubContent.html +81 -0
- package/docs/interfaces/_internal_.addShuttleInfo.html +129 -0
- package/docs/interfaces/_internal_.aiBuildNoteInfo.html +73 -0
- package/docs/interfaces/_internal_.batchUpsertItineraryInfo.html +202 -0
- package/docs/interfaces/_internal_.bindTouristToOrder.html +97 -0
- package/docs/interfaces/_internal_.calculateUserConsumeInfo.html +89 -0
- package/docs/interfaces/_internal_.changeNoteStatus.html +97 -0
- package/docs/interfaces/_internal_.changeOrderContactInfo.html +97 -0
- package/docs/interfaces/_internal_.changeOrderSku.html +105 -0
- package/docs/interfaces/_internal_.confirmMealInfo.html +81 -0
- package/docs/interfaces/_internal_.createNote.html +105 -0
- package/docs/interfaces/_internal_.createScheduleNotice.html +89 -0
- package/docs/interfaces/_internal_.getItineraryCount.html +73 -0
- package/docs/interfaces/_internal_.getOrderById.html +86 -0
- package/docs/interfaces/_internal_.getOrderCount.html +193 -0
- package/docs/interfaces/_internal_.getPartyOrderCount.html +97 -0
- package/docs/interfaces/_internal_.getStoreOrderCount.html +121 -0
- package/docs/interfaces/_internal_.getTourismInfoByOrderId-1.html +229 -0
- package/docs/interfaces/_internal_.getTourismInfoByOrderId.html +73 -0
- package/docs/interfaces/_internal_.getUserOrderCount.html +97 -0
- package/docs/interfaces/_internal_.importPreCheck.html +112 -0
- package/docs/interfaces/_internal_.isOrderCanAddTourists.html +73 -0
- package/docs/interfaces/_internal_.markItineraryRead.html +81 -0
- package/docs/interfaces/_internal_.markOrderPurchaseInsurance.html +73 -0
- package/docs/interfaces/_internal_.markServiceNoticeAuth.html +73 -0
- package/docs/interfaces/_internal_.markServiceNoticeRead.html +81 -0
- package/docs/interfaces/_internal_.mgetUserOrderCountList-1.html +54 -0
- package/docs/interfaces/_internal_.mgetUserOrderCountList.html +81 -0
- package/docs/interfaces/_internal_.modifyOrderMealInfo.html +81 -0
- package/docs/interfaces/_internal_.multiSendSmsToTourist.html +81 -0
- package/docs/interfaces/_internal_.multiSendVoiceToTourist.html +81 -0
- package/docs/interfaces/_internal_.orderCreate-1.html +122 -0
- package/docs/interfaces/_internal_.orderCreate.html +208 -0
- package/docs/interfaces/_internal_.orderFulfillController.html +452 -0
- package/docs/interfaces/_internal_.orderPaid.html +97 -0
- package/docs/interfaces/_internal_.orderSettled.html +89 -0
- package/docs/interfaces/_internal_.platformReject.html +97 -0
- package/docs/interfaces/_internal_.preCheckTourists.html +89 -0
- package/docs/interfaces/_internal_.queryItineraryInfoByOrderIdList-1.html +54 -0
- package/docs/interfaces/_internal_.queryItineraryInfoByOrderIdList.html +65 -0
- package/docs/interfaces/_internal_.queryItineraryList-1.html +81 -0
- package/docs/interfaces/_internal_.queryItineraryList.html +89 -0
- package/docs/interfaces/_internal_.queryNoteByOrderIdList.html +73 -0
- package/docs/interfaces/_internal_.queryOrder.html +102 -0
- package/docs/interfaces/_internal_.queryOrderByIdList.html +86 -0
- package/docs/interfaces/_internal_.queryOrderBySkuIdList.html +94 -0
- package/docs/interfaces/_internal_.queryOrderChangeSkuRecords.html +73 -0
- package/docs/interfaces/_internal_.queryOrderList.html +210 -0
- package/docs/interfaces/_internal_.queryOrderMergeRecordByOrderId-1.html +123 -0
- package/docs/interfaces/_internal_.queryOrderMergeRecordByOrderId.html +73 -0
- package/docs/interfaces/_internal_.queryPartyOrderInfo-1.html +81 -0
- package/docs/interfaces/_internal_.queryPartyOrderInfo.html +113 -0
- package/docs/interfaces/_internal_.queryPeriodTradeOrderList-1.html +89 -0
- package/docs/interfaces/_internal_.queryPeriodTradeOrderList.html +51 -0
- package/docs/interfaces/_internal_.queryPeriodTradeOrderOperatorList-1.html +137 -0
- package/docs/interfaces/_internal_.queryPeriodTradeOrderOperatorList.html +89 -0
- package/docs/interfaces/_internal_.queryRollingSalesStatistics-1.html +113 -0
- package/docs/interfaces/_internal_.queryRollingSalesStatistics.html +129 -0
- package/docs/interfaces/_internal_.querySaleItem-1.html +81 -0
- package/docs/interfaces/_internal_.querySaleItem.html +105 -0
- package/docs/interfaces/_internal_.queryShuttleInfoByOrderId-1.html +169 -0
- package/docs/interfaces/_internal_.queryShuttleInfoByOrderId.html +73 -0
- package/docs/interfaces/_internal_.queryStoreOrderList.html +165 -0
- package/docs/interfaces/_internal_.querySubOrderListByRootOrderId.html +94 -0
- package/docs/interfaces/_internal_.queryTopSaleItem-1.html +81 -0
- package/docs/interfaces/_internal_.queryTopSaleItem.html +97 -0
- package/docs/interfaces/_internal_.queryTourismInfoInOrderIdList.html +73 -0
- package/docs/interfaces/_internal_.queryUnionIdListByTimeRange.html +89 -0
- package/docs/interfaces/_internal_.queryUserOrder.html +153 -0
- package/docs/interfaces/_internal_.sendOrderPaidNotification.html +73 -0
- package/docs/interfaces/_internal_.submittedToSupplier.html +89 -0
- package/docs/interfaces/_internal_.supplierConfirmed.html +89 -0
- package/docs/interfaces/_internal_.supplierRejected.html +97 -0
- package/docs/interfaces/_internal_.thirdOrderInfoConfirmed.html +105 -0
- package/docs/interfaces/_internal_.updateShuttleInfo.html +129 -0
- package/docs/interfaces/_internal_.updateTradeOrderRoomCount.html +94 -0
- package/docs/interfaces/_internal_.updateTradeOrderTouristsInfo.html +139 -0
- package/docs/modules/_internal_.Constants.html +71 -0
- package/docs/modules/_internal_.html +180 -0
- package/docs/modules.html +62 -0
- package/docs/types/_internal_.QueryDataRes.html +56 -0
- package/docs/types/_internal_.Record.html +58 -0
- package/docs/types/_internal_.importPreCheck-1.html +66 -0
- package/docs/types/_internal_.queryNoteByOrderIdList-1.html +106 -0
- package/docs/types/_internal_.queryTourismInfoInOrderIdList-1.html +48 -0
- package/docs/variables/PosConstants.html +50 -0
- package/docs/variables/orderCoreService.html +47 -0
- package/docs/variables/orderFulfillService.html +47 -0
- package/docs/variables/orderJobService.html +47 -0
- package/docs/variables/orderNoteService.html +47 -0
- package/docs/variables/queryByCommodityService.html +47 -0
- package/docs/variables/queryByStoreService.html +47 -0
- package/docs/variables/queryByUserService.html +47 -0
- package/docs/variables/queryByWebService.html +47 -0
- package/jest.config.js +194 -0
- package/package.json +1 -1
- package/src/errors/BizError.ts +10 -0
- package/src/errors/SystemError.ts +10 -0
- package/src/index.ts +33 -0
- package/src/pos/http.ts +70 -0
- package/src/pos/modules/dataMigrate/service.ts +18 -0
- package/src/pos/modules/dataMigrate/types.ts +11 -0
- package/src/pos/modules/orderCore/service.ts +55 -0
- package/src/pos/modules/orderCore/types.ts +320 -0
- package/src/pos/modules/orderFulfill/service.ts +120 -0
- package/src/pos/modules/orderFulfill/types.ts +526 -0
- package/src/pos/modules/orderJob/service.ts +72 -0
- package/src/pos/modules/orderJob/types.ts +42 -0
- package/src/pos/modules/orderNote/service.ts +29 -0
- package/src/pos/modules/orderNote/types.ts +76 -0
- package/src/pos/modules/orderQuery/commodity.ts +59 -0
- package/src/pos/modules/orderQuery/store.ts +24 -0
- package/src/pos/modules/orderQuery/supplier.ts +34 -0
- package/src/pos/modules/orderQuery/types.ts +1124 -0
- package/src/pos/modules/orderQuery/user.ts +83 -0
- package/src/pos/modules/orderQuery/web.ts +26 -0
- package/src/pos/modules/service.ts +31 -0
- package/src/types.ts +1079 -0
- package/src/utils/env.ts +14 -0
- package/src/utils/string.ts +6 -0
- package/tsconfig.json +114 -0
- package/typedoc.json +15 -0
- /package/{errors → dist/errors}/BizError.d.ts +0 -0
- /package/{errors → dist/errors}/BizError.js +0 -0
- /package/{errors → dist/errors}/SystemError.d.ts +0 -0
- /package/{errors → dist/errors}/SystemError.js +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{pos → dist/pos}/http.d.ts +0 -0
- /package/{pos → dist/pos}/modules/dataMigrate/service.d.ts +0 -0
- /package/{pos → dist/pos}/modules/dataMigrate/service.js +0 -0
- /package/{pos → dist/pos}/modules/dataMigrate/types.d.ts +0 -0
- /package/{pos → dist/pos}/modules/dataMigrate/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderCore/service.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderCore/service.js +0 -0
- /package/{pos → dist/pos}/modules/orderCore/types.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderCore/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderFulfill/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderJob/service.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderJob/service.js +0 -0
- /package/{pos → dist/pos}/modules/orderJob/types.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderJob/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderNote/service.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderNote/service.js +0 -0
- /package/{pos → dist/pos}/modules/orderNote/types.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderNote/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/commodity.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/commodity.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/store.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/store.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/supplier.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/supplier.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/types.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/types.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/user.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/user.js +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/web.d.ts +0 -0
- /package/{pos → dist/pos}/modules/orderQuery/web.js +0 -0
- /package/{pos → dist/pos}/modules/service.d.ts +0 -0
- /package/{pos → dist/pos}/modules/service.js +0 -0
- /package/{types.js → dist/types.js} +0 -0
- /package/{utils → dist/utils}/env.d.ts +0 -0
- /package/{utils → dist/utils}/env.js +0 -0
- /package/{utils → dist/utils}/string.d.ts +0 -0
- /package/{utils → dist/utils}/string.js +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import BaseService from '../service'
|
|
2
|
+
import { Service } from './types'
|
|
3
|
+
import { callApi } from '../../http'
|
|
4
|
+
import * as DTO from '../../../types'
|
|
5
|
+
|
|
6
|
+
class QueryByUserService extends BaseService implements Service.QueryByUserController {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
protected prefixUrl = '/query/user'
|
|
11
|
+
listOrderInvoiceCount(request: Service.Request.getOrderInvoiceRequest): Promise<number> {
|
|
12
|
+
return callApi<Service.QueryByUserController['listOrderInvoiceCount']>(this.getApiUrl(this.listOrderInvoiceCount), request)
|
|
13
|
+
}
|
|
14
|
+
listOrderInvoice(request: Service.Request.getOrderInvoiceRequest): Promise<DTO.IPositiveOrderInvoice[]> {
|
|
15
|
+
return callApi<Service.QueryByUserController['listOrderInvoice']>(this.getApiUrl(this.listOrderInvoice), request)
|
|
16
|
+
}
|
|
17
|
+
getOrderInvoiceByOrderId(request: any): Promise<DTO.IPositiveOrderInvoice> {
|
|
18
|
+
return callApi<Service.QueryByUserController['getOrderInvoiceByOrderId']>(this.getApiUrl(this.getOrderInvoiceByOrderId), request)
|
|
19
|
+
}
|
|
20
|
+
getOrderInvoiceByInvoiceId(request: any): Promise<DTO.IPositiveOrderInvoice>{
|
|
21
|
+
return callApi<Service.QueryByUserController['getOrderInvoiceByInvoiceId']>(this.getApiUrl(this.getOrderInvoiceByInvoiceId), request)
|
|
22
|
+
}
|
|
23
|
+
getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(
|
|
24
|
+
request: Service.Request.getOrderById<K>
|
|
25
|
+
): Promise<DTO.QueryDataRes<K>> {
|
|
26
|
+
return callApi<Service.QueryByUserController['getOrderById']>(this.getApiUrl(this.getOrderById), request)
|
|
27
|
+
}
|
|
28
|
+
queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(
|
|
29
|
+
request: Service.Request.queryOrderByIdList<K>
|
|
30
|
+
): Promise<DTO.QueryDataRes<K>[]> {
|
|
31
|
+
return callApi<Service.QueryByUserController['queryOrderByIdList']>(
|
|
32
|
+
this.getApiUrl(this.queryOrderByIdList),
|
|
33
|
+
request
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(
|
|
37
|
+
request: Service.Request.queryUserOrder<K>
|
|
38
|
+
): Promise<DTO.QueryDataRes<K>[]> {
|
|
39
|
+
return callApi<Service.QueryByUserController['queryUserOrder']>(this.getApiUrl(this.queryUserOrder), request)
|
|
40
|
+
}
|
|
41
|
+
getUserOrderCount(request: Service.Request.getUserOrderCount): Promise<number> {
|
|
42
|
+
return callApi<Service.QueryByUserController['getUserOrderCount']>(this.getApiUrl(this.getUserOrderCount), request)
|
|
43
|
+
}
|
|
44
|
+
mgetUserOrderCountList(
|
|
45
|
+
request: Service.Request.mgetUserOrderCountList
|
|
46
|
+
): Promise<Service.Response.mgetUserOrderCountList> {
|
|
47
|
+
return callApi<Service.QueryByUserController['mgetUserOrderCountList']>(
|
|
48
|
+
this.getApiUrl(this.mgetUserOrderCountList),
|
|
49
|
+
request
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
querySubOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(
|
|
53
|
+
request: Service.Request.querySubOrderList<K>
|
|
54
|
+
): Promise<DTO.QueryDataRes<K>[]> {
|
|
55
|
+
return callApi<Service.QueryByUserController['querySubOrderList']>(this.getApiUrl(this.querySubOrderList), request)
|
|
56
|
+
}
|
|
57
|
+
calculateUserConsumeInfo(
|
|
58
|
+
request: Service.Request.calculateUserConsumeInfo
|
|
59
|
+
): Promise<Service.Response.calculateUserConsumeInfo> {
|
|
60
|
+
return callApi<Service.QueryByUserController['calculateUserConsumeInfo']>(
|
|
61
|
+
this.getApiUrl(this.calculateUserConsumeInfo),
|
|
62
|
+
request
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
queryUnionIdListByTimeRange(request: Service.Request.queryUnionIdListByTimeRange): Promise<string[]> {
|
|
66
|
+
return callApi<Service.QueryByUserController['queryUnionIdListByTimeRange']>(
|
|
67
|
+
this.getApiUrl(this.queryUnionIdListByTimeRange),
|
|
68
|
+
request
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
queryOrderMergeRecordByOrderId(
|
|
72
|
+
request: Service.Request.queryOrderMergeRecordByOrderId
|
|
73
|
+
): Promise<Service.Response.queryOrderMergeRecordByOrderId[]> {
|
|
74
|
+
return callApi<Service.QueryByUserController['queryOrderMergeRecordByOrderId']>(
|
|
75
|
+
this.getApiUrl(this.queryOrderMergeRecordByOrderId),
|
|
76
|
+
request
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const queryByUserService = new QueryByUserService()
|
|
82
|
+
|
|
83
|
+
export default queryByUserService
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import BaseService from '../service'
|
|
2
|
+
import { Service } from './types'
|
|
3
|
+
import { callApi } from '../../http'
|
|
4
|
+
import * as DTO from '../../../types'
|
|
5
|
+
|
|
6
|
+
class QueryByWebService extends BaseService implements Service.QueryByWebController {
|
|
7
|
+
protected prefixUrl = '/query/web'
|
|
8
|
+
|
|
9
|
+
queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderList<K>): Promise<DTO.QueryDataRes<K>[]> {
|
|
10
|
+
return callApi<Service.QueryByWebController['queryOrderList']>(this.getApiUrl(this.queryOrderList), request)
|
|
11
|
+
}
|
|
12
|
+
getOrderCount(request: Service.Request.getOrderCount): Promise<number> {
|
|
13
|
+
return callApi<Service.QueryByWebController['getOrderCount']>(this.getApiUrl(this.getOrderCount), request)
|
|
14
|
+
}
|
|
15
|
+
queryOrderOperateRecord(request: Service.Request.IQueryOrderOperateRecord): Promise<DTO.IOrderOperatorRecord[]> {
|
|
16
|
+
return callApi<Service.QueryByWebController['queryOrderOperateRecord']>(this.getApiUrl(this.queryOrderOperateRecord), request)
|
|
17
|
+
}
|
|
18
|
+
queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryOrderForStatistics<K>): Promise<DTO.QueryDataRes<K>[]> {
|
|
19
|
+
return callApi<Service.QueryByWebController['queryOrderForStatistics']>(this.getApiUrl(this.queryOrderForStatistics), request)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const queryByWebService = new QueryByWebService()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export default queryByWebService
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import envUtils from '../../utils/env'
|
|
2
|
+
import { camelToKebabCase } from '../../utils/string'
|
|
3
|
+
|
|
4
|
+
export default abstract class BaseService {
|
|
5
|
+
private isPublicEnv: boolean
|
|
6
|
+
/** URL一级路径 */
|
|
7
|
+
protected abstract prefixUrl: string
|
|
8
|
+
/** 子网域名 */
|
|
9
|
+
protected readonly natDevHost = 'http://qgostaxv.pos-app.nmkh74o4.rlwzae9d.com:8090'
|
|
10
|
+
protected readonly natProdHost = 'http://bxbvjnca.pos-app.cwl9ok0a.mk2u3r3l.com:8090'
|
|
11
|
+
/** 公网域名 */
|
|
12
|
+
protected readonly publicDevHost = 'https://pos-app-74680-5-1304510571.sh.run.tcloudbase.com'
|
|
13
|
+
protected readonly publicProdHost = 'https://pos-app-60660-10-1304510571.sh.run.tcloudbase.com'
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
/** 如果是云函数环境, 默认走公网访问 */
|
|
17
|
+
this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SCF'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** 获取API URL */
|
|
21
|
+
protected getApiUrl(func: Function): string {
|
|
22
|
+
const host = this.isPublicEnv
|
|
23
|
+
? envUtils.isProduction()
|
|
24
|
+
? this.publicProdHost
|
|
25
|
+
: this.publicDevHost
|
|
26
|
+
: envUtils.isProduction()
|
|
27
|
+
? this.natProdHost
|
|
28
|
+
: this.natDevHost
|
|
29
|
+
return `${host}${this.prefixUrl}/${camelToKebabCase(func.name)}`
|
|
30
|
+
}
|
|
31
|
+
}
|