@be-link/ecommerce-promotion-service-node-sdk 0.1.24 → 0.1.26
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/enum.d.ts +67 -0
- package/enum.js +76 -0
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/modules/award/service.d.ts +0 -1
- package/modules/award/service.js +0 -8
- package/modules/award/types.d.ts +3 -30
- package/modules/pointsMall/service.d.ts +1 -0
- package/modules/pointsMall/service.js +8 -0
- package/modules/pointsMall/types.d.ts +28 -0
- package/modules/task/service.d.ts +12 -0
- package/modules/task/service.js +69 -0
- package/modules/task/types.d.ts +205 -0
- package/modules/task/types.js +2 -0
- package/package.json +2 -2
package/enum.d.ts
CHANGED
|
@@ -414,4 +414,71 @@ export declare namespace ENUM {
|
|
|
414
414
|
OTHER = "OTHER"
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
+
namespace TASK_ENUM {
|
|
418
|
+
/** 任务状态 */
|
|
419
|
+
enum TASK_STATUS {
|
|
420
|
+
/** 待处理 */
|
|
421
|
+
PENDING = "PENDING",
|
|
422
|
+
/** 处理中 */
|
|
423
|
+
PROCESSING = "PROCESSING",
|
|
424
|
+
/** 已完成 */
|
|
425
|
+
COMPLETED = "COMPLETED",
|
|
426
|
+
/** 已撤回 */
|
|
427
|
+
CANCELLED = "CANCELLED",
|
|
428
|
+
/** 失败 */
|
|
429
|
+
FAILED = "FAILED"
|
|
430
|
+
}
|
|
431
|
+
/** 任务状态中文 */
|
|
432
|
+
enum TASK_STATUS_CHINESE {
|
|
433
|
+
PENDING = "\u5F85\u5904\u7406",
|
|
434
|
+
PROCESSING = "\u5904\u7406\u4E2D",
|
|
435
|
+
COMPLETED = "\u5DF2\u5B8C\u6210",
|
|
436
|
+
CANCELLED = "\u5DF2\u64A4\u56DE"
|
|
437
|
+
}
|
|
438
|
+
/** 变动类型 */
|
|
439
|
+
enum CHANGE_TYPE {
|
|
440
|
+
/** 增加积分 */
|
|
441
|
+
ADD_POINTS = "ADD_POINTS",
|
|
442
|
+
/** 扣减积分 */
|
|
443
|
+
DEDUCT_POINTS = "DEDUCT_POINTS",
|
|
444
|
+
/** 发放优惠券 */
|
|
445
|
+
ISSUE_COUPON = "ISSUE_COUPON",
|
|
446
|
+
/** 作废优惠券 */
|
|
447
|
+
ABANDON_COUPON = "ABANDON_COUPON"
|
|
448
|
+
}
|
|
449
|
+
/** 变动类型中文 */
|
|
450
|
+
enum CHANGE_TYPE_CHINESE {
|
|
451
|
+
ADD_POINTS = "\u589E\u52A0\u79EF\u5206",
|
|
452
|
+
DEDUCT_POINTS = "\u6263\u51CF\u79EF\u5206",
|
|
453
|
+
ISSUE_COUPON = "\u53D1\u653E\u4F18\u60E0\u5238",
|
|
454
|
+
ABANDON_COUPON = "\u4F5C\u5E9F\u4F18\u60E0\u5238"
|
|
455
|
+
}
|
|
456
|
+
/** 资产类型 */
|
|
457
|
+
enum ASSET_TYPE {
|
|
458
|
+
/** 积分 */
|
|
459
|
+
POINTS = "POINTS",
|
|
460
|
+
/** 优惠券 */
|
|
461
|
+
COUPON = "COUPON"
|
|
462
|
+
}
|
|
463
|
+
/** 资产类型中文 */
|
|
464
|
+
enum ASSET_TYPE_CHINESE {
|
|
465
|
+
POINTS = "\u79EF\u5206",
|
|
466
|
+
COUPON = "\u4F18\u60E0\u5238"
|
|
467
|
+
}
|
|
468
|
+
/** 明细处理状态 */
|
|
469
|
+
enum DETAIL_STATUS {
|
|
470
|
+
/** 待处理 */
|
|
471
|
+
PENDING = "PENDING",
|
|
472
|
+
/** 成功 */
|
|
473
|
+
SUCCESS = "SUCCESS",
|
|
474
|
+
/** 失败 */
|
|
475
|
+
FAILED = "FAILED"
|
|
476
|
+
}
|
|
477
|
+
/** 明细处理状态中文 */
|
|
478
|
+
enum DETAIL_STATUS_CHINESE {
|
|
479
|
+
PENDING = "\u5F85\u5904\u7406",
|
|
480
|
+
SUCCESS = "\u6210\u529F",
|
|
481
|
+
FAILED = "\u5931\u8D25"
|
|
482
|
+
}
|
|
483
|
+
}
|
|
417
484
|
}
|
package/enum.js
CHANGED
|
@@ -469,4 +469,80 @@ var ENUM;
|
|
|
469
469
|
ExchangeType["OTHER"] = "OTHER";
|
|
470
470
|
})(ExchangeType = POINT_MALL.ExchangeType || (POINT_MALL.ExchangeType = {}));
|
|
471
471
|
})(POINT_MALL = ENUM.POINT_MALL || (ENUM.POINT_MALL = {}));
|
|
472
|
+
let TASK_ENUM;
|
|
473
|
+
(function (TASK_ENUM) {
|
|
474
|
+
/** 任务状态 */
|
|
475
|
+
let TASK_STATUS;
|
|
476
|
+
(function (TASK_STATUS) {
|
|
477
|
+
/** 待处理 */
|
|
478
|
+
TASK_STATUS["PENDING"] = "PENDING";
|
|
479
|
+
/** 处理中 */
|
|
480
|
+
TASK_STATUS["PROCESSING"] = "PROCESSING";
|
|
481
|
+
/** 已完成 */
|
|
482
|
+
TASK_STATUS["COMPLETED"] = "COMPLETED";
|
|
483
|
+
/** 已撤回 */
|
|
484
|
+
TASK_STATUS["CANCELLED"] = "CANCELLED";
|
|
485
|
+
/** 失败 */
|
|
486
|
+
TASK_STATUS["FAILED"] = "FAILED";
|
|
487
|
+
})(TASK_STATUS = TASK_ENUM.TASK_STATUS || (TASK_ENUM.TASK_STATUS = {}));
|
|
488
|
+
/** 任务状态中文 */
|
|
489
|
+
let TASK_STATUS_CHINESE;
|
|
490
|
+
(function (TASK_STATUS_CHINESE) {
|
|
491
|
+
TASK_STATUS_CHINESE["PENDING"] = "\u5F85\u5904\u7406";
|
|
492
|
+
TASK_STATUS_CHINESE["PROCESSING"] = "\u5904\u7406\u4E2D";
|
|
493
|
+
TASK_STATUS_CHINESE["COMPLETED"] = "\u5DF2\u5B8C\u6210";
|
|
494
|
+
TASK_STATUS_CHINESE["CANCELLED"] = "\u5DF2\u64A4\u56DE";
|
|
495
|
+
})(TASK_STATUS_CHINESE = TASK_ENUM.TASK_STATUS_CHINESE || (TASK_ENUM.TASK_STATUS_CHINESE = {}));
|
|
496
|
+
/** 变动类型 */
|
|
497
|
+
let CHANGE_TYPE;
|
|
498
|
+
(function (CHANGE_TYPE) {
|
|
499
|
+
/** 增加积分 */
|
|
500
|
+
CHANGE_TYPE["ADD_POINTS"] = "ADD_POINTS";
|
|
501
|
+
/** 扣减积分 */
|
|
502
|
+
CHANGE_TYPE["DEDUCT_POINTS"] = "DEDUCT_POINTS";
|
|
503
|
+
/** 发放优惠券 */
|
|
504
|
+
CHANGE_TYPE["ISSUE_COUPON"] = "ISSUE_COUPON";
|
|
505
|
+
/** 作废优惠券 */
|
|
506
|
+
CHANGE_TYPE["ABANDON_COUPON"] = "ABANDON_COUPON";
|
|
507
|
+
})(CHANGE_TYPE = TASK_ENUM.CHANGE_TYPE || (TASK_ENUM.CHANGE_TYPE = {}));
|
|
508
|
+
/** 变动类型中文 */
|
|
509
|
+
let CHANGE_TYPE_CHINESE;
|
|
510
|
+
(function (CHANGE_TYPE_CHINESE) {
|
|
511
|
+
CHANGE_TYPE_CHINESE["ADD_POINTS"] = "\u589E\u52A0\u79EF\u5206";
|
|
512
|
+
CHANGE_TYPE_CHINESE["DEDUCT_POINTS"] = "\u6263\u51CF\u79EF\u5206";
|
|
513
|
+
CHANGE_TYPE_CHINESE["ISSUE_COUPON"] = "\u53D1\u653E\u4F18\u60E0\u5238";
|
|
514
|
+
CHANGE_TYPE_CHINESE["ABANDON_COUPON"] = "\u4F5C\u5E9F\u4F18\u60E0\u5238";
|
|
515
|
+
})(CHANGE_TYPE_CHINESE = TASK_ENUM.CHANGE_TYPE_CHINESE || (TASK_ENUM.CHANGE_TYPE_CHINESE = {}));
|
|
516
|
+
/** 资产类型 */
|
|
517
|
+
let ASSET_TYPE;
|
|
518
|
+
(function (ASSET_TYPE) {
|
|
519
|
+
/** 积分 */
|
|
520
|
+
ASSET_TYPE["POINTS"] = "POINTS";
|
|
521
|
+
/** 优惠券 */
|
|
522
|
+
ASSET_TYPE["COUPON"] = "COUPON";
|
|
523
|
+
})(ASSET_TYPE = TASK_ENUM.ASSET_TYPE || (TASK_ENUM.ASSET_TYPE = {}));
|
|
524
|
+
/** 资产类型中文 */
|
|
525
|
+
let ASSET_TYPE_CHINESE;
|
|
526
|
+
(function (ASSET_TYPE_CHINESE) {
|
|
527
|
+
ASSET_TYPE_CHINESE["POINTS"] = "\u79EF\u5206";
|
|
528
|
+
ASSET_TYPE_CHINESE["COUPON"] = "\u4F18\u60E0\u5238";
|
|
529
|
+
})(ASSET_TYPE_CHINESE = TASK_ENUM.ASSET_TYPE_CHINESE || (TASK_ENUM.ASSET_TYPE_CHINESE = {}));
|
|
530
|
+
/** 明细处理状态 */
|
|
531
|
+
let DETAIL_STATUS;
|
|
532
|
+
(function (DETAIL_STATUS) {
|
|
533
|
+
/** 待处理 */
|
|
534
|
+
DETAIL_STATUS["PENDING"] = "PENDING";
|
|
535
|
+
/** 成功 */
|
|
536
|
+
DETAIL_STATUS["SUCCESS"] = "SUCCESS";
|
|
537
|
+
/** 失败 */
|
|
538
|
+
DETAIL_STATUS["FAILED"] = "FAILED";
|
|
539
|
+
})(DETAIL_STATUS = TASK_ENUM.DETAIL_STATUS || (TASK_ENUM.DETAIL_STATUS = {}));
|
|
540
|
+
/** 明细处理状态中文 */
|
|
541
|
+
let DETAIL_STATUS_CHINESE;
|
|
542
|
+
(function (DETAIL_STATUS_CHINESE) {
|
|
543
|
+
DETAIL_STATUS_CHINESE["PENDING"] = "\u5F85\u5904\u7406";
|
|
544
|
+
DETAIL_STATUS_CHINESE["SUCCESS"] = "\u6210\u529F";
|
|
545
|
+
DETAIL_STATUS_CHINESE["FAILED"] = "\u5931\u8D25";
|
|
546
|
+
})(DETAIL_STATUS_CHINESE = TASK_ENUM.DETAIL_STATUS_CHINESE || (TASK_ENUM.DETAIL_STATUS_CHINESE = {}));
|
|
547
|
+
})(TASK_ENUM = ENUM.TASK_ENUM || (ENUM.TASK_ENUM = {}));
|
|
472
548
|
})(ENUM || (exports.ENUM = ENUM = {}));
|
package/index.d.ts
CHANGED
|
@@ -10,4 +10,6 @@ export { pointsMallService } from './modules/pointsMall/service';
|
|
|
10
10
|
export type { Service as PointsMallServiceTypes } from './modules/pointsMall/types';
|
|
11
11
|
export { jobService } from './modules/job/service';
|
|
12
12
|
export type { Service as JobServiceTypes } from './modules/job/types';
|
|
13
|
+
export { taskService } from './modules/task/service';
|
|
14
|
+
export type { Service as TaskServiceTypes } from './modules/task/types';
|
|
13
15
|
export { ENUM as PROMOTION_ENUM } from './enum';
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROMOTION_ENUM = exports.jobService = exports.pointsMallService = exports.pricingCalculationService = exports.configService = exports.couponService = exports.awardService = void 0;
|
|
3
|
+
exports.PROMOTION_ENUM = exports.taskService = exports.jobService = exports.pointsMallService = exports.pricingCalculationService = exports.configService = exports.couponService = exports.awardService = void 0;
|
|
4
4
|
var service_1 = require("./modules/award/service");
|
|
5
5
|
Object.defineProperty(exports, "awardService", { enumerable: true, get: function () { return service_1.awardService; } });
|
|
6
6
|
var service_2 = require("./modules/coupon/service");
|
|
@@ -13,6 +13,8 @@ var service_5 = require("./modules/pointsMall/service");
|
|
|
13
13
|
Object.defineProperty(exports, "pointsMallService", { enumerable: true, get: function () { return service_5.pointsMallService; } });
|
|
14
14
|
var service_6 = require("./modules/job/service");
|
|
15
15
|
Object.defineProperty(exports, "jobService", { enumerable: true, get: function () { return service_6.jobService; } });
|
|
16
|
+
var service_7 = require("./modules/task/service");
|
|
17
|
+
Object.defineProperty(exports, "taskService", { enumerable: true, get: function () { return service_7.taskService; } });
|
|
16
18
|
// 服务.模块.枚举名称.枚举值 示例: AWARD_ENUM.DISTRIBUTION_CHANNEL.ORDER
|
|
17
19
|
var enum_1 = require("./enum");
|
|
18
20
|
Object.defineProperty(exports, "PROMOTION_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
|
|
@@ -7,7 +7,6 @@ declare class AwardService extends BaseService implements Service.PrizeDistribut
|
|
|
7
7
|
liveRoomIssueCoupon(request: Service.Request.liveRoomIssueCoupon): Promise<Service.Response.distributePrize>;
|
|
8
8
|
queryLiveRoomDistributionStats(request: Service.Request.queryLiveRoomDistributionStats): Promise<Service.Response.queryLiveRoomDistributionStatsResponse>;
|
|
9
9
|
adminSingleIssueCoupon(request: Service.Request.adminSingleIssueCoupon): Promise<Service.Response.distributePrize>;
|
|
10
|
-
batchIssueCoupon(request: Service.Request.batchIssueCoupon): Promise<Service.Response.distributePrize>;
|
|
11
10
|
}
|
|
12
11
|
export declare const awardService: AwardService;
|
|
13
12
|
export default awardService;
|
package/modules/award/service.js
CHANGED
|
@@ -36,9 +36,6 @@ let AwardService = class AwardService extends BaseService_1.default {
|
|
|
36
36
|
adminSingleIssueCoupon(request) {
|
|
37
37
|
return (0, http_1.callApi)(this.getApiUrl(this.adminSingleIssueCoupon), request);
|
|
38
38
|
}
|
|
39
|
-
batchIssueCoupon(request) {
|
|
40
|
-
return (0, http_1.callApi)(this.getApiUrl(this.batchIssueCoupon), request);
|
|
41
|
-
}
|
|
42
39
|
};
|
|
43
40
|
__decorate([
|
|
44
41
|
(0, tsoa_1.OperationId)('发放奖励'),
|
|
@@ -65,11 +62,6 @@ __decorate([
|
|
|
65
62
|
(0, tsoa_1.Post)('admin-single-issue-coupon'),
|
|
66
63
|
__param(0, (0, tsoa_1.Body)())
|
|
67
64
|
], AwardService.prototype, "adminSingleIssueCoupon", null);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, tsoa_1.OperationId)('批量发放券'),
|
|
70
|
-
(0, tsoa_1.Post)('batch-issue-coupon'),
|
|
71
|
-
__param(0, (0, tsoa_1.Body)())
|
|
72
|
-
], AwardService.prototype, "batchIssueCoupon", null);
|
|
73
65
|
AwardService = __decorate([
|
|
74
66
|
(0, tsoa_1.Route)('award'),
|
|
75
67
|
(0, tsoa_1.Tags)('Award')
|
package/modules/award/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TaskServiceTypes } from '../..';
|
|
1
2
|
import { ENUM } from '../../enum';
|
|
2
3
|
export declare namespace Service {
|
|
3
4
|
namespace Entity {
|
|
@@ -127,34 +128,6 @@ export declare namespace Service {
|
|
|
127
128
|
/** 数量 */
|
|
128
129
|
quantity?: number;
|
|
129
130
|
}
|
|
130
|
-
/** 批量发放券请求项 */
|
|
131
|
-
interface batchIssueCouponItem {
|
|
132
|
-
/** 业务编号 */
|
|
133
|
-
bizNo: string;
|
|
134
|
-
/** 直播间ID */
|
|
135
|
-
liveRoomId: string;
|
|
136
|
-
/** 用户ID */
|
|
137
|
-
userId: string;
|
|
138
|
-
/** 优惠券ID */
|
|
139
|
-
couponId: string;
|
|
140
|
-
/** 数量 */
|
|
141
|
-
quantity: number;
|
|
142
|
-
/** 业务ID */
|
|
143
|
-
bizId: string;
|
|
144
|
-
/** 操作人ID */
|
|
145
|
-
operatorId: string;
|
|
146
|
-
/** 开始时间 */
|
|
147
|
-
startTime?: number;
|
|
148
|
-
/** 结束时间 */
|
|
149
|
-
endTime?: number;
|
|
150
|
-
}
|
|
151
|
-
/** 批量发放券 */
|
|
152
|
-
interface batchIssueCoupon {
|
|
153
|
-
/** 批量发放券请求列表 */
|
|
154
|
-
requests: batchIssueCouponItem[];
|
|
155
|
-
/** 发放渠道 */
|
|
156
|
-
getChannel: ENUM.AWARD_ENUM.DISTRIBUTION_CHANNEL;
|
|
157
|
-
}
|
|
158
131
|
}
|
|
159
132
|
namespace Response {
|
|
160
133
|
/** 发放奖励响应 */
|
|
@@ -163,6 +136,8 @@ export declare namespace Service {
|
|
|
163
136
|
success: boolean;
|
|
164
137
|
/** 失败原因 */
|
|
165
138
|
message?: string;
|
|
139
|
+
/** 失败详情 */
|
|
140
|
+
failureDetail?: TaskServiceTypes.Response.FailureListItem[];
|
|
166
141
|
}
|
|
167
142
|
/** 直播间积分&券发放统计响应 */
|
|
168
143
|
interface queryLiveRoomDistributionStatsResponse {
|
|
@@ -190,7 +165,5 @@ export declare namespace Service {
|
|
|
190
165
|
queryLiveRoomDistributionStats(request: Service.Request.queryLiveRoomDistributionStats, req: any): Promise<Service.Response.queryLiveRoomDistributionStatsResponse>;
|
|
191
166
|
/** 后台单个发券 */
|
|
192
167
|
adminSingleIssueCoupon(request: Service.Request.adminSingleIssueCoupon, req: any): Promise<Service.Response.distributePrize>;
|
|
193
|
-
/** 批量发放券 */
|
|
194
|
-
batchIssueCoupon(request: Service.Request.batchIssueCoupon, req: any): Promise<Service.Response.distributePrize>;
|
|
195
168
|
}
|
|
196
169
|
}
|
|
@@ -9,6 +9,7 @@ declare class PointsMallService extends BaseService implements Service.PointsMal
|
|
|
9
9
|
getProductDetail(request: Service.Request.getProductDetail): Promise<Service.Response.getProductDetail>;
|
|
10
10
|
queryEnabledAndOnlineProducts(request: Service.Request.queryEnabledAndOnlineProducts): Promise<Service.Response.queryEnabledAndOnlineProducts>;
|
|
11
11
|
getAvailableCouponCountForProduct(request: Service.Request.getAvailableCouponCountForProduct): Promise<Service.Response.getAvailableCouponCountForProduct>;
|
|
12
|
+
getConsumptionThresholdInfo(request: Service.Request.getConsumptionThresholdInfo): Promise<Service.Response.getConsumptionThresholdInfo>;
|
|
12
13
|
}
|
|
13
14
|
export declare const pointsMallService: PointsMallService;
|
|
14
15
|
export default pointsMallService;
|
|
@@ -42,6 +42,9 @@ let PointsMallService = class PointsMallService extends BaseService_1.default {
|
|
|
42
42
|
getAvailableCouponCountForProduct(request) {
|
|
43
43
|
return (0, http_1.callApi)(this.getApiUrl(this.getAvailableCouponCountForProduct), request);
|
|
44
44
|
}
|
|
45
|
+
getConsumptionThresholdInfo(request) {
|
|
46
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getConsumptionThresholdInfo), request);
|
|
47
|
+
}
|
|
45
48
|
};
|
|
46
49
|
__decorate([
|
|
47
50
|
(0, tsoa_1.OperationId)('批量创建积分商城商品'),
|
|
@@ -78,6 +81,11 @@ __decorate([
|
|
|
78
81
|
(0, tsoa_1.Post)('get-available-coupon-count-for-product'),
|
|
79
82
|
__param(0, (0, tsoa_1.Body)())
|
|
80
83
|
], PointsMallService.prototype, "getAvailableCouponCountForProduct", null);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, tsoa_1.OperationId)('查询商品消费门槛校验信息'),
|
|
86
|
+
(0, tsoa_1.Post)('get-consumption-threshold-info'),
|
|
87
|
+
__param(0, (0, tsoa_1.Body)())
|
|
88
|
+
], PointsMallService.prototype, "getConsumptionThresholdInfo", null);
|
|
81
89
|
PointsMallService = __decorate([
|
|
82
90
|
(0, tsoa_1.Route)('points-mall'),
|
|
83
91
|
(0, tsoa_1.Tags)('PointsMall')
|
|
@@ -23,6 +23,10 @@ export declare namespace Service {
|
|
|
23
23
|
enabled: number;
|
|
24
24
|
/** 排序权重 */
|
|
25
25
|
sortOrder: number;
|
|
26
|
+
/** 消费周期天数 */
|
|
27
|
+
consumptionPeriodDays: number;
|
|
28
|
+
/** 消费门槛金额(单位:分) */
|
|
29
|
+
consumptionThresholdAmount: number;
|
|
26
30
|
}
|
|
27
31
|
/** 后台管理列表 - 完整12个字段 */
|
|
28
32
|
interface AdminProductItem {
|
|
@@ -42,6 +46,8 @@ export declare namespace Service {
|
|
|
42
46
|
limitPerUser?: number;
|
|
43
47
|
pointsRequired: number;
|
|
44
48
|
couponRequired: number;
|
|
49
|
+
consumptionPeriodDays: number | null;
|
|
50
|
+
consumptionThresholdAmount: number | null;
|
|
45
51
|
productImage: string;
|
|
46
52
|
}
|
|
47
53
|
/** C端积分商城列表 - 精确7个字段 */
|
|
@@ -64,6 +70,8 @@ export declare namespace Service {
|
|
|
64
70
|
exchangeType: ENUM.POINT_MALL.ExchangeType;
|
|
65
71
|
enabled?: number;
|
|
66
72
|
sortOrder?: number;
|
|
73
|
+
consumptionPeriodDays?: number;
|
|
74
|
+
consumptionThresholdAmount?: number;
|
|
67
75
|
}
|
|
68
76
|
export interface CreateProduct extends BaseParams {
|
|
69
77
|
}
|
|
@@ -121,6 +129,13 @@ export declare namespace Service {
|
|
|
121
129
|
/** 是否开启 */
|
|
122
130
|
enabled?: number;
|
|
123
131
|
}
|
|
132
|
+
/** 查询商品消费门槛校验信息 */
|
|
133
|
+
export interface getConsumptionThresholdInfo {
|
|
134
|
+
/** 用户ID */
|
|
135
|
+
userId: string;
|
|
136
|
+
/** 商品ID */
|
|
137
|
+
productId: string;
|
|
138
|
+
}
|
|
124
139
|
export {};
|
|
125
140
|
}
|
|
126
141
|
namespace Response {
|
|
@@ -166,6 +181,17 @@ export declare namespace Service {
|
|
|
166
181
|
/** 可用优惠券数量 */
|
|
167
182
|
count: number;
|
|
168
183
|
}
|
|
184
|
+
/** 查询商品消费门槛校验信息响应 */
|
|
185
|
+
interface getConsumptionThresholdInfo {
|
|
186
|
+
/** 是否需要校验消费门槛 */
|
|
187
|
+
needValidation: boolean;
|
|
188
|
+
/** 消费金额(单位:分,不需要校验返回-1) */
|
|
189
|
+
consumptionAmount: number;
|
|
190
|
+
/** 门槛金额(单位:分,不需要校验返回-1) */
|
|
191
|
+
thresholdAmount: number;
|
|
192
|
+
/** 是否满足消费门槛 */
|
|
193
|
+
isThresholdMet: boolean;
|
|
194
|
+
}
|
|
169
195
|
}
|
|
170
196
|
interface PointsMallController {
|
|
171
197
|
/** 批量创建积分商城商品 */
|
|
@@ -182,5 +208,7 @@ export declare namespace Service {
|
|
|
182
208
|
queryEnabledAndOnlineProducts(request: Service.Request.queryEnabledAndOnlineProducts): Promise<Service.Response.queryEnabledAndOnlineProducts>;
|
|
183
209
|
/** 查询指定商品用户可用优惠券的数量 */
|
|
184
210
|
getAvailableCouponCountForProduct(request: Service.Request.getAvailableCouponCountForProduct): Promise<Service.Response.getAvailableCouponCountForProduct>;
|
|
211
|
+
/** 查询商品消费门槛校验信息 */
|
|
212
|
+
getConsumptionThresholdInfo(request: Service.Request.getConsumptionThresholdInfo): Promise<Service.Response.getConsumptionThresholdInfo>;
|
|
185
213
|
}
|
|
186
214
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Service } from './types';
|
|
2
|
+
import BaseService from '../BaseService';
|
|
3
|
+
declare class TaskService extends BaseService implements Service.BatchTaskController {
|
|
4
|
+
protected prefixUrl: string;
|
|
5
|
+
createBatchTask(request: Service.Request.createBatchTask): Promise<void>;
|
|
6
|
+
getBatchTaskList(request: Service.Request.getBatchTaskList): Promise<Service.Response.getBatchTaskList>;
|
|
7
|
+
getBatchTaskDetail(request: Service.Request.getBatchTaskDetail): Promise<Service.Response.getBatchTaskDetail>;
|
|
8
|
+
cancelBatchTask(request: Service.Request.cancelBatchTask): Promise<void>;
|
|
9
|
+
getFailureList(request: Service.Request.getFailureList): Promise<Service.Response.getFailureList>;
|
|
10
|
+
}
|
|
11
|
+
export declare const taskService: TaskService;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.taskService = void 0;
|
|
16
|
+
const tsoa_1 = require("tsoa");
|
|
17
|
+
const http_1 = require("../../utils/http");
|
|
18
|
+
const BaseService_1 = __importDefault(require("../BaseService"));
|
|
19
|
+
let TaskService = class TaskService extends BaseService_1.default {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.prefixUrl = '/task';
|
|
23
|
+
}
|
|
24
|
+
createBatchTask(request) {
|
|
25
|
+
return (0, http_1.callApi)(this.getApiUrl(this.createBatchTask), request);
|
|
26
|
+
}
|
|
27
|
+
getBatchTaskList(request) {
|
|
28
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getBatchTaskList), request);
|
|
29
|
+
}
|
|
30
|
+
getBatchTaskDetail(request) {
|
|
31
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getBatchTaskDetail), request);
|
|
32
|
+
}
|
|
33
|
+
cancelBatchTask(request) {
|
|
34
|
+
return (0, http_1.callApi)(this.getApiUrl(this.cancelBatchTask), request);
|
|
35
|
+
}
|
|
36
|
+
getFailureList(request) {
|
|
37
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getFailureList), request);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, tsoa_1.OperationId)('创建批量任务'),
|
|
42
|
+
(0, tsoa_1.Post)('create-batch-task'),
|
|
43
|
+
__param(0, (0, tsoa_1.Body)())
|
|
44
|
+
], TaskService.prototype, "createBatchTask", null);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, tsoa_1.OperationId)('获取批量任务列表'),
|
|
47
|
+
(0, tsoa_1.Post)('get-batch-task-list'),
|
|
48
|
+
__param(0, (0, tsoa_1.Body)())
|
|
49
|
+
], TaskService.prototype, "getBatchTaskList", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, tsoa_1.OperationId)('获取批量任务详情'),
|
|
52
|
+
(0, tsoa_1.Post)('get-batch-task-detail'),
|
|
53
|
+
__param(0, (0, tsoa_1.Body)())
|
|
54
|
+
], TaskService.prototype, "getBatchTaskDetail", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, tsoa_1.OperationId)('撤回批量任务'),
|
|
57
|
+
(0, tsoa_1.Post)('cancel-batch-task'),
|
|
58
|
+
__param(0, (0, tsoa_1.Body)())
|
|
59
|
+
], TaskService.prototype, "cancelBatchTask", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, tsoa_1.OperationId)('获取失败名单'),
|
|
62
|
+
(0, tsoa_1.Post)('get-failure-list'),
|
|
63
|
+
__param(0, (0, tsoa_1.Body)())
|
|
64
|
+
], TaskService.prototype, "getFailureList", null);
|
|
65
|
+
TaskService = __decorate([
|
|
66
|
+
(0, tsoa_1.Route)('task'),
|
|
67
|
+
(0, tsoa_1.Tags)('Task')
|
|
68
|
+
], TaskService);
|
|
69
|
+
exports.taskService = new TaskService();
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { ENUM } from '../../enum';
|
|
2
|
+
export declare namespace Service {
|
|
3
|
+
namespace Entity {
|
|
4
|
+
/** 批量任务基础信息 */
|
|
5
|
+
interface BatchTask {
|
|
6
|
+
/** 任务ID */
|
|
7
|
+
id: string;
|
|
8
|
+
/** 任务名称 */
|
|
9
|
+
taskName: string;
|
|
10
|
+
/** 变动类型:增加/发放/扣减/作废 */
|
|
11
|
+
changeType: ENUM.TASK_ENUM.CHANGE_TYPE;
|
|
12
|
+
/** 资产类型:积分/优惠券 */
|
|
13
|
+
assetType: ENUM.TASK_ENUM.ASSET_TYPE;
|
|
14
|
+
/** 资产ID(券ID或积分类型标识) */
|
|
15
|
+
assetId?: string;
|
|
16
|
+
/** 变动数量 */
|
|
17
|
+
changeAmount: number;
|
|
18
|
+
/** 变动人数 */
|
|
19
|
+
changeUserCount: number;
|
|
20
|
+
/** 成功数量 */
|
|
21
|
+
successCount: number;
|
|
22
|
+
/** 失败数量 */
|
|
23
|
+
failureCount: number;
|
|
24
|
+
/** Excel文件URL(COS链接) */
|
|
25
|
+
fileUrl: string;
|
|
26
|
+
/** 任务状态 */
|
|
27
|
+
status: ENUM.TASK_ENUM.TASK_STATUS;
|
|
28
|
+
/** 操作人ID */
|
|
29
|
+
operatorId: string;
|
|
30
|
+
/** 操作人姓名 */
|
|
31
|
+
operatorName: string;
|
|
32
|
+
/** 创建时间 */
|
|
33
|
+
createdAt: number;
|
|
34
|
+
/** 更新时间 */
|
|
35
|
+
updatedAt: number;
|
|
36
|
+
/** 失败详情(JSON字符串) */
|
|
37
|
+
failureDetail?: string;
|
|
38
|
+
}
|
|
39
|
+
/** 批量任务详情项 */
|
|
40
|
+
interface BatchTaskDetail {
|
|
41
|
+
/** 用户ID */
|
|
42
|
+
userId: string;
|
|
43
|
+
/** 变动数量 */
|
|
44
|
+
amount: number;
|
|
45
|
+
/** 处理状态 */
|
|
46
|
+
status: ENUM.TASK_ENUM.DETAIL_STATUS;
|
|
47
|
+
/** 失败原因 */
|
|
48
|
+
failureReason?: string;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
namespace Request {
|
|
52
|
+
/** 创建批量任务 */
|
|
53
|
+
interface createBatchTask {
|
|
54
|
+
/** 任务名称 */
|
|
55
|
+
taskName: string;
|
|
56
|
+
/** 变动类型:增加/发放/扣减/作废 */
|
|
57
|
+
changeType: ENUM.TASK_ENUM.CHANGE_TYPE;
|
|
58
|
+
/** 资产类型:积分/优惠券 */
|
|
59
|
+
assetType: ENUM.TASK_ENUM.ASSET_TYPE;
|
|
60
|
+
/** 资产ID(券ID,积分类型可不填) */
|
|
61
|
+
assetId?: string;
|
|
62
|
+
/** 创建原因 */
|
|
63
|
+
reason: string;
|
|
64
|
+
/** Excel文件URL(COS链接) */
|
|
65
|
+
fileUrl: string;
|
|
66
|
+
}
|
|
67
|
+
/** 批量任务列表查询 */
|
|
68
|
+
interface getBatchTaskList {
|
|
69
|
+
/** 页码 */
|
|
70
|
+
pageIndex?: number;
|
|
71
|
+
/** 每页数量 */
|
|
72
|
+
pageSize?: number;
|
|
73
|
+
/** 任务ID */
|
|
74
|
+
taskId?: string;
|
|
75
|
+
/** 任务名称(模糊查询) */
|
|
76
|
+
taskName?: string;
|
|
77
|
+
/** 变动类型 */
|
|
78
|
+
changeType?: ENUM.TASK_ENUM.CHANGE_TYPE;
|
|
79
|
+
/** 资产类型 */
|
|
80
|
+
assetType?: ENUM.TASK_ENUM.ASSET_TYPE;
|
|
81
|
+
/** 任务状态 */
|
|
82
|
+
status?: ENUM.TASK_ENUM.TASK_STATUS;
|
|
83
|
+
}
|
|
84
|
+
/** 获取批量任务详情 */
|
|
85
|
+
interface getBatchTaskDetail {
|
|
86
|
+
/** 任务ID */
|
|
87
|
+
taskId: string;
|
|
88
|
+
}
|
|
89
|
+
/** 撤回批量任务 */
|
|
90
|
+
interface cancelBatchTask {
|
|
91
|
+
/** 任务ID */
|
|
92
|
+
taskId: string;
|
|
93
|
+
}
|
|
94
|
+
/** 获取失败名单 */
|
|
95
|
+
interface getFailureList {
|
|
96
|
+
/** 任务ID */
|
|
97
|
+
taskId: string;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
namespace Response {
|
|
101
|
+
/** 批量任务列表项 */
|
|
102
|
+
interface BatchTaskListItem {
|
|
103
|
+
/** 任务ID */
|
|
104
|
+
id: string;
|
|
105
|
+
/** 任务名称 */
|
|
106
|
+
taskName: string;
|
|
107
|
+
/** 变动类型 */
|
|
108
|
+
changeType: ENUM.TASK_ENUM.CHANGE_TYPE;
|
|
109
|
+
/** 变动类型中文 */
|
|
110
|
+
changeTypeChinese: string;
|
|
111
|
+
/** 资产类型 */
|
|
112
|
+
assetType: ENUM.TASK_ENUM.ASSET_TYPE;
|
|
113
|
+
/** 资产类型中文 */
|
|
114
|
+
assetTypeChinese: string;
|
|
115
|
+
/** 变动人数 */
|
|
116
|
+
changeUserCount: number;
|
|
117
|
+
/** 成功数/失败数 */
|
|
118
|
+
successCount: number;
|
|
119
|
+
failureCount: number;
|
|
120
|
+
/** 操作人 */
|
|
121
|
+
operatorId: string;
|
|
122
|
+
/** 创建时间 */
|
|
123
|
+
createdAt: number;
|
|
124
|
+
/** 任务状态 */
|
|
125
|
+
status: ENUM.TASK_ENUM.TASK_STATUS;
|
|
126
|
+
/** 任务状态中文 */
|
|
127
|
+
statusChinese: string;
|
|
128
|
+
}
|
|
129
|
+
/** 批量任务列表响应 */
|
|
130
|
+
interface getBatchTaskList {
|
|
131
|
+
/** 总数 */
|
|
132
|
+
total: number;
|
|
133
|
+
/** 任务列表 */
|
|
134
|
+
list: BatchTaskListItem[];
|
|
135
|
+
/** 当前页码 */
|
|
136
|
+
pageIndex: number;
|
|
137
|
+
/** 每页数量 */
|
|
138
|
+
pageSize: number;
|
|
139
|
+
}
|
|
140
|
+
/** 批量任务详情响应 */
|
|
141
|
+
interface getBatchTaskDetail {
|
|
142
|
+
/** 任务ID */
|
|
143
|
+
id: string;
|
|
144
|
+
/** 任务名称 */
|
|
145
|
+
taskName: string;
|
|
146
|
+
/** 变动类型 */
|
|
147
|
+
changeType: ENUM.TASK_ENUM.CHANGE_TYPE;
|
|
148
|
+
/** 变动类型中文 */
|
|
149
|
+
changeTypeChinese: string;
|
|
150
|
+
/** 资产类型 */
|
|
151
|
+
assetType: ENUM.TASK_ENUM.ASSET_TYPE;
|
|
152
|
+
/** 资产类型中文 */
|
|
153
|
+
assetTypeChinese: string;
|
|
154
|
+
/** 资产ID */
|
|
155
|
+
assetId?: string;
|
|
156
|
+
/** 资产名称 */
|
|
157
|
+
assetName?: string;
|
|
158
|
+
/** 变动人数 */
|
|
159
|
+
changeUserCount: number;
|
|
160
|
+
/** 成功数/失败数 */
|
|
161
|
+
successCount: number;
|
|
162
|
+
failureCount: number;
|
|
163
|
+
/** Excel文件URL */
|
|
164
|
+
fileUrl: string;
|
|
165
|
+
/** 操作人 */
|
|
166
|
+
operatorId: string;
|
|
167
|
+
/** 创建时间 */
|
|
168
|
+
createdAt: number;
|
|
169
|
+
/** 更新时间 */
|
|
170
|
+
updatedAt: number;
|
|
171
|
+
/** 任务状态 */
|
|
172
|
+
status: ENUM.TASK_ENUM.TASK_STATUS;
|
|
173
|
+
/** 任务状态中文 */
|
|
174
|
+
statusChinese: string;
|
|
175
|
+
}
|
|
176
|
+
/** 失败名单项 */
|
|
177
|
+
interface FailureListItem {
|
|
178
|
+
/** 用户ID */
|
|
179
|
+
userId: string;
|
|
180
|
+
/** 变动数量 */
|
|
181
|
+
amount: number;
|
|
182
|
+
/** 失败原因 */
|
|
183
|
+
failureReason: string;
|
|
184
|
+
}
|
|
185
|
+
/** 失败名单响应 */
|
|
186
|
+
interface getFailureList {
|
|
187
|
+
/** 表头 */
|
|
188
|
+
headerMap: Record<string, string>;
|
|
189
|
+
/** 数据 */
|
|
190
|
+
data: Record<string, any>[];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
interface BatchTaskController {
|
|
194
|
+
/** 创建批量任务 */
|
|
195
|
+
createBatchTask(request: Service.Request.createBatchTask, req: any): Promise<void>;
|
|
196
|
+
/** 获取批量任务列表 */
|
|
197
|
+
getBatchTaskList(request: Service.Request.getBatchTaskList, req: any): Promise<Service.Response.getBatchTaskList>;
|
|
198
|
+
/** 获取批量任务详情 */
|
|
199
|
+
getBatchTaskDetail(request: Service.Request.getBatchTaskDetail, req: any): Promise<Service.Response.getBatchTaskDetail>;
|
|
200
|
+
/** 撤回批量任务 */
|
|
201
|
+
cancelBatchTask(request: Service.Request.cancelBatchTask, req: any): Promise<void>;
|
|
202
|
+
/** 获取失败名单 */
|
|
203
|
+
getFailureList(request: Service.Request.getFailureList, req: any): Promise<Service.Response.getFailureList>;
|
|
204
|
+
}
|
|
205
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/ecommerce-promotion-service-node-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "EcommercePromotionService Node.js SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"axios": "1.13.2",
|
|
15
15
|
"axios-retry": "4.0.0",
|
|
16
16
|
"uuid": "9.0.1",
|
|
17
|
-
"tsoa": "
|
|
17
|
+
"tsoa": "6.6.0",
|
|
18
18
|
"safe-stable-stringify": "2.5.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|