@be-link/ecommerce-promotion-service-node-sdk 0.0.17 → 0.0.19
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 +13 -0
- package/enum.js +15 -0
- package/modules/pointsMall/service.d.ts +1 -0
- package/modules/pointsMall/service.js +8 -0
- package/modules/pointsMall/types.d.ts +77 -65
- package/modules/pointsMall/types.js +0 -17
- package/package.json +1 -1
package/enum.d.ts
CHANGED
|
@@ -418,4 +418,17 @@ export declare namespace ENUM {
|
|
|
418
418
|
POINTS_AMOUNT_NOT_ENOUGH = "\u79EF\u5206\u6570\u91CF\u4E0D\u8DB3"
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
+
namespace POINT_MALL {
|
|
422
|
+
/** 兑换类型 */
|
|
423
|
+
enum ExchangeType {
|
|
424
|
+
/** 仅积分 */
|
|
425
|
+
POINTS_ONLY = "POINTS_ONLY",
|
|
426
|
+
/** 仅券 */
|
|
427
|
+
COUPON_ONLY = "COUPON_ONLY",
|
|
428
|
+
/** 积分+券 */
|
|
429
|
+
POINTS_AND_COUPON = "POINTS_AND_COUPON",
|
|
430
|
+
/** 其他 */
|
|
431
|
+
OTHER = "OTHER"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
421
434
|
}
|
package/enum.js
CHANGED
|
@@ -472,4 +472,19 @@ var ENUM;
|
|
|
472
472
|
INVALID_CODE_CHINESE["POINTS_AMOUNT_NOT_ENOUGH"] = "\u79EF\u5206\u6570\u91CF\u4E0D\u8DB3";
|
|
473
473
|
})(INVALID_CODE_CHINESE = PRICING_CALCULATION_ENUM.INVALID_CODE_CHINESE || (PRICING_CALCULATION_ENUM.INVALID_CODE_CHINESE = {}));
|
|
474
474
|
})(PRICING_CALCULATION_ENUM = ENUM.PRICING_CALCULATION_ENUM || (ENUM.PRICING_CALCULATION_ENUM = {}));
|
|
475
|
+
let POINT_MALL;
|
|
476
|
+
(function (POINT_MALL) {
|
|
477
|
+
/** 兑换类型 */
|
|
478
|
+
let ExchangeType;
|
|
479
|
+
(function (ExchangeType) {
|
|
480
|
+
/** 仅积分 */
|
|
481
|
+
ExchangeType["POINTS_ONLY"] = "POINTS_ONLY";
|
|
482
|
+
/** 仅券 */
|
|
483
|
+
ExchangeType["COUPON_ONLY"] = "COUPON_ONLY";
|
|
484
|
+
/** 积分+券 */
|
|
485
|
+
ExchangeType["POINTS_AND_COUPON"] = "POINTS_AND_COUPON";
|
|
486
|
+
/** 其他 */
|
|
487
|
+
ExchangeType["OTHER"] = "OTHER";
|
|
488
|
+
})(ExchangeType = POINT_MALL.ExchangeType || (POINT_MALL.ExchangeType = {}));
|
|
489
|
+
})(POINT_MALL = ENUM.POINT_MALL || (ENUM.POINT_MALL = {}));
|
|
475
490
|
})(ENUM || (exports.ENUM = ENUM = {}));
|
|
@@ -8,6 +8,7 @@ declare class PointsMallService extends BaseService implements Service.PointsMal
|
|
|
8
8
|
batchToggleProductOnline(request: Service.Request.batchToggleProductOnline): Promise<void>;
|
|
9
9
|
queryProducts(request: Service.Request.queryProducts): Promise<Service.Response.queryProducts>;
|
|
10
10
|
getProductDetail(request: Service.Request.getProductDetail): Promise<Service.Response.getProductDetail>;
|
|
11
|
+
queryEnabledAndOnlineProducts(request: Service.Request.queryEnabledAndOnlineProducts): Promise<Service.Response.queryEnabledAndOnlineProducts>;
|
|
11
12
|
}
|
|
12
13
|
export declare const pointsMallService: PointsMallService;
|
|
13
14
|
export default pointsMallService;
|
|
@@ -39,6 +39,9 @@ let PointsMallService = class PointsMallService extends BaseService_1.default {
|
|
|
39
39
|
getProductDetail(request) {
|
|
40
40
|
return (0, http_1.callApi)(this.getApiUrl(this.getProductDetail), request);
|
|
41
41
|
}
|
|
42
|
+
queryEnabledAndOnlineProducts(request) {
|
|
43
|
+
return (0, http_1.callApi)(this.getApiUrl(this.queryEnabledAndOnlineProducts), request);
|
|
44
|
+
}
|
|
42
45
|
};
|
|
43
46
|
__decorate([
|
|
44
47
|
(0, tsoa_1.OperationId)('批量创建积分商城商品'),
|
|
@@ -70,6 +73,11 @@ __decorate([
|
|
|
70
73
|
(0, tsoa_1.Post)('get-product-detail'),
|
|
71
74
|
__param(0, (0, tsoa_1.Body)())
|
|
72
75
|
], PointsMallService.prototype, "getProductDetail", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, tsoa_1.OperationId)('查询开启且上架的积分商城列表'),
|
|
78
|
+
(0, tsoa_1.Post)('query-enabled-and-online-products'),
|
|
79
|
+
__param(0, (0, tsoa_1.Body)())
|
|
80
|
+
], PointsMallService.prototype, "queryEnabledAndOnlineProducts", null);
|
|
73
81
|
PointsMallService = __decorate([
|
|
74
82
|
(0, tsoa_1.Route)('points-mall'),
|
|
75
83
|
(0, tsoa_1.Tags)('PointsMall')
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
+
import { ENUM } from '../../enum';
|
|
1
2
|
export declare namespace Service {
|
|
2
|
-
/** 兑换类型 */
|
|
3
|
-
enum ExchangeType {
|
|
4
|
-
/** 仅积分 */
|
|
5
|
-
POINTS_ONLY = "POINTS_ONLY",
|
|
6
|
-
/** 仅券 */
|
|
7
|
-
COUPON_ONLY = "COUPON_ONLY",
|
|
8
|
-
/** 积分+券 */
|
|
9
|
-
POINTS_AND_COUPON = "POINTS_AND_COUPON",
|
|
10
|
-
/** 其他 */
|
|
11
|
-
OTHER = "OTHER"
|
|
12
|
-
}
|
|
13
3
|
namespace Entity {
|
|
14
4
|
/** 商品积分兑换配置 */
|
|
15
5
|
interface ProductPointExchange {
|
|
@@ -28,7 +18,7 @@ export declare namespace Service {
|
|
|
28
18
|
/** 所需积分的数量 */
|
|
29
19
|
pointsRequired: number;
|
|
30
20
|
/** 兑换类型 */
|
|
31
|
-
exchangeType: ExchangeType;
|
|
21
|
+
exchangeType: ENUM.POINT_MALL.ExchangeType;
|
|
32
22
|
/** 是否开启 */
|
|
33
23
|
enabled: boolean;
|
|
34
24
|
/** 是否上架 */
|
|
@@ -36,88 +26,97 @@ export declare namespace Service {
|
|
|
36
26
|
/** 排序权重 */
|
|
37
27
|
sortOrder: number;
|
|
38
28
|
}
|
|
29
|
+
/** 后台管理列表 - 完整12个字段 */
|
|
30
|
+
interface AdminProductItem {
|
|
31
|
+
id: string;
|
|
32
|
+
sortOrder: number;
|
|
33
|
+
productName: string;
|
|
34
|
+
productId: string;
|
|
35
|
+
skuSpecs: string[];
|
|
36
|
+
salePrice: number;
|
|
37
|
+
online: boolean;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
exchangeType: ENUM.POINT_MALL.ExchangeType;
|
|
40
|
+
stock: number;
|
|
41
|
+
limitPerUser?: number;
|
|
42
|
+
pointsRequired: number;
|
|
43
|
+
couponRequired: number;
|
|
44
|
+
productImage: string;
|
|
45
|
+
}
|
|
46
|
+
/** C端积分商城列表 - 精确7个字段 */
|
|
47
|
+
interface ClientProductItem {
|
|
48
|
+
id: string;
|
|
49
|
+
sortOrder: number;
|
|
50
|
+
productName: string;
|
|
51
|
+
productId: string;
|
|
52
|
+
productImage: string;
|
|
53
|
+
exchangeType: ENUM.POINT_MALL.ExchangeType;
|
|
54
|
+
pointsRequired: number;
|
|
55
|
+
couponRequired: number;
|
|
56
|
+
}
|
|
39
57
|
}
|
|
40
58
|
namespace Request {
|
|
41
|
-
|
|
42
|
-
interface createProduct {
|
|
43
|
-
/** 商品ID */
|
|
59
|
+
interface BaseParams {
|
|
44
60
|
productId: string;
|
|
45
|
-
/** 所需券的数量 */
|
|
46
|
-
couponRequired?: number;
|
|
47
|
-
/** 所需积分的数量 */
|
|
48
61
|
pointsRequired?: number;
|
|
49
|
-
/** 兑换类型 */
|
|
50
|
-
exchangeType: ExchangeType;
|
|
51
|
-
/** 是否开启 */
|
|
52
|
-
enabled?: boolean;
|
|
53
|
-
/** 是否上架 */
|
|
54
|
-
online?: boolean;
|
|
55
|
-
/** 排序权重 */
|
|
56
|
-
sortOrder: number;
|
|
57
|
-
}
|
|
58
|
-
/** 编辑积分商城商品 */
|
|
59
|
-
interface updateProduct {
|
|
60
|
-
/** 主键ID */
|
|
61
|
-
id: string;
|
|
62
|
-
/** 商品ID */
|
|
63
|
-
productId?: string;
|
|
64
|
-
/** 所需券的数量 */
|
|
65
62
|
couponRequired?: number;
|
|
66
|
-
|
|
67
|
-
pointsRequired?: number;
|
|
68
|
-
/** 兑换类型 */
|
|
69
|
-
exchangeType?: ExchangeType;
|
|
70
|
-
/** 是否开启 */
|
|
71
|
-
enabled?: boolean;
|
|
72
|
-
/** 是否上架 */
|
|
63
|
+
exchangeType: ENUM.POINT_MALL.ExchangeType;
|
|
73
64
|
online?: boolean;
|
|
74
|
-
/** 排序权重 */
|
|
75
65
|
sortOrder?: number;
|
|
76
66
|
}
|
|
67
|
+
export interface CreateProduct extends BaseParams {
|
|
68
|
+
}
|
|
69
|
+
export interface UpdateProduct extends Partial<BaseParams> {
|
|
70
|
+
id: string;
|
|
71
|
+
}
|
|
77
72
|
/** 批量创建积分商城商品 */
|
|
78
|
-
interface batchCreateProducts {
|
|
79
|
-
|
|
80
|
-
items: createProduct[];
|
|
73
|
+
export interface batchCreateProducts {
|
|
74
|
+
items: CreateProduct[];
|
|
81
75
|
}
|
|
82
76
|
/** 批量编辑积分商城商品 */
|
|
83
|
-
interface batchUpdateProducts {
|
|
84
|
-
|
|
85
|
-
items: updateProduct[];
|
|
77
|
+
export interface batchUpdateProducts {
|
|
78
|
+
items: UpdateProduct[];
|
|
86
79
|
}
|
|
87
80
|
/** 批量是否开启 */
|
|
88
|
-
interface batchToggleProductEnabled {
|
|
81
|
+
export interface batchToggleProductEnabled {
|
|
89
82
|
/** 主键ID列表 */
|
|
90
83
|
ids: string[];
|
|
91
84
|
/** 是否开启 */
|
|
92
85
|
enabled: boolean;
|
|
93
86
|
}
|
|
94
87
|
/** 批量是否上下架 */
|
|
95
|
-
interface batchToggleProductOnline {
|
|
88
|
+
export interface batchToggleProductOnline {
|
|
96
89
|
/** 主键ID列表 */
|
|
97
90
|
ids: string[];
|
|
98
91
|
/** 是否上架 */
|
|
99
92
|
online: boolean;
|
|
100
93
|
}
|
|
101
94
|
/** 根据条件查询积分商城商品 */
|
|
102
|
-
interface queryProducts {
|
|
103
|
-
/** 搜索关键词(商品名称或商品ID) */
|
|
104
|
-
keyword?: string;
|
|
95
|
+
export interface queryProducts {
|
|
105
96
|
/** 商品ID */
|
|
106
97
|
productIds?: string[];
|
|
107
|
-
/**
|
|
108
|
-
online?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
enabled?: boolean;
|
|
98
|
+
/** 是否上架,传null/undefined表示不筛选 */
|
|
99
|
+
online?: boolean | null | undefined;
|
|
100
|
+
/** 是否开启,传null/undefined表示不筛选 */
|
|
101
|
+
enabled?: boolean | null | undefined;
|
|
102
|
+
/** 页码 */
|
|
103
|
+
page?: number;
|
|
104
|
+
/** 每页数量 */
|
|
105
|
+
pageSize?: number;
|
|
106
|
+
}
|
|
107
|
+
/** 查询开启且上架的积分商城列表 */
|
|
108
|
+
export interface queryEnabledAndOnlineProducts {
|
|
111
109
|
/** 页码 */
|
|
112
110
|
page?: number;
|
|
113
111
|
/** 每页数量 */
|
|
114
112
|
pageSize?: number;
|
|
115
113
|
}
|
|
116
114
|
/** 根据商品ID查询商品详情 */
|
|
117
|
-
interface getProductDetail {
|
|
115
|
+
export interface getProductDetail {
|
|
118
116
|
/** 商品ID */
|
|
119
117
|
productId: string;
|
|
120
118
|
}
|
|
119
|
+
export {};
|
|
121
120
|
}
|
|
122
121
|
namespace Response {
|
|
123
122
|
/** 创建积分商城商品响应 */
|
|
@@ -133,7 +132,7 @@ export declare namespace Service {
|
|
|
133
132
|
/** 查询积分商城商品响应 */
|
|
134
133
|
interface queryProducts {
|
|
135
134
|
/** 商品列表 */
|
|
136
|
-
items: Entity.
|
|
135
|
+
items: Entity.AdminProductItem[];
|
|
137
136
|
/** 总数 */
|
|
138
137
|
total: number;
|
|
139
138
|
/** 当前页码 */
|
|
@@ -146,19 +145,32 @@ export declare namespace Service {
|
|
|
146
145
|
/** 商品详情 */
|
|
147
146
|
data: Entity.ProductPointExchange;
|
|
148
147
|
}
|
|
148
|
+
/** 查询开启且上架的积分商城列表响应 */
|
|
149
|
+
interface queryEnabledAndOnlineProducts {
|
|
150
|
+
/** 商品列表 */
|
|
151
|
+
items: Entity.ClientProductItem[];
|
|
152
|
+
/** 总数 */
|
|
153
|
+
total: number;
|
|
154
|
+
/** 当前页码 */
|
|
155
|
+
page: number;
|
|
156
|
+
/** 每页数量 */
|
|
157
|
+
pageSize: number;
|
|
158
|
+
}
|
|
149
159
|
}
|
|
150
160
|
interface PointsMallController {
|
|
151
161
|
/** 批量创建积分商城商品 */
|
|
152
|
-
batchCreateProducts(request: Service.Request.batchCreateProducts
|
|
162
|
+
batchCreateProducts(request: Service.Request.batchCreateProducts): Promise<Service.Response.batchCreateProducts>;
|
|
153
163
|
/** 批量编辑积分商城商品 */
|
|
154
|
-
batchUpdateProducts(request: Service.Request.batchUpdateProducts
|
|
164
|
+
batchUpdateProducts(request: Service.Request.batchUpdateProducts): Promise<void>;
|
|
155
165
|
/** 批量是否开启 */
|
|
156
|
-
batchToggleProductEnabled(request: Service.Request.batchToggleProductEnabled
|
|
166
|
+
batchToggleProductEnabled(request: Service.Request.batchToggleProductEnabled): Promise<void>;
|
|
157
167
|
/** 批量是否上下架 */
|
|
158
|
-
batchToggleProductOnline(request: Service.Request.batchToggleProductOnline
|
|
168
|
+
batchToggleProductOnline(request: Service.Request.batchToggleProductOnline): Promise<void>;
|
|
159
169
|
/** 根据条件查询积分商城商品 */
|
|
160
|
-
queryProducts(request: Service.Request.queryProducts
|
|
170
|
+
queryProducts(request: Service.Request.queryProducts): Promise<Service.Response.queryProducts>;
|
|
161
171
|
/** 根据商品ID查询商品详情 */
|
|
162
|
-
getProductDetail(request: Service.Request.getProductDetail
|
|
172
|
+
getProductDetail(request: Service.Request.getProductDetail): Promise<Service.Response.getProductDetail>;
|
|
173
|
+
/** 查询开启且上架的积分商城列表 */
|
|
174
|
+
queryEnabledAndOnlineProducts(request: Service.Request.queryEnabledAndOnlineProducts): Promise<Service.Response.queryEnabledAndOnlineProducts>;
|
|
163
175
|
}
|
|
164
176
|
}
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Service = void 0;
|
|
4
|
-
var Service;
|
|
5
|
-
(function (Service) {
|
|
6
|
-
// ==================== 枚举类型 ====================
|
|
7
|
-
/** 兑换类型 */
|
|
8
|
-
let ExchangeType;
|
|
9
|
-
(function (ExchangeType) {
|
|
10
|
-
/** 仅积分 */
|
|
11
|
-
ExchangeType["POINTS_ONLY"] = "POINTS_ONLY";
|
|
12
|
-
/** 仅券 */
|
|
13
|
-
ExchangeType["COUPON_ONLY"] = "COUPON_ONLY";
|
|
14
|
-
/** 积分+券 */
|
|
15
|
-
ExchangeType["POINTS_AND_COUPON"] = "POINTS_AND_COUPON";
|
|
16
|
-
/** 其他 */
|
|
17
|
-
ExchangeType["OTHER"] = "OTHER";
|
|
18
|
-
})(ExchangeType = Service.ExchangeType || (Service.ExchangeType = {}));
|
|
19
|
-
})(Service || (exports.Service = Service = {}));
|