feat(api): 新增预拉取订单和设置接口模块

- 添加 jdv2-prefetch-api,支持获取预拉取订单日志及订单列表
- 添加 jdv2-settings-api,支持获取及更新骆驼模块设置
- 更新生成的 API 文件列表,包含新增接口及相关模型和文档
- 修改本地设置文件,增加 prettier 格式化相关命令支持
This commit is contained in:
danial
2025-12-05 22:13:07 +08:00
parent 246ff9f34e
commit 6d25b11074
34 changed files with 2960 additions and 41 deletions

View File

@@ -12,7 +12,8 @@
"Bash(mkdir:*)",
"Bash(pnpm build)",
"Bash(pnpm eslint:fix)",
"Bash(pnpm eslint:fix:*)"
"Bash(pnpm eslint:fix:*)",
"Bash(pnpm prettier:fix:*)"
],
"deny": [],
"ask": []

View File

@@ -7,6 +7,8 @@ apis/jdhistory-api.ts
apis/jdorder-management-api.ts
apis/jdv2-account-api.ts
apis/jdv2-order-api.ts
apis/jdv2-prefetch-api.ts
apis/jdv2-settings-api.ts
apis/jdv2-token-management-api.ts
apis/totpapi.ts
base.ts
@@ -18,6 +20,8 @@ docs/JDHistoryApi.md
docs/JDOrderManagementApi.md
docs/JDV2AccountApi.md
docs/JDV2OrderApi.md
docs/JDV2PrefetchApi.md
docs/JDV2SettingsApi.md
docs/JDV2TokenManagementApi.md
docs/KamiApiCamelOilV1AccountHistoryItem.md
docs/KamiApiCamelOilV1AccountHistoryReq.md
@@ -40,6 +44,10 @@ docs/KamiApiCamelOilV1CreateTokenReq.md
docs/KamiApiCamelOilV1CreateTokenRes.md
docs/KamiApiCamelOilV1DeleteTokenReq.md
docs/KamiApiCamelOilV1DeleteTokenRes.md
docs/KamiApiCamelOilV1DenominationSetting.md
docs/KamiApiCamelOilV1GetPrefetchOrderLogsReq.md
docs/KamiApiCamelOilV1GetPrefetchOrderLogsRes.md
docs/KamiApiCamelOilV1GetSettingsRes.md
docs/KamiApiCamelOilV1GetTokenReq.md
docs/KamiApiCamelOilV1GetTokenRes.md
docs/KamiApiCamelOilV1ListAccountReq.md
@@ -48,6 +56,8 @@ docs/KamiApiCamelOilV1ListCardBindingsByTokenReq.md
docs/KamiApiCamelOilV1ListCardBindingsByTokenRes.md
docs/KamiApiCamelOilV1ListOrderReq.md
docs/KamiApiCamelOilV1ListOrderRes.md
docs/KamiApiCamelOilV1ListPrefetchOrderReq.md
docs/KamiApiCamelOilV1ListPrefetchOrderRes.md
docs/KamiApiCamelOilV1ListTokensReq.md
docs/KamiApiCamelOilV1ListTokensRes.md
docs/KamiApiCamelOilV1OrderCallbackReq.md
@@ -60,9 +70,12 @@ docs/KamiApiCamelOilV1OrderHistoryItem.md
docs/KamiApiCamelOilV1OrderHistoryReq.md
docs/KamiApiCamelOilV1OrderHistoryRes.md
docs/KamiApiCamelOilV1OrderListItem.md
docs/KamiApiCamelOilV1PrefetchOrderListItem.md
docs/KamiApiCamelOilV1PrefetchOrderLogItem.md
docs/KamiApiCamelOilV1SubmitOrderReq.md
docs/KamiApiCamelOilV1SubmitOrderRes.md
docs/KamiApiCamelOilV1TokenInfo.md
docs/KamiApiCamelOilV1UpdateSettingsReq.md
docs/KamiApiCamelOilV1UpdateTokenReq.md
docs/KamiApiCamelOilV1UpdateTokenRes.md
docs/KamiApiCardInfoAppleV1AppleCardListRecord.md
@@ -473,6 +486,10 @@ models/kami-api-camel-oil-v1-create-token-req.ts
models/kami-api-camel-oil-v1-create-token-res.ts
models/kami-api-camel-oil-v1-delete-token-req.ts
models/kami-api-camel-oil-v1-delete-token-res.ts
models/kami-api-camel-oil-v1-denomination-setting.ts
models/kami-api-camel-oil-v1-get-prefetch-order-logs-req.ts
models/kami-api-camel-oil-v1-get-prefetch-order-logs-res.ts
models/kami-api-camel-oil-v1-get-settings-res.ts
models/kami-api-camel-oil-v1-get-token-req.ts
models/kami-api-camel-oil-v1-get-token-res.ts
models/kami-api-camel-oil-v1-list-account-req.ts
@@ -481,6 +498,8 @@ models/kami-api-camel-oil-v1-list-card-bindings-by-token-req.ts
models/kami-api-camel-oil-v1-list-card-bindings-by-token-res.ts
models/kami-api-camel-oil-v1-list-order-req.ts
models/kami-api-camel-oil-v1-list-order-res.ts
models/kami-api-camel-oil-v1-list-prefetch-order-req.ts
models/kami-api-camel-oil-v1-list-prefetch-order-res.ts
models/kami-api-camel-oil-v1-list-tokens-req.ts
models/kami-api-camel-oil-v1-list-tokens-res.ts
models/kami-api-camel-oil-v1-order-callback-req.ts
@@ -493,9 +512,12 @@ models/kami-api-camel-oil-v1-order-history-item.ts
models/kami-api-camel-oil-v1-order-history-req.ts
models/kami-api-camel-oil-v1-order-history-res.ts
models/kami-api-camel-oil-v1-order-list-item.ts
models/kami-api-camel-oil-v1-prefetch-order-list-item.ts
models/kami-api-camel-oil-v1-prefetch-order-log-item.ts
models/kami-api-camel-oil-v1-submit-order-req.ts
models/kami-api-camel-oil-v1-submit-order-res.ts
models/kami-api-camel-oil-v1-token-info.ts
models/kami-api-camel-oil-v1-update-settings-req.ts
models/kami-api-camel-oil-v1-update-token-req.ts
models/kami-api-camel-oil-v1-update-token-res.ts
models/kami-api-card-info-apple-v1-apple-card-list-record-upload-user.ts

View File

@@ -18,5 +18,7 @@ export * from './apis/jdhistory-api';
export * from './apis/jdorder-management-api';
export * from './apis/jdv2-account-api';
export * from './apis/jdv2-order-api';
export * from './apis/jdv2-prefetch-api';
export * from './apis/jdv2-settings-api';
export * from './apis/jdv2-token-management-api';
export * from './apis/totpapi';

View File

