@be-link/ecommerce-promotion-service-node-sdk 0.0.1

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/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # EcommercePromotionService SDK
2
+
3
+ EcommercePromotionService Node.js SDK - 敏感信息管理服务客户端
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @be-link/ecommerce-promotion-service-node-sdk
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ ```typescript
14
+ import { demoService } from '@be-link/ecommerce-promotion-service-node-sdk'
15
+
16
+ const result = await demoService.demoFunc({ /* 请求参数 */ })
17
+ ```
18
+
19
+ ## 开发
20
+
21
+ ```bash
22
+ # 构建
23
+ npm run build
24
+
25
+ # 生成 Swagger 文档
26
+ npm run swagger
27
+
28
+ # 构建并生成文档
29
+ npm run build:swagger
30
+ ```
31
+
32
+ ## Swagger 文档
33
+
34
+ 查看 [SWAGGER.md](./SWAGGER.md) 了解如何生成和使用 API 文档。
35
+
36
+ ## License
37
+
38
+ ISC
39
+
package/enum.d.ts ADDED
@@ -0,0 +1,219 @@
1
+ export declare namespace ENUM {
2
+ namespace AWARD_ENUM {
3
+ /** 发放渠道 */
4
+ enum DistributionChannel {
5
+ /** 下单 */
6
+ ORDER = "ORDER",
7
+ /** 任务 */
8
+ TASK = "TASK",
9
+ /** 直播间活动 */
10
+ ACTIVITY = "ACTIVITY",
11
+ /** 用户主动领取 */
12
+ USER = "USER"
13
+ }
14
+ /** 积分发放渠道 */
15
+ enum PointsIssueChannel {
16
+ /** 黑钻会员 */
17
+ MEMBER_ORDER = "MEMBER_ORDER",
18
+ /** 下单 */
19
+ ORDER = "ORDER",
20
+ /** 任务 */
21
+ TASK = "TASK",
22
+ /** 直播间活动 */
23
+ ACTIVITY = "ACTIVITY",
24
+ /** 用户主动领取 */
25
+ USER = "USER",
26
+ /** 手动发放 */
27
+ MANUAL = "MANUAL"
28
+ }
29
+ /** 发放状态 */
30
+ enum DistributionStatus {
31
+ /** 发放失败 */
32
+ FAILED = "Failed",
33
+ /** 发放成功 */
34
+ SUCCEED = "Succeed",
35
+ /** 作废成功 */
36
+ REVERSED = "Reversed",
37
+ /** 作废失败 */
38
+ REVERSE_FAILED = "ReverseFailed"
39
+ }
40
+ }
41
+ namespace POINTS_ENUM {
42
+ /** 积分发放渠道 */
43
+ enum PointsIssueChannel {
44
+ /** 会员等级 */
45
+ MEMBER_LEVEL = "MEMBER_LEVEL",
46
+ /** 黑钻会员 */
47
+ BLACK_DIAMOND = "BLACK_DIAMOND",
48
+ /** 下单 */
49
+ ORDER = "ORDER",
50
+ /** 任务 */
51
+ TASK = "TASK",
52
+ /** 直播间活动 */
53
+ ACTIVITY = "ACTIVITY",
54
+ /** 用户主动领取 */
55
+ USER = "USER",
56
+ /** 手动发放 */
57
+ MANUAL = "MANUAL"
58
+ }
59
+ /** 积分发放状态 */
60
+ enum PointsIssueStatus {
61
+ /** 已发放 */
62
+ ISSUED = "ISSUED",
63
+ /** 已作废 */
64
+ ABANDONED = "ABANDONED"
65
+ }
66
+ }
67
+ namespace COUPON_ENUM {
68
+ /** 券类型 */
69
+ enum CouponType {
70
+ /** 优惠券 */
71
+ DISCOUNT = "DISCOUNT",
72
+ /** 兑换券 */
73
+ EXCHANGE = "EXCHANGE",
74
+ /** 核销券 */
75
+ VERIFY = "VERIFY"
76
+ }
77
+ /** 券状态 */
78
+ enum CouponStatus {
79
+ /** 可用 */
80
+ AVAILABLE = "AVAILABLE",
81
+ /** 作废 */
82
+ ABANDONED = "ABANDONED"
83
+ }
84
+ /** 领取限制类型 */
85
+ enum ReceiveLimitType {
86
+ /** 每人总张数 */
87
+ TOTAL = "TOTAL",
88
+ /** 每日 */
89
+ DAILY = "DAILY",
90
+ /** 每周 */
91
+ WEEKLY = "WEEKLY"
92
+ }
93
+ /** 优惠类型 */
94
+ enum DiscountRuleType {
95
+ /** 固定金额 */
96
+ FEE = "FEE",
97
+ /** 折扣 */
98
+ DISCOUNT = "DISCOUNT"
99
+ }
100
+ /** 优惠级别 */
101
+ enum DiscountLevel {
102
+ /** 单份商品 */
103
+ ITEM = "ITEM",
104
+ /** 整单 */
105
+ ORDER = "ORDER"
106
+ }
107
+ /** 操作类型 */
108
+ enum OperateType {
109
+ /** 作废 */
110
+ ABANDON = "ABANDON",
111
+ /** 增加库存 */
112
+ ADD_STOCK = "ADD_STOCK",
113
+ /** 扣减库存 */
114
+ DEDUCT_STOCK = "DEDUCT_STOCK",
115
+ /** 同步直播 */
116
+ SYNC_LIVE = "SYNC_LIVE"
117
+ }
118
+ /** 库存渠道 */
119
+ enum StockChannel {
120
+ /** 手动 */
121
+ MANUAL = "MANUAL",
122
+ /** 系统自动 */
123
+ SYSTEM = "SYSTEM"
124
+ }
125
+ /** 库存变动类型 */
126
+ enum StockChangeType {
127
+ /** 任务发券 */
128
+ TASK_ISSUE = "TASK_ISSUE",
129
+ /** 活动发券 */
130
+ ACTIVITY_ISSUE = "ACTIVITY_ISSUE",
131
+ /** 手动发券 */
132
+ MANUAL_ISSUE = "MANUAL_ISSUE",
133
+ /** 批量发券 */
134
+ BULK_MANUAL_ISSUE = "BULK_MANUAL_ISSUE",
135
+ /** 后台加券 */
136
+ MANUAL_ADD = "MANUAL_ADD",
137
+ /** 后台扣券 */
138
+ MANUAL_DEDUCT = "MANUAL_DEDUCT"
139
+ }
140
+ /** 券发放渠道 */
141
+ enum CouponIssueChannel {
142
+ /** 任务 */
143
+ TASK = "TASK",
144
+ /** 直播间活动 */
145
+ ACTIVITY = "ACTIVITY",
146
+ /** 用户主动领取 */
147
+ USER = "USER",
148
+ /** 手动发放 */
149
+ MANUAL = "MANUAL"
150
+ }
151
+ /** 券发放状态 */
152
+ enum IssueStatus {
153
+ /** 已发放 */
154
+ ISSUED = "ISSUED",
155
+ /** 已作废 */
156
+ ABANDONED = "ABANDONED"
157
+ }
158
+ /** 范围类型 */
159
+ enum ScopeType {
160
+ /** 商品组 */
161
+ SPU_GROUP = "SPU_GROUP",
162
+ /** Sku组 */
163
+ SKU_GROUP = "SKU_GROUP",
164
+ /** 单商品 */
165
+ SPU = "SPU",
166
+ /** 单sku */
167
+ SKU = "SKU"
168
+ }
169
+ /** 使用限制类型 */
170
+ enum UsageLimitType {
171
+ /** 金额 */
172
+ FEE = "FEE"
173
+ }
174
+ }
175
+ namespace PRICING_CALCULATION_ENUM {
176
+ /** 订单来源 */
177
+ enum OrderSource {
178
+ /** 直播订单 */
179
+ LIVE = "LIVE",
180
+ /** 积分商城订单 */
181
+ POINTS = "POINTS",
182
+ /** 会员订单 */
183
+ MEMBER = "MEMBER",
184
+ /** 商详分享下单 */
185
+ DETAIL_SHARE = "DETAIL_SHARE"
186
+ }
187
+ /** 平台 */
188
+ enum Platform {
189
+ /** APP */
190
+ APP = "APP",
191
+ /** H5 */
192
+ H5 = "H5",
193
+ /** 小程序 */
194
+ MINI = "MINI"
195
+ }
196
+ /** 券类型 */
197
+ enum CouponType {
198
+ /** 优惠券 */
199
+ DISCOUNT = "DISCOUNT",
200
+ /** 兑换券 */
201
+ EXCHANGE = "EXCHANGE",
202
+ /** 核销券 */
203
+ VERIFY = "VERIFY"
204
+ }
205
+ /** 券状态 */
206
+ enum CouponStatus {
207
+ /** 未使用 */
208
+ UNUSED = "UNUSED",
209
+ /** 占用 */
210
+ OCCUPIED = "OCCUPIED",
211
+ /** 已使用 */
212
+ USED = "USED",
213
+ /** 已过期 */
214
+ EXPIRED = "EXPIRED",
215
+ /** 已作废 */
216
+ INVALID = "INVALID"
217
+ }
218
+ }
219
+ }
package/enum.js ADDED
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENUM = void 0;
4
+ var ENUM;
5
+ (function (ENUM) {
6
+ let AWARD_ENUM;
7
+ (function (AWARD_ENUM) {
8
+ /** 发放渠道 */
9
+ let DistributionChannel;
10
+ (function (DistributionChannel) {
11
+ /** 下单 */
12
+ DistributionChannel["ORDER"] = "ORDER";
13
+ /** 任务 */
14
+ DistributionChannel["TASK"] = "TASK";
15
+ /** 直播间活动 */
16
+ DistributionChannel["ACTIVITY"] = "ACTIVITY";
17
+ /** 用户主动领取 */
18
+ DistributionChannel["USER"] = "USER";
19
+ })(DistributionChannel = AWARD_ENUM.DistributionChannel || (AWARD_ENUM.DistributionChannel = {}));
20
+ /** 积分发放渠道 */
21
+ let PointsIssueChannel;
22
+ (function (PointsIssueChannel) {
23
+ /** 黑钻会员 */
24
+ PointsIssueChannel["MEMBER_ORDER"] = "MEMBER_ORDER";
25
+ /** 下单 */
26
+ PointsIssueChannel["ORDER"] = "ORDER";
27
+ /** 任务 */
28
+ PointsIssueChannel["TASK"] = "TASK";
29
+ /** 直播间活动 */
30
+ PointsIssueChannel["ACTIVITY"] = "ACTIVITY";
31
+ /** 用户主动领取 */
32
+ PointsIssueChannel["USER"] = "USER";
33
+ /** 手动发放 */
34
+ PointsIssueChannel["MANUAL"] = "MANUAL";
35
+ })(PointsIssueChannel = AWARD_ENUM.PointsIssueChannel || (AWARD_ENUM.PointsIssueChannel = {}));
36
+ /** 发放状态 */
37
+ let DistributionStatus;
38
+ (function (DistributionStatus) {
39
+ /** 发放失败 */
40
+ DistributionStatus["FAILED"] = "Failed";
41
+ /** 发放成功 */
42
+ DistributionStatus["SUCCEED"] = "Succeed";
43
+ /** 作废成功 */
44
+ DistributionStatus["REVERSED"] = "Reversed";
45
+ /** 作废失败 */
46
+ DistributionStatus["REVERSE_FAILED"] = "ReverseFailed";
47
+ })(DistributionStatus = AWARD_ENUM.DistributionStatus || (AWARD_ENUM.DistributionStatus = {}));
48
+ })(AWARD_ENUM = ENUM.AWARD_ENUM || (ENUM.AWARD_ENUM = {}));
49
+ let POINTS_ENUM;
50
+ (function (POINTS_ENUM) {
51
+ /** 积分发放渠道 */
52
+ let PointsIssueChannel;
53
+ (function (PointsIssueChannel) {
54
+ /** 会员等级 */
55
+ PointsIssueChannel["MEMBER_LEVEL"] = "MEMBER_LEVEL";
56
+ /** 黑钻会员 */
57
+ PointsIssueChannel["BLACK_DIAMOND"] = "BLACK_DIAMOND";
58
+ /** 下单 */
59
+ PointsIssueChannel["ORDER"] = "ORDER";
60
+ /** 任务 */
61
+ PointsIssueChannel["TASK"] = "TASK";
62
+ /** 直播间活动 */
63
+ PointsIssueChannel["ACTIVITY"] = "ACTIVITY";
64
+ /** 用户主动领取 */
65
+ PointsIssueChannel["USER"] = "USER";
66
+ /** 手动发放 */
67
+ PointsIssueChannel["MANUAL"] = "MANUAL";
68
+ })(PointsIssueChannel = POINTS_ENUM.PointsIssueChannel || (POINTS_ENUM.PointsIssueChannel = {}));
69
+ /** 积分发放状态 */
70
+ let PointsIssueStatus;
71
+ (function (PointsIssueStatus) {
72
+ /** 已发放 */
73
+ PointsIssueStatus["ISSUED"] = "ISSUED";
74
+ /** 已作废 */
75
+ PointsIssueStatus["ABANDONED"] = "ABANDONED";
76
+ })(PointsIssueStatus = POINTS_ENUM.PointsIssueStatus || (POINTS_ENUM.PointsIssueStatus = {}));
77
+ })(POINTS_ENUM = ENUM.POINTS_ENUM || (ENUM.POINTS_ENUM = {}));
78
+ let COUPON_ENUM;
79
+ (function (COUPON_ENUM) {
80
+ /** 券类型 */
81
+ let CouponType;
82
+ (function (CouponType) {
83
+ /** 优惠券 */
84
+ CouponType["DISCOUNT"] = "DISCOUNT";
85
+ /** 兑换券 */
86
+ CouponType["EXCHANGE"] = "EXCHANGE";
87
+ /** 核销券 */
88
+ CouponType["VERIFY"] = "VERIFY";
89
+ })(CouponType = COUPON_ENUM.CouponType || (COUPON_ENUM.CouponType = {}));
90
+ /** 券状态 */
91
+ let CouponStatus;
92
+ (function (CouponStatus) {
93
+ /** 可用 */
94
+ CouponStatus["AVAILABLE"] = "AVAILABLE";
95
+ /** 作废 */
96
+ CouponStatus["ABANDONED"] = "ABANDONED";
97
+ })(CouponStatus = COUPON_ENUM.CouponStatus || (COUPON_ENUM.CouponStatus = {}));
98
+ /** 领取限制类型 */
99
+ let ReceiveLimitType;
100
+ (function (ReceiveLimitType) {
101
+ /** 每人总张数 */
102
+ ReceiveLimitType["TOTAL"] = "TOTAL";
103
+ /** 每日 */
104
+ ReceiveLimitType["DAILY"] = "DAILY";
105
+ /** 每周 */
106
+ ReceiveLimitType["WEEKLY"] = "WEEKLY";
107
+ })(ReceiveLimitType = COUPON_ENUM.ReceiveLimitType || (COUPON_ENUM.ReceiveLimitType = {}));
108
+ /** 优惠类型 */
109
+ let DiscountRuleType;
110
+ (function (DiscountRuleType) {
111
+ /** 固定金额 */
112
+ DiscountRuleType["FEE"] = "FEE";
113
+ /** 折扣 */
114
+ DiscountRuleType["DISCOUNT"] = "DISCOUNT";
115
+ })(DiscountRuleType = COUPON_ENUM.DiscountRuleType || (COUPON_ENUM.DiscountRuleType = {}));
116
+ /** 优惠级别 */
117
+ let DiscountLevel;
118
+ (function (DiscountLevel) {
119
+ /** 单份商品 */
120
+ DiscountLevel["ITEM"] = "ITEM";
121
+ /** 整单 */
122
+ DiscountLevel["ORDER"] = "ORDER";
123
+ })(DiscountLevel = COUPON_ENUM.DiscountLevel || (COUPON_ENUM.DiscountLevel = {}));
124
+ /** 操作类型 */
125
+ let OperateType;
126
+ (function (OperateType) {
127
+ /** 作废 */
128
+ OperateType["ABANDON"] = "ABANDON";
129
+ /** 增加库存 */
130
+ OperateType["ADD_STOCK"] = "ADD_STOCK";
131
+ /** 扣减库存 */
132
+ OperateType["DEDUCT_STOCK"] = "DEDUCT_STOCK";
133
+ /** 同步直播 */
134
+ OperateType["SYNC_LIVE"] = "SYNC_LIVE";
135
+ })(OperateType = COUPON_ENUM.OperateType || (COUPON_ENUM.OperateType = {}));
136
+ /** 库存渠道 */
137
+ let StockChannel;
138
+ (function (StockChannel) {
139
+ /** 手动 */
140
+ StockChannel["MANUAL"] = "MANUAL";
141
+ /** 系统自动 */
142
+ StockChannel["SYSTEM"] = "SYSTEM";
143
+ })(StockChannel = COUPON_ENUM.StockChannel || (COUPON_ENUM.StockChannel = {}));
144
+ /** 库存变动类型 */
145
+ let StockChangeType;
146
+ (function (StockChangeType) {
147
+ /** 任务发券 */
148
+ StockChangeType["TASK_ISSUE"] = "TASK_ISSUE";
149
+ /** 活动发券 */
150
+ StockChangeType["ACTIVITY_ISSUE"] = "ACTIVITY_ISSUE";
151
+ /** 手动发券 */
152
+ StockChangeType["MANUAL_ISSUE"] = "MANUAL_ISSUE";
153
+ /** 批量发券 */
154
+ StockChangeType["BULK_MANUAL_ISSUE"] = "BULK_MANUAL_ISSUE";
155
+ /** 后台加券 */
156
+ StockChangeType["MANUAL_ADD"] = "MANUAL_ADD";
157
+ /** 后台扣券 */
158
+ StockChangeType["MANUAL_DEDUCT"] = "MANUAL_DEDUCT";
159
+ })(StockChangeType = COUPON_ENUM.StockChangeType || (COUPON_ENUM.StockChangeType = {}));
160
+ /** 券发放渠道 */
161
+ let CouponIssueChannel;
162
+ (function (CouponIssueChannel) {
163
+ /** 任务 */
164
+ CouponIssueChannel["TASK"] = "TASK";
165
+ /** 直播间活动 */
166
+ CouponIssueChannel["ACTIVITY"] = "ACTIVITY";
167
+ /** 用户主动领取 */
168
+ CouponIssueChannel["USER"] = "USER";
169
+ /** 手动发放 */
170
+ CouponIssueChannel["MANUAL"] = "MANUAL";
171
+ })(CouponIssueChannel = COUPON_ENUM.CouponIssueChannel || (COUPON_ENUM.CouponIssueChannel = {}));
172
+ /** 券发放状态 */
173
+ let IssueStatus;
174
+ (function (IssueStatus) {
175
+ /** 已发放 */
176
+ IssueStatus["ISSUED"] = "ISSUED";
177
+ /** 已作废 */
178
+ IssueStatus["ABANDONED"] = "ABANDONED";
179
+ })(IssueStatus = COUPON_ENUM.IssueStatus || (COUPON_ENUM.IssueStatus = {}));
180
+ /** 范围类型 */
181
+ let ScopeType;
182
+ (function (ScopeType) {
183
+ /** 商品组 */
184
+ ScopeType["SPU_GROUP"] = "SPU_GROUP";
185
+ /** Sku组 */
186
+ ScopeType["SKU_GROUP"] = "SKU_GROUP";
187
+ /** 单商品 */
188
+ ScopeType["SPU"] = "SPU";
189
+ /** 单sku */
190
+ ScopeType["SKU"] = "SKU";
191
+ })(ScopeType = COUPON_ENUM.ScopeType || (COUPON_ENUM.ScopeType = {}));
192
+ /** 使用限制类型 */
193
+ let UsageLimitType;
194
+ (function (UsageLimitType) {
195
+ /** 金额 */
196
+ UsageLimitType["FEE"] = "FEE";
197
+ })(UsageLimitType = COUPON_ENUM.UsageLimitType || (COUPON_ENUM.UsageLimitType = {}));
198
+ })(COUPON_ENUM = ENUM.COUPON_ENUM || (ENUM.COUPON_ENUM = {}));
199
+ let PRICING_CALCULATION_ENUM;
200
+ (function (PRICING_CALCULATION_ENUM) {
201
+ /** 订单来源 */
202
+ let OrderSource;
203
+ (function (OrderSource) {
204
+ /** 直播订单 */
205
+ OrderSource["LIVE"] = "LIVE";
206
+ /** 积分商城订单 */
207
+ OrderSource["POINTS"] = "POINTS";
208
+ /** 会员订单 */
209
+ OrderSource["MEMBER"] = "MEMBER";
210
+ /** 商详分享下单 */
211
+ OrderSource["DETAIL_SHARE"] = "DETAIL_SHARE";
212
+ })(OrderSource = PRICING_CALCULATION_ENUM.OrderSource || (PRICING_CALCULATION_ENUM.OrderSource = {}));
213
+ /** 平台 */
214
+ let Platform;
215
+ (function (Platform) {
216
+ /** APP */
217
+ Platform["APP"] = "APP";
218
+ /** H5 */
219
+ Platform["H5"] = "H5";
220
+ /** 小程序 */
221
+ Platform["MINI"] = "MINI";
222
+ })(Platform = PRICING_CALCULATION_ENUM.Platform || (PRICING_CALCULATION_ENUM.Platform = {}));
223
+ /** 券类型 */
224
+ let CouponType;
225
+ (function (CouponType) {
226
+ /** 优惠券 */
227
+ CouponType["DISCOUNT"] = "DISCOUNT";
228
+ /** 兑换券 */
229
+ CouponType["EXCHANGE"] = "EXCHANGE";
230
+ /** 核销券 */
231
+ CouponType["VERIFY"] = "VERIFY";
232
+ })(CouponType = PRICING_CALCULATION_ENUM.CouponType || (PRICING_CALCULATION_ENUM.CouponType = {}));
233
+ /** 券状态 */
234
+ let CouponStatus;
235
+ (function (CouponStatus) {
236
+ /** 未使用 */
237
+ CouponStatus["UNUSED"] = "UNUSED";
238
+ /** 占用 */
239
+ CouponStatus["OCCUPIED"] = "OCCUPIED";
240
+ /** 已使用 */
241
+ CouponStatus["USED"] = "USED";
242
+ /** 已过期 */
243
+ CouponStatus["EXPIRED"] = "EXPIRED";
244
+ /** 已作废 */
245
+ CouponStatus["INVALID"] = "INVALID";
246
+ })(CouponStatus = PRICING_CALCULATION_ENUM.CouponStatus || (PRICING_CALCULATION_ENUM.CouponStatus = {}));
247
+ })(PRICING_CALCULATION_ENUM = ENUM.PRICING_CALCULATION_ENUM || (ENUM.PRICING_CALCULATION_ENUM = {}));
248
+ })(ENUM || (exports.ENUM = ENUM = {}));
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export { awardService } from './modules/award/service';
2
+ export type { Service as AwardServiceTypes } from './modules/award/types';
3
+ export { couponService } from './modules/coupon/service';
4
+ export type { Service as CouponServiceTypes } from './modules/coupon/types';
5
+ export { configService } from './modules/config/service';
6
+ export type { Service as ConfigServiceTypes } from './modules/config/types';
7
+ export { pricingCalculationService } from './modules/pricingCalculation/service';
8
+ export type { Service as PricingCalculationServiceTypes } from './modules/pricingCalculation/types';
9
+ export { pointsMallService } from './modules/pointsMall/service';
10
+ export type { Service as PointsMallServiceTypes } from './modules/pointsMall/types';
11
+ export { ENUM as PROMOTION_ENUM } from './enum';
package/index.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROMOTION_ENUM = exports.pointsMallService = exports.pricingCalculationService = exports.configService = exports.couponService = exports.awardService = void 0;
4
+ var service_1 = require("./modules/award/service");
5
+ Object.defineProperty(exports, "awardService", { enumerable: true, get: function () { return service_1.awardService; } });
6
+ var service_2 = require("./modules/coupon/service");
7
+ Object.defineProperty(exports, "couponService", { enumerable: true, get: function () { return service_2.couponService; } });
8
+ var service_3 = require("./modules/config/service");
9
+ Object.defineProperty(exports, "configService", { enumerable: true, get: function () { return service_3.configService; } });
10
+ var service_4 = require("./modules/pricingCalculation/service");
11
+ Object.defineProperty(exports, "pricingCalculationService", { enumerable: true, get: function () { return service_4.pricingCalculationService; } });
12
+ var service_5 = require("./modules/pointsMall/service");
13
+ Object.defineProperty(exports, "pointsMallService", { enumerable: true, get: function () { return service_5.pointsMallService; } });
14
+ // 服务.模块.枚举名称.枚举值 示例: AWARD_ENUM.DISTRIBUTION_CHANNEL.ORDER
15
+ var enum_1 = require("./enum");
16
+ Object.defineProperty(exports, "PROMOTION_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * BaseService 基类
3
+ * 所有服务类都应该继承此类
4
+ */
5
+ export default abstract class BaseService {
6
+ /** URL一级路径 */
7
+ protected abstract prefixUrl: string;
8
+ /** 子网域名 */
9
+ protected readonly natDevHost = "";
10
+ protected readonly natProdHost = "";
11
+ /** 获取API URL */
12
+ protected getApiUrl(func: Function): string;
13
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const env_1 = __importDefault(require("../utils/env"));
7
+ const string_1 = require("../utils/string");
8
+ /**
9
+ * BaseService 基类
10
+ * 所有服务类都应该继承此类
11
+ */
12
+ class BaseService {
13
+ constructor() {
14
+ /** 子网域名 */
15
+ this.natDevHost = '';
16
+ this.natProdHost = '';
17
+ }
18
+ /** 获取API URL */
19
+ getApiUrl(func) {
20
+ const host = env_1.default.isProduction() ? this.natProdHost : this.natDevHost;
21
+ return `${host}${this.prefixUrl}/${(0, string_1.camelToKebabCase)(func.name)}`;
22
+ }
23
+ }
24
+ exports.default = BaseService;
@@ -0,0 +1,12 @@
1
+ import { Service } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class AwardService extends BaseService implements Service.PrizeDistributionController {
4
+ protected prefixUrl: string;
5
+ distributePrize(request: Service.Request.distributePrize): Promise<void>;
6
+ reversePrize(request: Service.Request.reversePrize): Promise<void>;
7
+ liveRoomIssueCoupon(request: Service.Request.liveRoomIssueCoupon): Promise<void>;
8
+ issueMemberPoints(request: Service.Request.issueMemberPoints): Promise<void>;
9
+ getLiveRoomDistributionStats(request: Service.Request.getLiveRoomDistributionStats): Promise<Service.Response.getLiveRoomDistributionStats>;
10
+ }
11
+ export declare const awardService: AwardService;
12
+ export default awardService;
@@ -0,0 +1,70 @@
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.awardService = void 0;
16
+ const tsoa_1 = require("tsoa");
17
+ const http_1 = require("../../utils/http");
18
+ const BaseService_1 = __importDefault(require("../BaseService"));
19
+ let AwardService = class AwardService extends BaseService_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.prefixUrl = '/award';
23
+ }
24
+ distributePrize(request) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.distributePrize), request);
26
+ }
27
+ reversePrize(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.reversePrize), request);
29
+ }
30
+ liveRoomIssueCoupon(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.liveRoomIssueCoupon), request);
32
+ }
33
+ issueMemberPoints(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.issueMemberPoints), request);
35
+ }
36
+ getLiveRoomDistributionStats(request) {
37
+ return (0, http_1.callApi)(this.getApiUrl(this.getLiveRoomDistributionStats), request);
38
+ }
39
+ };
40
+ __decorate([
41
+ (0, tsoa_1.OperationId)('发放奖励'),
42
+ (0, tsoa_1.Post)('distribute-prize'),
43
+ __param(0, (0, tsoa_1.Body)())
44
+ ], AwardService.prototype, "distributePrize", null);
45
+ __decorate([
46
+ (0, tsoa_1.OperationId)('作废奖励'),
47
+ (0, tsoa_1.Post)('reverse-prize'),
48
+ __param(0, (0, tsoa_1.Body)())
49
+ ], AwardService.prototype, "reversePrize", null);
50
+ __decorate([
51
+ (0, tsoa_1.OperationId)('直播间发券'),
52
+ (0, tsoa_1.Post)('live-room-issue-coupon'),
53
+ __param(0, (0, tsoa_1.Body)())
54
+ ], AwardService.prototype, "liveRoomIssueCoupon", null);
55
+ __decorate([
56
+ (0, tsoa_1.OperationId)('会员等级积分发放'),
57
+ (0, tsoa_1.Post)('issue-member-points'),
58
+ __param(0, (0, tsoa_1.Body)())
59
+ ], AwardService.prototype, "issueMemberPoints", null);
60
+ __decorate([
61
+ (0, tsoa_1.OperationId)('统计直播间发放数据'),
62
+ (0, tsoa_1.Post)('get-live-room-distribution-stats'),
63
+ __param(0, (0, tsoa_1.Body)())
64
+ ], AwardService.prototype, "getLiveRoomDistributionStats", null);
65
+ AwardService = __decorate([
66
+ (0, tsoa_1.Route)('award'),
67
+ (0, tsoa_1.Tags)('Award')
68
+ ], AwardService);
69
+ exports.awardService = new AwardService();
70
+ exports.default = exports.awardService;