@@ -0,0 +1,516 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction
} from '../common';
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
type RequestArgs,
BaseAPI,
RequiredError,
operationServerMap
} from '../base';
// @ts-ignore
import type { KamiApiCamelOilV1GetPrefetchOrderLogsRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1ListPrefetchOrderRes } from '../models';
/**
* JDV2PrefetchApi - axios parameter creator
*/
export const JDV2PrefetchApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
*
* @summary 获取预拉取订单日志
* @param {string} startTime 开始时间
* @param {string} endTime 结束时间
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchLogsGet: async (
startTime: string,
endTime: string,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'startTime' is not null or undefined
assertParamExists('apiJdV2PrefetchLogsGet', 'startTime', startTime);
// verify required parameter 'endTime' is not null or undefined
assertParamExists('apiJdV2PrefetchLogsGet', 'endTime', endTime);
const localVarPath = `/api/jd-v2/prefetch/logs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: 'GET',
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (startTime !== undefined) {
localVarQueryParameter['startTime'] = startTime;
}
if (endTime !== undefined) {
localVarQueryParameter['endTime'] = endTime;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
*
* @summary 获取预拉取订单列表
* @param {number} current 页数
* @param {ApiJdV2PrefetchOrdersGetPageSizeEnum} pageSize 页码
* @param {number} [accountId] 账号ID
* @param {string} [accountName] 账号名称
* @param {number} [amount] 订单金额
* @param {string} [platformOrderNo] 平台订单号
* @param {ApiJdV2PrefetchOrdersGetStatusEnum} [status] 状态1待匹配 2已匹配 3已过期 4已失效
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchOrdersGet: async (
current: number,
pageSize: ApiJdV2PrefetchOrdersGetPageSizeEnum,
accountId?: number,
accountName?: string,
amount?: number,
platformOrderNo?: string,
status?: ApiJdV2PrefetchOrdersGetStatusEnum,
dateRange?: Array<string>,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'current' is not null or undefined
assertParamExists('apiJdV2PrefetchOrdersGet', 'current', current);
// verify required parameter 'pageSize' is not null or undefined
assertParamExists('apiJdV2PrefetchOrdersGet', 'pageSize', pageSize);
const localVarPath = `/api/jd-v2/prefetch/orders`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: 'GET',
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (current !== undefined) {
localVarQueryParameter['current'] = current;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (accountId !== undefined) {
localVarQueryParameter['accountId'] = accountId;
}
if (accountName !== undefined) {
localVarQueryParameter['accountName'] = accountName;
}
if (amount !== undefined) {
localVarQueryParameter['amount'] = amount;
}
if (platformOrderNo !== undefined) {
localVarQueryParameter['platformOrderNo'] = platformOrderNo;
}
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
if (dateRange) {
localVarQueryParameter['dateRange'] = dateRange;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
}
};
};
/**
* JDV2PrefetchApi - functional programming interface
*/
export const JDV2PrefetchApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator =
JDV2PrefetchApiAxiosParamCreator(configuration);
return {
/**
*
* @summary 获取预拉取订单日志
* @param {string} startTime 开始时间
* @param {string} endTime 结束时间
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiJdV2PrefetchLogsGet(
startTime: string,
endTime: string,
options?: RawAxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<KamiApiCamelOilV1GetPrefetchOrderLogsRes>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.apiJdV2PrefetchLogsGet(
startTime,
endTime,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['JDV2PrefetchApi.apiJdV2PrefetchLogsGet']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary 获取预拉取订单列表
* @param {number} current 页数
* @param {ApiJdV2PrefetchOrdersGetPageSizeEnum} pageSize 页码
* @param {number} [accountId] 账号ID
* @param {string} [accountName] 账号名称
* @param {number} [amount] 订单金额
* @param {string} [platformOrderNo] 平台订单号
* @param {ApiJdV2PrefetchOrdersGetStatusEnum} [status] 状态1待匹配 2已匹配 3已过期 4已失效
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiJdV2PrefetchOrdersGet(
current: number,
pageSize: ApiJdV2PrefetchOrdersGetPageSizeEnum,
accountId?: number,
accountName?: string,
amount?: number,
platformOrderNo?: string,
status?: ApiJdV2PrefetchOrdersGetStatusEnum,
dateRange?: Array<string>,
options?: RawAxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<KamiApiCamelOilV1ListPrefetchOrderRes>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.apiJdV2PrefetchOrdersGet(
current,
pageSize,
accountId,
accountName,
amount,
platformOrderNo,
status,
dateRange,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['JDV2PrefetchApi.apiJdV2PrefetchOrdersGet']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
}
};
};
/**
* JDV2PrefetchApi - factory interface
*/
export const JDV2PrefetchApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = JDV2PrefetchApiFp(configuration);
return {
/**
*
* @summary 获取预拉取订单日志
* @param {JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchLogsGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest,
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1GetPrefetchOrderLogsRes> {
return localVarFp
.apiJdV2PrefetchLogsGet(
requestParameters.startTime,
requestParameters.endTime,
options
)
.then(request => request(axios, basePath));
},
/**
*
* @summary 获取预拉取订单列表
* @param {JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchOrdersGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest,
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1ListPrefetchOrderRes> {
return localVarFp
.apiJdV2PrefetchOrdersGet(
requestParameters.current,
requestParameters.pageSize,
requestParameters.accountId,
requestParameters.accountName,
requestParameters.amount,
requestParameters.platformOrderNo,
requestParameters.status,
requestParameters.dateRange,
options
)
.then(request => request(axios, basePath));
}
};
};
/**
* JDV2PrefetchApi - interface
*/
export interface JDV2PrefetchApiInterface {
/**
*
* @summary 获取预拉取订单日志
* @param {JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchLogsGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest,
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1GetPrefetchOrderLogsRes>;
/**
*
* @summary 获取预拉取订单列表
* @param {JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2PrefetchOrdersGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest,
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1ListPrefetchOrderRes>;
}
/**
* Request parameters for apiJdV2PrefetchLogsGet operation in JDV2PrefetchApi.
*/
export interface JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest {
/**
* 开始时间
*/
readonly startTime: string;
/**
* 结束时间
*/
readonly endTime: string;
}
/**
* Request parameters for apiJdV2PrefetchOrdersGet operation in JDV2PrefetchApi.
*/
export interface JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest {
/**
* 页数
*/
readonly current: number;
/**
* 页码
*/
readonly pageSize: ApiJdV2PrefetchOrdersGetPageSizeEnum;
/**
* 账号ID
*/
readonly accountId?: number;
/**
* 账号名称
*/
readonly accountName?: string;
/**
* 订单金额
*/
readonly amount?: number;
/**
* 平台订单号
*/
readonly platformOrderNo?: string;
/**
* 状态1待匹配 2已匹配 3已过期 4已失效
*/
readonly status?: ApiJdV2PrefetchOrdersGetStatusEnum;
/**
* 时间范围
*/
readonly dateRange?: Array<string>;
}
/**
* JDV2PrefetchApi - object-oriented interface
*/
export class JDV2PrefetchApi
extends BaseAPI
implements JDV2PrefetchApiInterface
{
/**
*
* @summary 获取预拉取订单日志
* @param {JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public apiJdV2PrefetchLogsGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchLogsGetRequest,
options?: RawAxiosRequestConfig
) {
return JDV2PrefetchApiFp(this.configuration)
.apiJdV2PrefetchLogsGet(
requestParameters.startTime,
requestParameters.endTime,
options
)
.then(request => request(this.axios, this.basePath));
}
/**
*
* @summary 获取预拉取订单列表
* @param {JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public apiJdV2PrefetchOrdersGet(
requestParameters: JDV2PrefetchApiApiJdV2PrefetchOrdersGetRequest,
options?: RawAxiosRequestConfig
) {
return JDV2PrefetchApiFp(this.configuration)
.apiJdV2PrefetchOrdersGet(
requestParameters.current,
requestParameters.pageSize,
requestParameters.accountId,
requestParameters.accountName,
requestParameters.amount,
requestParameters.platformOrderNo,
requestParameters.status,
requestParameters.dateRange,
options
)
.then(request => request(this.axios, this.basePath));
}
}
export enum ApiJdV2PrefetchOrdersGetPageSizeEnum {
NUMBER_5 = 5,
NUMBER_10 = 10,
NUMBER_15 = 15,
NUMBER_20 = 20,
NUMBER_50 = 50,
NUMBER_100 = 100
}
export enum ApiJdV2PrefetchOrdersGetStatusEnum {
NUMBER_3 = 3,
NUMBER_4 = 4,
NUMBER_2 = 2,
NUMBER_1 = 1
}

View File

@@ -0,0 +1,327 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction
} from '../common';
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
type RequestArgs,
BaseAPI,
RequiredError,
operationServerMap
} from '../base';
// @ts-ignore
import type { KamiApiCamelOilV1GetSettingsRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1UpdateSettingsReq } from '../models';
/**
* JDV2SettingsApi - axios parameter creator
*/
export const JDV2SettingsApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
*
* @summary 获取骆驼模块设置
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsGetGet: async (
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/api/jd-v2/settings/get`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: 'GET',
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
*
* @summary 更新骆驼模块设置
* @param {KamiApiCamelOilV1UpdateSettingsReq} [kamiApiCamelOilV1UpdateSettingsReq]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsUpdatePost: async (
kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/api/jd-v2/settings/update`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: 'POST',
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
localVarRequestOptions.data = serializeDataIfNeeded(
kamiApiCamelOilV1UpdateSettingsReq,
localVarRequestOptions,
configuration
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
}
};
};
/**
* JDV2SettingsApi - functional programming interface
*/
export const JDV2SettingsApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator =
JDV2SettingsApiAxiosParamCreator(configuration);
return {
/**
*
* @summary 获取骆驼模块设置
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiJdV2SettingsGetGet(
options?: RawAxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<KamiApiCamelOilV1GetSettingsRes>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.apiJdV2SettingsGetGet(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['JDV2SettingsApi.apiJdV2SettingsGetGet']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary 更新骆驼模块设置
* @param {KamiApiCamelOilV1UpdateSettingsReq} [kamiApiCamelOilV1UpdateSettingsReq]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiJdV2SettingsUpdatePost(
kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq,
options?: RawAxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.apiJdV2SettingsUpdatePost(
kamiApiCamelOilV1UpdateSettingsReq,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['JDV2SettingsApi.apiJdV2SettingsUpdatePost']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
}
};
};
/**
* JDV2SettingsApi - factory interface
*/
export const JDV2SettingsApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = JDV2SettingsApiFp(configuration);
return {
/**
*
* @summary 获取骆驼模块设置
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsGetGet(
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1GetSettingsRes> {
return localVarFp
.apiJdV2SettingsGetGet(options)
.then(request => request(axios, basePath));
},
/**
*
* @summary 更新骆驼模块设置
* @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsUpdatePost(
requestParameters: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest = {},
options?: RawAxiosRequestConfig
): AxiosPromise<object> {
return localVarFp
.apiJdV2SettingsUpdatePost(
requestParameters.kamiApiCamelOilV1UpdateSettingsReq,
options
)
.then(request => request(axios, basePath));
}
};
};
/**
* JDV2SettingsApi - interface
*/
export interface JDV2SettingsApiInterface {
/**
*
* @summary 获取骆驼模块设置
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsGetGet(
options?: RawAxiosRequestConfig
): AxiosPromise<KamiApiCamelOilV1GetSettingsRes>;
/**
*
* @summary 更新骆驼模块设置
* @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiJdV2SettingsUpdatePost(
requestParameters?: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest,
options?: RawAxiosRequestConfig
): AxiosPromise<object>;
}
/**
* Request parameters for apiJdV2SettingsUpdatePost operation in JDV2SettingsApi.
*/
export interface JDV2SettingsApiApiJdV2SettingsUpdatePostRequest {
readonly kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq;
}
/**
* JDV2SettingsApi - object-oriented interface
*/
export class JDV2SettingsApi
extends BaseAPI
implements JDV2SettingsApiInterface
{
/**
*
* @summary 获取骆驼模块设置
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public apiJdV2SettingsGetGet(options?: RawAxiosRequestConfig) {
return JDV2SettingsApiFp(this.configuration)
.apiJdV2SettingsGetGet(options)
.then(request => request(this.axios, this.basePath));
}
/**
*
* @summary 更新骆驼模块设置
* @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public apiJdV2SettingsUpdatePost(
requestParameters: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest = {},
options?: RawAxiosRequestConfig
) {
return JDV2SettingsApiFp(this.configuration)
.apiJdV2SettingsUpdatePost(
requestParameters.kamiApiCamelOilV1UpdateSettingsReq,
options
)
.then(request => request(this.axios, this.basePath));
}
}

View File

@@ -0,0 +1,124 @@
# JDV2PrefetchApi
All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| --------------------------------------------------------- | ---------------------------------- | ------------------ |
| [**apiJdV2PrefetchLogsGet**](#apijdv2prefetchlogsget) | **GET** /api/jd-v2/prefetch/logs | 获取预拉取订单日志 |
| [**apiJdV2PrefetchOrdersGet**](#apijdv2prefetchordersget) | **GET** /api/jd-v2/prefetch/orders | 获取预拉取订单列表 |
# **apiJdV2PrefetchLogsGet**
> KamiApiCamelOilV1GetPrefetchOrderLogsRes apiJdV2PrefetchLogsGet()
### Example
```typescript
import { JDV2PrefetchApi, Configuration } from './api';
const configuration = new Configuration();
const apiInstance = new JDV2PrefetchApi(configuration);
let startTime: string; //开始时间 (default to undefined)
let endTime: string; //结束时间 (default to undefined)
const { status, data } = await apiInstance.apiJdV2PrefetchLogsGet(
startTime,
endTime
);
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------ | ----------- | --------------------- |
| **startTime** | [**string**] | 开始时间 | defaults to undefined |
| **endTime** | [**string**] | 结束时间 | defaults to undefined |
### Return type
**KamiApiCamelOilV1GetPrefetchOrderLogsRes**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **apiJdV2PrefetchOrdersGet**
> KamiApiCamelOilV1ListPrefetchOrderRes apiJdV2PrefetchOrdersGet()
### Example
```typescript
import { JDV2PrefetchApi, Configuration } from './api';
const configuration = new Configuration();
const apiInstance = new JDV2PrefetchApi(configuration);
let current: number; //页数 (default to undefined)
let pageSize: 5 | 10 | 15 | 20 | 50 | 100; //页码 (default to undefined)
let accountId: number; //账号ID (optional) (default to undefined)
let accountName: string; //账号名称 (optional) (default to undefined)
let amount: number; //订单金额 (optional) (default to undefined)
let platformOrderNo: string; //平台订单号 (optional) (default to undefined)
let status: 3 | 4 | 2 | 1; //状态1待匹配 2已匹配 3已过期 4已失效 (optional) (default to undefined)
let dateRange: Array<string>; //时间范围 (optional) (default to undefined)
const { status, data } = await apiInstance.apiJdV2PrefetchOrdersGet(
current,
pageSize,
accountId,
accountName,
amount,
platformOrderNo,
status,
dateRange
);
```
### Parameters
| Name | Type | Description | Notes |
| ------------------- | ----------------------- | ----------- | -------------------------------- | --------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------- | ---- | --------------------- |
| **current** | [**number**] | 页数 | defaults to undefined |
| **pageSize** | [\*\*5 | 10 | 15 | 20 | 50 | 100**]**Array<5 &#124; 10 &#124; 15 &#124; 20 &#124; 50 &#124; 100>\*\* | 页码 | defaults to undefined |
| **accountId** | [**number**] | 账号ID | (optional) defaults to undefined |
| **accountName** | [**string**] | 账号名称 | (optional) defaults to undefined |
| **amount** | [**number**] | 订单金额 | (optional) defaults to undefined |
| **platformOrderNo** | [**string**] | 平台订单号 | (optional) defaults to undefined |
| **status** | [\*\*3 | 4 | 2 | 1**]**Array<3 &#124; 4 &#124; 2 &#124; 1>\*\* | 状态1待匹配 2已匹配 3已过期 4已失效 | (optional) defaults to undefined |
| **dateRange** | **Array&lt;string&gt;** | 时间范围 | (optional) defaults to undefined |
### Return type
**KamiApiCamelOilV1ListPrefetchOrderRes**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,98 @@
# JDV2SettingsApi
All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| ----------------------------------------------------------- | ----------------------------------- | ---------------- |
| [**apiJdV2SettingsGetGet**](#apijdv2settingsgetget) | **GET** /api/jd-v2/settings/get | 获取骆驼模块设置 |
| [**apiJdV2SettingsUpdatePost**](#apijdv2settingsupdatepost) | **POST** /api/jd-v2/settings/update | 更新骆驼模块设置 |
# **apiJdV2SettingsGetGet**
> KamiApiCamelOilV1GetSettingsRes apiJdV2SettingsGetGet()
### Example
```typescript
import { JDV2SettingsApi, Configuration } from './api';
const configuration = new Configuration();
const apiInstance = new JDV2SettingsApi(configuration);
const { status, data } = await apiInstance.apiJdV2SettingsGetGet();
```
### Parameters
This endpoint does not have any parameters.
### Return type
**KamiApiCamelOilV1GetSettingsRes**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **apiJdV2SettingsUpdatePost**
> object apiJdV2SettingsUpdatePost()
### Example
```typescript
import {
JDV2SettingsApi,
Configuration,
KamiApiCamelOilV1UpdateSettingsReq
} from './api';
const configuration = new Configuration();
const apiInstance = new JDV2SettingsApi(configuration);
let kamiApiCamelOilV1UpdateSettingsReq: KamiApiCamelOilV1UpdateSettingsReq; // (optional)
const { status, data } = await apiInstance.apiJdV2SettingsUpdatePost(
kamiApiCamelOilV1UpdateSettingsReq
);
```
### Parameters
| Name | Type | Description | Notes |
| -------------------------------------- | -------------------------------------- | ----------- | ----- |
| **kamiApiCamelOilV1UpdateSettingsReq** | **KamiApiCamelOilV1UpdateSettingsReq** | | |
### Return type
**object**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,23 @@
# KamiApiCamelOilV1DenominationSetting
## Properties
| Name | Type | Description | Notes |
| ------------------ | ---------- | -------------------------------------------------------- | --------------------------------- |
| **denomination** | **number** | 面额值如100、200、500等 | [optional] [default to undefined] |
| **minCapacity** | **number** | 该面额预拉取订单最小库存阈值(当库存低于此值时触发补充) | [optional] [default to undefined] |
| **targetCapacity** | **number** | 该面额预拉取订单目标库存(补充时的目标数量) | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1DenominationSetting } from './api';
const instance: KamiApiCamelOilV1DenominationSetting = {
denomination,
minCapacity,
targetCapacity
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,21 @@
# KamiApiCamelOilV1GetPrefetchOrderLogsReq
## Properties
| Name | Type | Description | Notes |
| ------------- | ---------- | ----------- | ---------------------- |
| **startTime** | **string** | 开始时间 | [default to undefined] |
| **endTime** | **string** | 结束时间 | [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1GetPrefetchOrderLogsReq } from './api';
const instance: KamiApiCamelOilV1GetPrefetchOrderLogsReq = {
startTime,
endTime
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,19 @@
# KamiApiCamelOilV1GetPrefetchOrderLogsRes
## Properties
| Name | Type | Description | Notes |
| -------- | -------------------------------------------------------------------------------------------------- | ------------------ | --------------------------------- |
| **logs** | [**Array&lt;KamiApiCamelOilV1PrefetchOrderLogItem&gt;**](KamiApiCamelOilV1PrefetchOrderLogItem.md) | 预拉取订单日志列表 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1GetPrefetchOrderLogsRes } from './api';
const instance: KamiApiCamelOilV1GetPrefetchOrderLogsRes = {
logs
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,27 @@
# KamiApiCamelOilV1GetSettingsRes
## Properties
| Name | Type | Description | Notes |
| ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------ | --------------------------------- |
| **useHaozhuPlatform** | **boolean** | 是否从豪猪平台获取手机号登录 | [optional] [default to undefined] |
| **loginAccountCount** | **number** | 要登录的手机号数量 | [optional] [default to undefined] |
| **prefetchConcurrencyAccounts** | **number** | 提前拉单并发的账号数量 | [optional] [default to undefined] |
| **singleAccountConcurrency** | **number** | 单个账号的并发数量 | [optional] [default to undefined] |
| **targetDenominations** | [**Array&lt;KamiApiCamelOilV1DenominationSetting&gt;**](KamiApiCamelOilV1DenominationSetting.md) | 要获取的面额和对应库存设置列表 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1GetSettingsRes } from './api';
const instance: KamiApiCamelOilV1GetSettingsRes = {
useHaozhuPlatform,
loginAccountCount,
prefetchConcurrencyAccounts,
singleAccountConcurrency,
targetDenominations
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,33 @@
# KamiApiCamelOilV1ListPrefetchOrderReq
## Properties
| Name | Type | Description | Notes |
| ------------------- | ----------------------- | ------------------------------------- | --------------------------------- |
| **current** | **number** | 页数 | [default to undefined] |
| **pageSize** | **number** | 页码 | [default to undefined] |
| **accountId** | **number** | 账号ID | [optional] [default to undefined] |
| **accountName** | **string** | 账号名称 | [optional] [default to undefined] |
| **amount** | **number** | 订单金额 | [optional] [default to undefined] |
| **platformOrderNo** | **string** | 平台订单号 | [optional] [default to undefined] |
| **status** | **number** | 状态1待匹配 2已匹配 3已过期 4已失效 | [optional] [default to undefined] |
| **dateRange** | **Array&lt;string&gt;** | 时间范围 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1ListPrefetchOrderReq } from './api';
const instance: KamiApiCamelOilV1ListPrefetchOrderReq = {
current,
pageSize,
accountId,
accountName,
amount,
platformOrderNo,
status,
dateRange
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,21 @@
# KamiApiCamelOilV1ListPrefetchOrderRes
## Properties
| Name | Type | Description | Notes |
| --------- | ---------------------------------------------------------------------------------------------------- | ----------- | --------------------------------- |
| **total** | **number** | | [optional] [default to undefined] |
| **list** | [**Array&lt;KamiApiCamelOilV1PrefetchOrderListItem&gt;**](KamiApiCamelOilV1PrefetchOrderListItem.md) | | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1ListPrefetchOrderRes } from './api';
const instance: KamiApiCamelOilV1ListPrefetchOrderRes = {
total,
list
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,45 @@
# KamiApiCamelOilV1PrefetchOrderListItem
## Properties
| Name | Type | Description | Notes |
| ------------------- | ---------- | ----------------------------------------------- | --------------------------------- |
| **id** | **number** | 主键ID | [optional] [default to undefined] |
| **accountId** | **number** | 拉取时使用的账号ID | [optional] [default to undefined] |
| **accountName** | **string** | 账号名称 | [optional] [default to undefined] |
| **amount** | **number** | 预拉取订单金额 | [optional] [default to undefined] |
| **platformOrderNo** | **string** | 骆驼平台订单号 | [optional] [default to undefined] |
| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] |
| **status** | **number** | 预拉取订单状态1待匹配 2已匹配 3已过期 4已失效 | [optional] [default to undefined] |
| **orderNo** | **string** | 匹配后的订单号 | [optional] [default to undefined] |
| **matchedAt** | **string** | 匹配时间 | [optional] [default to undefined] |
| **expireAt** | **string** | 预拉取订单过期时间 | [optional] [default to undefined] |
| **failureReason** | **string** | 失败原因 | [optional] [default to undefined] |
| **remark** | **string** | 备注信息 | [optional] [default to undefined] |
| **createdAt** | **string** | 创建时间 | [optional] [default to undefined] |
| **updatedAt** | **string** | 更新时间 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1PrefetchOrderListItem } from './api';
const instance: KamiApiCamelOilV1PrefetchOrderListItem = {
id,
accountId,
accountName,
amount,
platformOrderNo,
alipayUrl,
status,
orderNo,
matchedAt,
expireAt,
failureReason,
remark,
createdAt,
updatedAt
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,25 @@
# KamiApiCamelOilV1PrefetchOrderLogItem
## Properties
| Name | Type | Description | Notes |
| ---------------- | ---------- | --------------- | --------------------------------- |
| **timestamp** | **string** | 请求时间戳 | [optional] [default to undefined] |
| **phone** | **string** | 手机号(脱敏) | [optional] [default to undefined] |
| **amount** | **number** | 订单面额 | [optional] [default to undefined] |
| **responseData** | **string** | API响应原始数据 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1PrefetchOrderLogItem } from './api';
const instance: KamiApiCamelOilV1PrefetchOrderLogItem = {
timestamp,
phone,
amount,
responseData
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -3,8 +3,9 @@
## Properties
| Name | Type | Description | Notes |
| ----------------------- | ---------- | -------------- | --------------------------------- |
| ----------------------- | ---------- | ------------------------------ | --------------------------------- |
| **id** | **number** | Token ID | [optional] [default to undefined] |
| **userId** | **string** | 用户ID空字符串表示管理员创建 | [optional] [default to undefined] |
| **tokenName** | **string** | Token名称 | [optional] [default to undefined] |
| **tokenValue** | **string** | Token值 | [optional] [default to undefined] |
| **phone** | **string** | 绑定的手机号 | [optional] [default to undefined] |
@@ -27,6 +28,7 @@ import { KamiApiCamelOilV1TokenInfo } from './api';
const instance: KamiApiCamelOilV1TokenInfo = {
id,
userId,
tokenName,
tokenValue,
phone,

View File

@@ -0,0 +1,27 @@
# KamiApiCamelOilV1UpdateSettingsReq
## Properties
| Name | Type | Description | Notes |
| ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------ | --------------------------------- |
| **useHaozhuPlatform** | **boolean** | 是否从豪猪平台获取手机号登录 | [optional] [default to undefined] |
| **loginAccountCount** | **number** | 要登录的手机号数量 | [optional] [default to undefined] |
| **prefetchConcurrencyAccounts** | **number** | 提前拉单并发的账号数量 | [optional] [default to undefined] |
| **singleAccountConcurrency** | **number** | 单个账号的并发数量 | [optional] [default to undefined] |
| **targetDenominations** | [**Array&lt;KamiApiCamelOilV1DenominationSetting&gt;**](KamiApiCamelOilV1DenominationSetting.md) | 要获取的面额和对应库存设置列表 | [optional] [default to undefined] |
## Example
```typescript
import { KamiApiCamelOilV1UpdateSettingsReq } from './api';
const instance: KamiApiCamelOilV1UpdateSettingsReq = {
useHaozhuPlatform,
loginAccountCount,
prefetchConcurrencyAccounts,
singleAccountConcurrency,
targetDenominations
};
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -19,6 +19,10 @@ export * from './kami-api-camel-oil-v1-create-token-req';
export * from './kami-api-camel-oil-v1-create-token-res';
export * from './kami-api-camel-oil-v1-delete-token-req';
export * from './kami-api-camel-oil-v1-delete-token-res';
export * from './kami-api-camel-oil-v1-denomination-setting';
export * from './kami-api-camel-oil-v1-get-prefetch-order-logs-req';
export * from './kami-api-camel-oil-v1-get-prefetch-order-logs-res';
export * from './kami-api-camel-oil-v1-get-settings-res';
export * from './kami-api-camel-oil-v1-get-token-req';
export * from './kami-api-camel-oil-v1-get-token-res';
export * from './kami-api-camel-oil-v1-list-account-req';
@@ -27,6 +31,8 @@ export * from './kami-api-camel-oil-v1-list-card-bindings-by-token-req';
export * from './kami-api-camel-oil-v1-list-card-bindings-by-token-res';
export * from './kami-api-camel-oil-v1-list-order-req';
export * from './kami-api-camel-oil-v1-list-order-res';
export * from './kami-api-camel-oil-v1-list-prefetch-order-req';
export * from './kami-api-camel-oil-v1-list-prefetch-order-res';
export * from './kami-api-camel-oil-v1-list-tokens-req';
export * from './kami-api-camel-oil-v1-list-tokens-res';
export * from './kami-api-camel-oil-v1-order-callback-req';
@@ -39,9 +45,12 @@ export * from './kami-api-camel-oil-v1-order-history-item';
export * from './kami-api-camel-oil-v1-order-history-req';
export * from './kami-api-camel-oil-v1-order-history-res';
export * from './kami-api-camel-oil-v1-order-list-item';
export * from './kami-api-camel-oil-v1-prefetch-order-list-item';
export * from './kami-api-camel-oil-v1-prefetch-order-log-item';
export * from './kami-api-camel-oil-v1-submit-order-req';
export * from './kami-api-camel-oil-v1-submit-order-res';
export * from './kami-api-camel-oil-v1-token-info';
export * from './kami-api-camel-oil-v1-update-settings-req';
export * from './kami-api-camel-oil-v1-update-token-req';
export * from './kami-api-camel-oil-v1-update-token-res';
export * from './kami-api-card-info-apple-v1-apple-card-list-record';

View File

@@ -0,0 +1,28 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface KamiApiCamelOilV1DenominationSetting {
/**
* 面额值如100、200、500等
*/
denomination?: number;
/**
* 该面额预拉取订单最小库存阈值(当库存低于此值时触发补充)
*/
minCapacity?: number;
/**
* 该面额预拉取订单目标库存(补充时的目标数量)
*/
targetCapacity?: number;
}

View File

@@ -0,0 +1,24 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface KamiApiCamelOilV1GetPrefetchOrderLogsReq {
/**
* 开始时间
*/
startTime: string;
/**
* 结束时间
*/
endTime: string;
}

View File

@@ -0,0 +1,24 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { KamiApiCamelOilV1PrefetchOrderLogItem } from './kami-api-camel-oil-v1-prefetch-order-log-item';
export interface KamiApiCamelOilV1GetPrefetchOrderLogsRes {
/**
* 预拉取订单日志列表
*/
logs?: Array<KamiApiCamelOilV1PrefetchOrderLogItem>;
}

View File

@@ -0,0 +1,40 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { KamiApiCamelOilV1DenominationSetting } from './kami-api-camel-oil-v1-denomination-setting';
export interface KamiApiCamelOilV1GetSettingsRes {
/**
* 是否从豪猪平台获取手机号登录
*/
useHaozhuPlatform?: boolean;
/**
* 要登录的手机号数量
*/
loginAccountCount?: number;
/**
* 提前拉单并发的账号数量
*/
prefetchConcurrencyAccounts?: number;
/**
* 单个账号的并发数量
*/
singleAccountConcurrency?: number;
/**
* 要获取的面额和对应库存设置列表
*/
targetDenominations?: Array<KamiApiCamelOilV1DenominationSetting>;
}

View File

@@ -0,0 +1,63 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface KamiApiCamelOilV1ListPrefetchOrderReq {
/**
* 页数
*/
current: number;
/**
* 页码
*/
pageSize: KamiApiCamelOilV1ListPrefetchOrderReqPageSizeEnum;
/**
* 账号ID
*/
accountId?: number;
/**
* 账号名称
*/
accountName?: string;
/**
* 订单金额
*/
amount?: number;
/**
* 平台订单号
*/
platformOrderNo?: string;
/**
* 状态1待匹配 2已匹配 3已过期 4已失效
*/
status?: KamiApiCamelOilV1ListPrefetchOrderReqStatusEnum;
/**
* 时间范围
*/
dateRange?: Array<string>;
}
export enum KamiApiCamelOilV1ListPrefetchOrderReqPageSizeEnum {
NUMBER_5 = 5,
NUMBER_10 = 10,
NUMBER_15 = 15,
NUMBER_20 = 20,
NUMBER_50 = 50,
NUMBER_100 = 100
}
export enum KamiApiCamelOilV1ListPrefetchOrderReqStatusEnum {
NUMBER_3 = 3,
NUMBER_4 = 4,
NUMBER_2 = 2,
NUMBER_1 = 1
}

View File

@@ -0,0 +1,22 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { KamiApiCamelOilV1PrefetchOrderListItem } from './kami-api-camel-oil-v1-prefetch-order-list-item';
export interface KamiApiCamelOilV1ListPrefetchOrderRes {
total?: number;
list?: Array<KamiApiCamelOilV1PrefetchOrderListItem>;
}

View File

@@ -0,0 +1,79 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface KamiApiCamelOilV1PrefetchOrderListItem {
/**
* 主键ID
*/
id?: number;
/**
* 拉取时使用的账号ID
*/
accountId?: number;
/**
* 账号名称
*/
accountName?: string;
/**
* 预拉取订单金额
*/
amount?: number;
/**
* 骆驼平台订单号
*/
platformOrderNo?: string;
/**
* 支付宝支付链接
*/
alipayUrl?: string;
/**
* 预拉取订单状态1待匹配 2已匹配 3已过期 4已失效
*/
status?: KamiApiCamelOilV1PrefetchOrderListItemStatusEnum;
/**
* 匹配后的订单号
*/
orderNo?: string;
/**
* 匹配时间
*/
matchedAt?: string;
/**
* 预拉取订单过期时间
*/
expireAt?: string;
/**
* 失败原因
*/
failureReason?: string;
/**
* 备注信息
*/
remark?: string;
/**
* 创建时间
*/
createdAt?: string;
/**
* 更新时间
*/
updatedAt?: string;
}
export enum KamiApiCamelOilV1PrefetchOrderListItemStatusEnum {
NUMBER_3 = 3,
NUMBER_4 = 4,
NUMBER_2 = 2,
NUMBER_1 = 1
}

View File

@@ -0,0 +1,32 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface KamiApiCamelOilV1PrefetchOrderLogItem {
/**
* 请求时间戳
*/
timestamp?: string;
/**
* 手机号(脱敏)
*/
phone?: string;
/**
* 订单面额
*/
amount?: number;
/**
* API响应原始数据
*/
responseData?: string;
}

View File

@@ -17,6 +17,10 @@ export interface KamiApiCamelOilV1TokenInfo {
* Token ID
*/
id?: number;
/**
* 用户ID空字符串表示管理员创建
*/
userId?: string;
/**
* Token名称
*/

View File

@@ -0,0 +1,40 @@
/* tslint:disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
// May contain unused imports in some cases
// @ts-ignore
import type { KamiApiCamelOilV1DenominationSetting } from './kami-api-camel-oil-v1-denomination-setting';
export interface KamiApiCamelOilV1UpdateSettingsReq {
/**
* 是否从豪猪平台获取手机号登录
*/
useHaozhuPlatform?: boolean;
/**
* 要登录的手机号数量
*/
loginAccountCount?: number;
/**
* 提前拉单并发的账号数量
*/
prefetchConcurrencyAccounts?: number;
/**
* 单个账号的并发数量
*/
singleAccountConcurrency?: number;
/**
* 要获取的面额和对应库存设置列表
*/
targetDenominations?: Array<KamiApiCamelOilV1DenominationSetting>;
}

View File

@@ -7,7 +7,9 @@ import {
JDOrderManagementApi,
JDV2AccountApi,
JDV2OrderApi,
JDV2TokenManagementApi
JDV2TokenManagementApi,
JDV2PrefetchApi,
JDV2SettingsApi
} from './generated';
// 获取API基础URL
@@ -54,3 +56,14 @@ export const jdV2TokenClient = new JDV2TokenManagementApi(
apiBaseUrl,
axios
);
export const jdV2PrefetchClient = new JDV2PrefetchApi(
configuration,
apiBaseUrl,
axios
);
export const jdV2SettingsClient = new JDV2SettingsApi(
configuration,
apiBaseUrl,
axios
);

View File

@@ -16,28 +16,6 @@ const CamelOilMgt: AppRouteRecordRaw = {
order: 5
},
children: [
{
path: 'account',
name: 'camelOilAccount',
component: () => import('@/views/camel-oil-info/account/index.vue'),
meta: {
locale: '账号管理',
requiresAuth: true,
roles: ['*'],
activeMenu: '/camel-oil/account'
}
},
{
path: 'order',
name: 'camelOilOrder',
component: () => import('@/views/camel-oil-info/order/index.vue'),
meta: {
locale: '订单管理',
requiresAuth: true,
roles: ['*'],
activeMenu: '/camel-oil/order'
}
},
{
path: 'token',
name: 'camelOilToken',

View File

@@ -298,6 +298,17 @@ const IFRAME: AppRouteRecordRaw = {
roles: ['*'],
activeMenu: '/camel-oil/token'
}
},
{
path: 'camelOilPrefetch',
name: 'camelOilPrefetch',
component: () => import('@/views/camel-oil-info/prefetch/index.vue'),
meta: {
locale: '预拉取订单',
requiresAuth: true,
roles: ['*'],
activeMenu: '/camel-oil/prefetch'
}
}
]
};

View File

@@ -0,0 +1,133 @@
<template>
<a-modal
v-model:visible="visible"
title="API响应数据"
width="800px"
:footer="false"
@cancel="handleCancel"
>
<div class="response-container">
<div class="response-header">
<a-space>
<a-button size="small" @click="formatJson">
<template #icon>
<icon-code />
</template>
格式化
</a-button>
<a-button size="small" @click="copyToClipboard">
<template #icon>
<icon-copy />
</template>
复制
</a-button>
</a-space>
</div>
<pre class="response-content" :class="{ formatted: isFormatted }">{{
displayData
}}</pre>
</div>
</a-modal>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { Message } from '@arco-design/web-vue';
interface Props {
visible: boolean;
responseData: string;
}
interface Emits {
(e: 'update:visible', value: boolean): void;
}
const props = defineProps<Props>();
const emit = defineEmits<Emits>();
const visible = computed({
get: () => props.visible,
set: value => emit('update:visible', value)
});
const isFormatted = ref(false);
const displayData = computed(() => {
if (!props.responseData) return '';
if (isFormatted.value) {
try {
// 尝试解析为JSON并格式化
const parsed = JSON.parse(props.responseData);
return JSON.stringify(parsed, null, 2);
} catch {
// 如果不是有效的JSON直接返回原始数据
return props.responseData;
}
}
return props.responseData;
});
const formatJson = () => {
isFormatted.value = !isFormatted.value;
};
const copyToClipboard = async () => {
try {
await navigator.clipboard.writeText(displayData.value);
Message.success({
content: '复制成功',
duration: 2000
});
} catch (err) {
console.error('复制失败:', err);
Message.error({
content: '复制失败',
duration: 2000
});
}
};
const handleCancel = () => {
isFormatted.value = false; // 重置格式化状态
visible.value = false;
};
</script>
<style scoped>
.response-container {
position: relative;
}
.response-header {
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid var(--color-border-2);
}
.response-content {
max-height: 500px;
overflow-y: auto;
background-color: var(--color-fill-2);
padding: 16px;
border-radius: var(--border-radius-medium);
font-size: 12px;
line-height: 1.4;
white-space: pre-wrap;
word-break: break-all;
margin: 0;
color: var(--color-text-1);
}
.response-content.formatted {
font-family: Monaco, Menlo, 'Ubuntu Mono', monospace;
white-space: pre;
word-break: normal;
}
:deep(.arco-modal-body) {
max-height: 70vh;
overflow-y: auto;
}
</style>

View File

@@ -0,0 +1,351 @@
<template>
<a-card :bordered="false">
<a-form
:model="formModel"
:label-col-props="{ span: 6 }"
:wrapper-col-props="{ span: 18 }"
label-align="left"
@submit="handleSubmit"
>
<!-- 基础设置区域 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="useHaozhuPlatform" label="豪猪平台">
<a-switch
v-model="formModel.useHaozhuPlatform"
checked-text="启用"
unchecked-text="禁用"
>
<template #checked-text>启用</template>
<template #unchecked-text>禁用</template>
</a-switch>
<template #help>是否从豪猪平台获取手机号登录</template>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
field="loginAccountCount"
label="登录账号数量"
:rules="[
{ required: true, message: '请输入登录账号数量' },
{
type: 'number',
min: 1,
max: 100,
message: '请输入1-100之间的数字'
}
]"
>
<a-input-number
v-model="formModel.loginAccountCount"
:min="1"
:max="100"
placeholder="请输入要登录的手机号数量"
style="width: 100%"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item
field="prefetchConcurrencyAccounts"
label="并发账号数"
:rules="[
{ required: true, message: '请输入并发账号数量' },
{
type: 'number',
min: 1,
max: 50,
message: '请输入1-50之间的数字'
}
]"
>
<a-input-number
v-model="formModel.prefetchConcurrencyAccounts"
:min="1"
:max="50"
placeholder="请输入提前拉单并发的账号数量"
style="width: 100%"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
field="singleAccountConcurrency"
label="单账号并发数"
:rules="[
{ required: true, message: '请输入单账号并发数量' },
{
type: 'number',
min: 1,
max: 20,
message: '请输入1-20之间的数字'
}
]"
>
<a-input-number
v-model="formModel.singleAccountConcurrency"
:min="1"
:max="20"
placeholder="请输入单个账号的并发数量"
style="width: 100%"
/>
</a-form-item>
</a-col>
</a-row>
<div class="denominations-section">
<div class="denominations-actions">
<a-button type="primary" size="small" @click="addDenomination">
<template #icon>
<icon-plus />
</template>
添加面额
</a-button>
</div>
<a-table
v-if="
formModel.targetDenominations &&
formModel.targetDenominations.length > 0
"
:data="formModel.targetDenominations"
:columns="columns"
:pagination="false"
:bordered="{ cell: true }"
row-key="denomination"
>
<template #denomination="{ rowIndex }">
<a-input-number
v-model="formModel.targetDenominations[rowIndex].denomination"
:min="1"
placeholder="如100、200、500"
style="width: 100%"
/>
</template>
<template #minCapacity="{ rowIndex }">
<a-input-number
v-model="formModel.targetDenominations[rowIndex].minCapacity"
:min="0"
placeholder="库存低于此值时触发补充"
style="width: 100%"
/>
</template>
<template #targetCapacity="{ rowIndex }">
<a-input-number
v-model="formModel.targetDenominations[rowIndex].targetCapacity"
:min="1"
placeholder="补充时的目标数量"
style="width: 100%"
/>
</template>
<template #actions="{ rowIndex }">
<a-button
type="text"
status="danger"
size="small"
@click="removeDenomination(rowIndex)"
>
<template #icon>
<icon-delete />
</template>
删除
</a-button>
</template>
</a-table>
<a-empty v-else description="暂无面额设置,请添加面额配置" />
</div>
<!-- 操作按钮区域 -->
<div class="form-actions">
<a-row justify="center">
<a-col>
<a-space :size="16">
<a-button type="primary" html-type="submit" :loading="loading">
<template #icon>
<icon-save />
</template>
保存设置
</a-button>
<a-button @click="resetForm">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
</div>
</a-form>
</a-card>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import { Message } from '@arco-design/web-vue';
import type { KamiApiCamelOilV1DenominationSetting } from '@/api/generated/index.ts';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
import { jdV2SettingsClient } from '@/api/index.ts';
interface Props {
loading?: boolean;
}
interface Emits {
(e: 'submit', data: any): void;
(e: 'reset'): void;
}
const props = withDefaults(defineProps<Props>(), {
loading: false
});
const emit = defineEmits<Emits>();
const formModel = reactive({
useHaozhuPlatform: false,
loginAccountCount: 5,
prefetchConcurrencyAccounts: 2,
singleAccountConcurrency: 3,
targetDenominations: [] as KamiApiCamelOilV1DenominationSetting[]
});
// 表格列配置
const columns: TableColumnData[] = [
{
title: '序号',
dataIndex: 'index',
width: 80,
render: ({ rowIndex }) => rowIndex + 1
},
{
title: '面额值',
dataIndex: 'denomination',
width: 150,
slotName: 'denomination'
},
{
title: '最小库存',
dataIndex: 'minCapacity',
width: 150,
slotName: 'minCapacity'
},
{
title: '目标库存',
dataIndex: 'targetCapacity',
width: 150,
slotName: 'targetCapacity'
},
{
title: '操作',
dataIndex: 'actions',
width: 100,
slotName: 'actions'
}
];
const addDenomination = () => {
if (!formModel.targetDenominations) {
formModel.targetDenominations = [];
}
formModel.targetDenominations.push({
denomination: null,
minCapacity: null,
targetCapacity: null
});
};
const removeDenomination = (index: number) => {
formModel.targetDenominations.splice(index, 1);
};
const handleSubmit = async () => {
try {
// 验证面额设置
if (
formModel.targetDenominations &&
formModel.targetDenominations.length > 0
) {
for (let i = 0; i < formModel.targetDenominations.length; i++) {
const item = formModel.targetDenominations[i];
if (!item.denomination || !item.minCapacity || !item.targetCapacity) {
Message.warning({
content: `请完善第${i + 1}个面额设置的必填项`,
duration: 3000
});
return;
}
if (item.minCapacity >= item.targetCapacity) {
Message.warning({
content: `${i + 1}个面额设置的最小库存必须小于目标库存`,
duration: 3000
});
return;
}
}
}
emit('submit', { ...formModel });
} catch (error) {
console.error('表单验证失败:', error);
}
};
const resetForm = () => {
formModel.useHaozhuPlatform = false;
formModel.loginAccountCount = 5;
formModel.prefetchConcurrencyAccounts = 2;
formModel.singleAccountConcurrency = 3;
formModel.targetDenominations = [];
emit('reset');
};
// 暴露方法供父组件调用
const setFormData = (data: any) => {
Object.assign(formModel, data);
if (!formModel.targetDenominations) {
formModel.targetDenominations = [];
}
};
const getFormData = () => {
return { ...formModel };
};
defineExpose({
setFormData,
getFormData
});
</script>
<style scoped>
.denominations-section {
margin-top: 20px;
}
.denominations-actions {
display: flex;
justify-content: flex-end;
margin-bottom: 16px;
}
.section-title {
font-weight: 500;
color: var(--color-text-1);
font-size: 14px;
}
.form-actions {
margin-top: 32px;
padding-top: 20px;
border-top: 1px solid var(--color-border-2);
}
/* Arco Design 已经处理了大部分样式,只需要覆盖必要的布局样式 */
:deep(.arco-form-item-content-flex) {
display: block;
}
</style>

View File

@@ -0,0 +1,735 @@
<template>
<div class="container">
<Breadcrumb :items="['充值账户管理', '预拉取订单日志']" />
<a-card class="general-card" :title="cardTitle">
<template #extra>
<a-radio-group v-model="activeView" type="button" size="small">
<a-radio value="logs">预拉取订单日志</a-radio>
<a-radio value="orders">预拉取订单列表</a-radio>
</a-radio-group>
</template>
<!-- 预拉取订单日志内容 -->
<div v-show="activeView === 'logs'">
<!-- 搜索表单区域 -->
<a-row>
<a-col :flex="1">
<a-form
:model="logFormModel"
:label-col-props="{ span: 6 }"
:wrapper-col-props="{ span: 18 }"
label-align="left"
>
<a-row :gutter="16">
<a-col :span="8">
<a-form-item field="startTime" label="开始时间">
<a-date-picker
v-model="logFormModel.startTime"
style="width: 100%"
format="YYYY-MM-DD HH:mm:ss"
show-time
placeholder="请选择开始时间"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item field="endTime" label="结束时间">
<a-date-picker
v-model="logFormModel.endTime"
style="width: 100%"
format="YYYY-MM-DD HH:mm:ss"
show-time
placeholder="请选择结束时间"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-divider style="height: 42px" direction="vertical" />
<a-col flex="180px" style="text-align: right">
<a-space direction="horizontal" :size="18">
<a-button type="primary" @click="searchLogs">
<template #icon>
<icon-search />
</template>
搜索
</a-button>
<a-button @click="resetLogs">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
<a-divider style="margin-top: 0" />
<!-- 表格操作按钮 -->
<div class="table-actions">
<a-button @click="showSettingsModal">
<template #icon>
<icon-settings />
</template>
设置
</a-button>
</div>
<!-- 日志数据表格区域 -->
<a-table
:loading="logsLoading"
:data="logsRenderData"
:columns="logColumns"
:scroll="{ x: 1200 }"
:pagination="{
current: logsPagination.current,
pageSize: logsPagination.pageSize,
total: logsPagination.total,
pageSizeOptions: [10, 20, 50, 100],
showPageSize: true
}"
row-key="timestamp"
@page-change="onLogsPageChange"
@page-size-change="onLogsPageSizeChange"
>
<!-- 订单面额列模板 -->
<template #amount="{ record }">
<span v-if="record.amount">¥{{ record.amount.toFixed(2) }}</span>
<span v-else>-</span>
</template>
<!-- 响应数据列模板 -->
<template #responseData="{ record }">
<a-tooltip
v-if="record.responseData"
content="点击查看完整响应数据"
>
<a-button
size="small"
type="text"
@click="showResponseData(record.responseData)"
>
<template #icon>
<icon-eye />
</template>
查看响应
</a-button>
</a-tooltip>
<span v-else>-</span>
</template>
</a-table>
</div>
<!-- 预拉取订单列表内容 -->
<div v-show="activeView === 'orders'">
<!-- 搜索表单区域 -->
<a-row>
<a-col :flex="1">
<a-form
:model="orderFormModel"
:label-col-props="{ span: 6 }"
:wrapper-col-props="{ span: 18 }"
label-align="left"
>
<a-row :gutter="16">
<a-col :span="6">
<a-form-item field="accountName" label="账号名称">
<a-input
v-model="orderFormModel.accountName"
placeholder="请输入账号名称"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item field="platformOrderNo" label="平台订单号">
<a-input
v-model="orderFormModel.platformOrderNo"
placeholder="请输入平台订单号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item field="amount" label="订单金额">
<a-input-number
v-model="orderFormModel.amount"
placeholder="请输入订单金额"
style="width: 100%"
:min="0"
:precision="2"
/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item field="status" label="状态">
<a-select
v-model="orderFormModel.status"
placeholder="请选择状态"
allow-clear
>
<a-option :value="1">待匹配</a-option>
<a-option :value="2">已匹配</a-option>
<a-option :value="3">已过期</a-option>
<a-option :value="4">已失效</a-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="8">
<a-form-item field="dateRange" label="创建时间">
<a-range-picker
v-model="orderFormModel.dateRange"
style="width: 100%"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:placeholder="['开始日期', '结束日期']"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-divider style="height: 42px" direction="vertical" />
<a-col flex="180px" style="text-align: right">
<a-space direction="horizontal" :size="18">
<a-button type="primary" @click="searchOrders">
<template #icon>
<icon-search />
</template>
搜索
</a-button>
<a-button @click="resetOrders">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
<a-divider style="margin-top: 0" />
<!-- 订单数据表格区域 -->
<a-table
:loading="ordersLoading"
:data="ordersRenderData"
:columns="orderColumns"
:scroll="{ x: 1600 }"
:pagination="{
current: ordersPagination.current,
pageSize: ordersPagination.pageSize,
total: ordersPagination.total,
pageSizeOptions: [10, 20, 50, 100],
showPageSize: true
}"
row-key="id"
@page-change="onOrdersPageChange"
@page-size-change="onOrdersPageSizeChange"
>
<!-- 订单金额列模板 -->
<template #orderAmount="{ record }">
<span v-if="record.amount">¥{{ record.amount.toFixed(2) }}</span>
<span v-else>-</span>
</template>
<!-- 状态列模板 -->
<template #orderStatus="{ record }">
<a-tag v-if="record.status" :color="getStatusColor(record.status)">
{{ record.statusText || getStatusText(record.status) }}
</a-tag>
<span v-else>-</span>
</template>
<!-- 创建时间列模板 -->
<template #createdAt="{ record }">
<span v-if="record.createdAt">
{{ formatDateTime(record.createdAt) }}
</span>
<span v-else>-</span>
</template>
<!-- 匹配时间列模板 -->
<template #matchedAt="{ record }">
<span v-if="record.matchedAt">
{{ formatDateTime(record.matchedAt) }}
</span>
<span v-else>-</span>
</template>
<!-- 过期时间列模板 -->
<template #expireAt="{ record }">
<span v-if="record.expireAt">
{{ formatDateTime(record.expireAt) }}
</span>
<span v-else>-</span>
</template>
</a-table>
</div>
</a-card>
<!-- 响应数据详情弹窗 -->
<response-data-modal
v-model:visible="state.responseModalVisible"
:response-data="state.selectedResponseData"
/>
<!-- 设置配置弹窗 -->
<a-modal
v-model:visible="state.settingsModalVisible"
title="预拉取设置配置"
width="1000px"
:footer="false"
@cancel="state.settingsModalVisible = false"
>
<settings-form
ref="settingsFormRef"
:loading="settingsLoading"
@submit="handleSettingsSubmit"
@reset="handleSettingsReset"
/>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import useLoading from '@/hooks/loading';
import { Pagination } from '@/types/global';
import { onMounted, reactive, ref, computed, watch } from 'vue';
import { Notification } from '@arco-design/web-vue';
import SettingsForm from './components/settings-form.vue';
import ResponseDataModal from './components/response-data-modal.vue';
import type {
KamiApiCamelOilV1PrefetchOrderLogItem,
KamiApiCamelOilV1PrefetchOrderListItem
} from '@/api/generated/index.ts';
import { jdV2PrefetchClient, jdV2SettingsClient } from '@/api/index.ts';
import dayjs from 'dayjs';
const settingsFormRef = ref();
// 当前活跃视图
const activeView = ref('logs');
// 动态卡片标题
const cardTitle = computed(() => {
return activeView.value === 'logs' ? '预拉取订单日志' : '预拉取订单列表';
});
// 设置相关状态
const { loading: settingsLoading, setLoading: setSettingsLoading } =
useLoading(false);
// 日志相关状态
const baseLogsPagination: Pagination = {
current: 1,
pageSize: 50
};
const logsPagination = reactive({
...baseLogsPagination
});
// 订单列表相关状态
const baseOrdersPagination: Pagination = {
current: 1,
pageSize: 20
};
const ordersPagination = reactive({
...baseOrdersPagination
});
const logColumns = [
{
title: '序号',
dataIndex: 'index',
width: 80,
render: ({ rowIndex }) => {
return (
rowIndex + 1 + (logsPagination.current - 1) * logsPagination.pageSize
);
}
},
{
title: '请求时间',
dataIndex: 'timestamp',
width: 180,
render: ({ record }) => {
return formatDateTime(record.timestamp);
}
},
{
title: '手机号',
dataIndex: 'phone',
width: 130,
ellipsis: true,
tooltip: true
},
{
title: '订单面额',
dataIndex: 'amount',
slotName: 'amount',
width: 100
},
{
title: '响应数据',
dataIndex: 'responseData',
slotName: 'responseData',
width: 120
}
];
const generateLogFormModel = () => {
const now = dayjs();
return {
startTime: now.subtract(1, 'day').toDate(),
endTime: now.toDate()
};
};
const { loading: logsLoading, setLoading: setLogsLoading } = useLoading(false);
const logsRenderData = ref<KamiApiCamelOilV1PrefetchOrderLogItem[]>([]);
const logFormModel = ref(generateLogFormModel());
const { loading: ordersLoading, setLoading: setOrdersLoading } =
useLoading(false);
const ordersRenderData = ref<KamiApiCamelOilV1PrefetchOrderListItem[]>([]);
const generateOrderFormModel = () => {
return {
accountName: '',
platformOrderNo: '',
amount: undefined,
status: undefined,
dateRange: undefined as Array<string> | undefined
};
};
const orderFormModel = ref(generateOrderFormModel());
const orderColumns = [
{
title: '序号',
dataIndex: 'index',
width: 80,
render: ({ rowIndex }) => {
return (
rowIndex +
1 +
(ordersPagination.current - 1) * ordersPagination.pageSize
);
}
},
{
title: '账号名称',
dataIndex: 'accountName',
width: 120,
ellipsis: true,
tooltip: true
},
{
title: '平台订单号',
dataIndex: 'platformOrderNo',
width: 180,
ellipsis: true,
tooltip: true
},
{
title: '订单金额',
dataIndex: 'amount',
slotName: 'orderAmount',
width: 100
},
{
title: '状态',
dataIndex: 'status',
slotName: 'orderStatus',
width: 100
},
{
title: '匹配订单号',
dataIndex: 'orderNo',
width: 150,
ellipsis: true,
tooltip: true
},
{
title: '创建时间',
dataIndex: 'createdAt',
slotName: 'createdAt',
width: 160
},
{
title: '匹配时间',
dataIndex: 'matchedAt',
slotName: 'matchedAt',
width: 160
},
{
title: '过期时间',
dataIndex: 'expireAt',
slotName: 'expireAt',
width: 160
},
{
title: '失败原因',
dataIndex: 'failureReason',
width: 120,
ellipsis: true,
tooltip: true
},
{
title: '备注',
dataIndex: 'remark',
width: 120,
ellipsis: true,
tooltip: true
}
];
const state = reactive({
responseModalVisible: false,
selectedResponseData: '',
settingsModalVisible: false
});
// 设置相关方法
const loadSettings = async () => {
setSettingsLoading(true);
try {
const { data } = await jdV2SettingsClient.apiJdV2SettingsGetGet();
if (settingsFormRef.value) {
settingsFormRef.value.setFormData(data);
}
} catch (err) {
console.error('获取设置失败:', err);
Notification.error({
content: '获取设置失败',
closable: true
});
} finally {
setSettingsLoading(false);
}
};
const handleSettingsSubmit = async (formData: any) => {
setSettingsLoading(true);
try {
await jdV2SettingsClient.apiJdV2SettingsUpdatePost({
kamiApiCamelOilV1UpdateSettingsReq: formData
});
Notification.success({
content: '设置保存成功',
closable: true
});
} catch (err) {
console.error('保存设置失败:', err);
Notification.error({
content: '保存设置失败',
closable: true
});
} finally {
setSettingsLoading(false);
}
};
const handleSettingsReset = () => {
loadSettings();
};
// 日志相关方法
const fetchLogs = async (params: any = { current: 1, pageSize: 50 }) => {
if (!logFormModel.value.startTime || !logFormModel.value.endTime) {
Notification.warning({
content: '请选择开始时间和结束时间',
closable: true
});
setLogsLoading(false);
return;
}
setLogsLoading(true);
try {
const { data } = await jdV2PrefetchClient.apiJdV2PrefetchLogsGet({
startTime: dayjs(logFormModel.value.startTime).format(
'YYYY-MM-DD HH:mm:ss'
),
endTime: dayjs(logFormModel.value.endTime).format('YYYY-MM-DD HH:mm:ss')
});
// 模拟分页因为API返回的是全部数据
const allData = data.logs || [];
const total = allData.length;
const start = (params.current - 1) * params.pageSize;
const end = start + params.pageSize;
const pageData = allData.slice(start, end);
logsRenderData.value = pageData;
logsPagination.current = params.current;
logsPagination.pageSize = params.pageSize;
logsPagination.total = total;
} catch (err) {
console.error('获取预拉取订单日志失败:', err);
Notification.error({
content: '获取预拉取订单日志失败',
closable: true
});
} finally {
setLogsLoading(false);
}
};
const onLogsPageChange = (current: number) => {
fetchLogs({ ...logsPagination, current });
};
const onLogsPageSizeChange = (pageSize: number) => {
fetchLogs({ ...logsPagination, pageSize, current: 1 });
};
const searchLogs = () => {
fetchLogs({
...baseLogsPagination
});
};
const resetLogs = () => {
logFormModel.value = generateLogFormModel();
searchLogs();
};
const showResponseData = (responseData: string) => {
state.selectedResponseData = responseData;
state.responseModalVisible = true;
};
const showSettingsModal = () => {
state.settingsModalVisible = true;
// 打开弹窗时加载设置
loadSettings();
};
const formatDateTime = (dateTime: string | undefined): string => {
if (!dateTime) return '-';
return dayjs(dateTime).format('YYYY-MM-DD HH:mm:ss');
};
// 订单列表相关方法
const fetchOrders = async (params: any = { current: 1, pageSize: 20 }) => {
setOrdersLoading(true);
try {
const requestParams: any = {
current: params.current,
pageSize: params.pageSize
};
// 添加搜索条件
if (orderFormModel.value.accountName) {
requestParams.accountName = orderFormModel.value.accountName;
}
if (orderFormModel.value.platformOrderNo) {
requestParams.platformOrderNo = orderFormModel.value.platformOrderNo;
}
if (orderFormModel.value.amount) {
requestParams.amount = orderFormModel.value.amount;
}
if (orderFormModel.value.status) {
requestParams.status = orderFormModel.value.status;
}
if (
orderFormModel.value.dateRange &&
orderFormModel.value.dateRange.length === 2
) {
requestParams.dateRange = orderFormModel.value.dateRange;
}
const { data } =
await jdV2PrefetchClient.apiJdV2PrefetchOrdersGet(requestParams);
ordersRenderData.value = data.list || [];
ordersPagination.current = params.current;
ordersPagination.pageSize = params.pageSize;
ordersPagination.total = data.total || 0;
} catch (err) {
console.error('获取预拉取订单列表失败:', err);
Notification.error({
content: '获取预拉取订单列表失败',
closable: true
});
} finally {
setOrdersLoading(false);
}
};
const onOrdersPageChange = (current: number) => {
fetchOrders({ ...ordersPagination, current });
};
const onOrdersPageSizeChange = (pageSize: number) => {
fetchOrders({ ...ordersPagination, pageSize, current: 1 });
};
const searchOrders = () => {
fetchOrders({
...baseOrdersPagination
});
};
const resetOrders = () => {
orderFormModel.value = generateOrderFormModel();
searchOrders();
};
// 状态相关方法
const getStatusText = (status: number): string => {
const statusMap: Record<number, string> = {
1: '待匹配',
2: '已匹配',
3: '已过期',
4: '已失效'
};
return statusMap[status] || '未知';
};
const getStatusColor = (status: number): string => {
const colorMap: Record<number, string> = {
1: 'blue', // 待匹配
2: 'green', // 已匹配
3: 'orange', // 已过期
4: 'red' // 已失效
};
return colorMap[status] || 'gray';
};
// 视图切换处理
watch(activeView, newValue => {
if (newValue === 'orders' && ordersRenderData.value.length === 0) {
// 首次切换到订单列表视图时加载数据
fetchOrders();
}
});
onMounted(() => {
// 页面加载时默认加载日志数据
fetchLogs();
});
</script>
<style scoped>
.container {
padding: 0 20px 20px;
}
.general-card {
min-height: calc(100vh - 200px);
}
.table-actions {
display: flex;
justify-content: flex-end;
margin-bottom: 16px;
}
</style>