@be-link/ecommerce-promotion-service-node-sdk 0.1.0 → 0.1.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/enum.d.ts CHANGED
@@ -11,7 +11,9 @@ export declare namespace ENUM {
11
11
  /** 直播间活动 */
12
12
  ACTIVITY = "ACTIVITY",
13
13
  /** 用户主动领取 */
14
- USER = "USER"
14
+ USER = "USER",
15
+ /** 手动发放 */
16
+ MANUAL = "MANUAL"
15
17
  }
16
18
  /** 发放渠道中文 */
17
19
  enum DISTRIBUTION_CHANNEL_CHINESE {
package/enum.js CHANGED
@@ -18,6 +18,8 @@ var ENUM;
18
18
  DISTRIBUTION_CHANNEL["ACTIVITY"] = "ACTIVITY";
19
19
  /** 用户主动领取 */
20
20
  DISTRIBUTION_CHANNEL["USER"] = "USER";
21
+ /** 手动发放 */
22
+ DISTRIBUTION_CHANNEL["MANUAL"] = "MANUAL";
21
23
  })(DISTRIBUTION_CHANNEL = AWARD_ENUM.DISTRIBUTION_CHANNEL || (AWARD_ENUM.DISTRIBUTION_CHANNEL = {}));
22
24
  /** 发放渠道中文 */
23
25
  let DISTRIBUTION_CHANNEL_CHINESE;
@@ -7,10 +7,10 @@ export default abstract class BaseService {
7
7
  /** URL一级路径 */
8
8
  protected abstract prefixUrl: string;
9
9
  /** 子网域名 */
10
- protected readonly natDevHost = "http://promotion:8090";
11
- protected readonly natProdHost = "http://promotion:8090";
10
+ protected readonly natDevHost = "http://promotion:8090/promotion";
11
+ protected readonly natProdHost = "http://promotion:8090/promotion";
12
12
  /** 公网域名 */
13
- protected readonly publicDevHost = "https://ecommerce-dev.wejourney.top";
13
+ protected readonly publicDevHost = "https://ecommerce-dev.wejourney.top/promotion";
14
14
  protected readonly publicProdHost = "";
15
15
  constructor();
16
16
  /** 获取API URL */
@@ -12,10 +12,10 @@ const string_1 = require("../utils/string");
12
12
  class BaseService {
13
13
  constructor() {
14
14
  /** 子网域名 */
15
- this.natDevHost = 'http://promotion:8090';
16
- this.natProdHost = 'http://promotion:8090';
15
+ this.natDevHost = 'http://promotion:8090/promotion';
16
+ this.natProdHost = 'http://promotion:8090/promotion';
17
17
  /** 公网域名 */
18
- this.publicDevHost = 'https://ecommerce-dev.wejourney.top';
18
+ this.publicDevHost = 'https://ecommerce-dev.wejourney.top/promotion';
19
19
  this.publicProdHost = '';
20
20
  /** 如果是云函数环境, 默认走公网访问 */
21
21
  this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SCF';
@@ -5,6 +5,8 @@ declare class AwardService extends BaseService implements Service.PrizeDistribut
5
5
  distributePrize(request: Service.Request.distributePrize): Promise<Service.Response.distributePrize>;
6
6
  reversePrize(request: Service.Request.reversePrize): Promise<Service.Response.distributePrize>;
7
7
  liveRoomIssueCoupon(request: Service.Request.liveRoomIssueCoupon): Promise<Service.Response.distributePrize>;
8
+ queryLiveRoomDistributionStats(request: Service.Request.queryLiveRoomDistributionStats): Promise<Service.Response.queryLiveRoomDistributionStatsResponse>;
9
+ adminSingleIssueCoupon(request: Service.Request.adminSingleIssueCoupon): Promise<Service.Response.distributePrize>;
8
10
  }
9
11
  export declare const awardService: AwardService;
10
12
  export default awardService;
@@ -20,26 +20,6 @@ let AwardService = class AwardService extends BaseService_1.default {
20
20
  constructor() {
21
21
  super(...arguments);
22
22
  this.prefixUrl = '/award';
23
- // @OperationId('会员等级积分发放')
24
- // @Post('issue-member-points')
25
- // public issueMemberPoints(
26
- // @Body() request: Service.Request.issueMemberPoints,
27
- // ): Promise<Service.Response.distributePrize> {
28
- // return callApi<Service.PrizeDistributionController['issueMemberPoints']>(
29
- // this.getApiUrl(this.issueMemberPoints),
30
- // request,
31
- // )
32
- // }
33
- // @OperationId('统计直播间发放数据')
34
- // @Post('get-live-room-distribution-stats')
35
- // public getLiveRoomDistributionStats(
36
- // @Body() request: Service.Request.getLiveRoomDistributionStats,
37
- // ): Promise<Service.Response.getLiveRoomDistributionStats> {
38
- // return callApi<Service.PrizeDistributionController['getLiveRoomDistributionStats']>(
39
- // this.getApiUrl(this.getLiveRoomDistributionStats),
40
- // request,
41
- // )
42
- // }
43
23
  }
44
24
  distributePrize(request) {
45
25
  return (0, http_1.callApi)(this.getApiUrl(this.distributePrize), request);
@@ -50,6 +30,12 @@ let AwardService = class AwardService extends BaseService_1.default {
50
30
  liveRoomIssueCoupon(request) {
51
31
  return (0, http_1.callApi)(this.getApiUrl(this.liveRoomIssueCoupon), request);
52
32
  }
33
+ queryLiveRoomDistributionStats(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.queryLiveRoomDistributionStats), request);
35
+ }
36
+ adminSingleIssueCoupon(request) {
37
+ return (0, http_1.callApi)(this.getApiUrl(this.adminSingleIssueCoupon), request);
38
+ }
53
39
  };
54
40
  __decorate([
55
41
  (0, tsoa_1.OperationId)('发放奖励'),
@@ -66,6 +52,16 @@ __decorate([
66
52
  (0, tsoa_1.Post)('live-room-issue-coupon'),
67
53
  __param(0, (0, tsoa_1.Body)())
68
54
  ], AwardService.prototype, "liveRoomIssueCoupon", null);
55
+ __decorate([
56
+ (0, tsoa_1.OperationId)('直播间积分&券发放统计'),
57
+ (0, tsoa_1.Post)('query-live-room-distribution-stats'),
58
+ __param(0, (0, tsoa_1.Body)())
59
+ ], AwardService.prototype, "queryLiveRoomDistributionStats", null);
60
+ __decorate([
61
+ (0, tsoa_1.OperationId)('后台单个发券'),
62
+ (0, tsoa_1.Post)('admin-single-issue-coupon'),
63
+ __param(0, (0, tsoa_1.Body)())
64
+ ], AwardService.prototype, "adminSingleIssueCoupon", null);
69
65
  AwardService = __decorate([
70
66
  (0, tsoa_1.Route)('award'),
71
67
  (0, tsoa_1.Tags)('Award')
@@ -59,12 +59,22 @@ export declare namespace Service {
59
59
  interface liveRoomIssueCoupon {
60
60
  /** 直播间ID */
61
61
  liveRoomId: string;
62
- /** 用户ID */
63
- userId: string;
64
62
  /** 优惠券ID */
65
63
  couponId: string;
66
64
  /** 活动ID(业务ID) */
67
65
  activityId: string;
66
+ /** 时间戳 */
67
+ timestamp: number;
68
+ }
69
+ interface liveRoomIssueCouponEncrypt {
70
+ /** 加密后的数据 */
71
+ encryptData: string;
72
+ /** 加密密钥 */
73
+ encryptKey: string;
74
+ /** 初始化向量 */
75
+ iv: string;
76
+ /** 认证标签 */
77
+ authTag: string;
68
78
  }
69
79
  /** 会员等级积分发放 */
70
80
  interface issueMemberPoints {
@@ -77,14 +87,19 @@ export declare namespace Service {
77
87
  /** 业务编号 */
78
88
  bizNo: string;
79
89
  }
80
- /** 统计直播间发放数据 */
81
- interface getLiveRoomDistributionStats {
90
+ /** 直播间积分&券发放统计 */
91
+ interface queryLiveRoomDistributionStats {
82
92
  /** 直播间ID */
83
93
  liveRoomId: string;
84
- /** 开始时间(时间戳) */
85
- startTime: number;
86
- /** 结束时间(时间戳) */
87
- endTime: number;
94
+ /** 用户列表 */
95
+ userIds: string[];
96
+ }
97
+ /** 后台单个发券 */
98
+ interface adminSingleIssueCoupon {
99
+ /** 优惠券ID */
100
+ couponId: string;
101
+ /** 用户ID */
102
+ userId: string;
88
103
  }
89
104
  }
90
105
  namespace Response {
@@ -95,6 +110,20 @@ export declare namespace Service {
95
110
  /** 失败原因 */
96
111
  message?: string;
97
112
  }
113
+ /** 直播间积分&券发放统计响应 */
114
+ interface queryLiveRoomDistributionStatsResponse {
115
+ /** 数据列表 */
116
+ list: {
117
+ /** 用户ID */
118
+ userId: string;
119
+ /** 积分发放数量 */
120
+ points: number;
121
+ /** 券发放数量 */
122
+ coupons: number;
123
+ /** 发放渠道 */
124
+ getChannel: ENUM.AWARD_ENUM.DISTRIBUTION_CHANNEL;
125
+ }[];
126
+ }
98
127
  }
99
128
  interface PrizeDistributionController {
100
129
  /** 发放奖励 */
@@ -103,5 +132,9 @@ export declare namespace Service {
103
132
  reversePrize(request: Service.Request.reversePrize, req: any): Promise<Service.Response.distributePrize>;
104
133
  /** 直播间发券 */
105
134
  liveRoomIssueCoupon(request: Service.Request.liveRoomIssueCoupon, req: any): Promise<Service.Response.distributePrize>;
135
+ /** 直播间积分&券发放统计 */
136
+ queryLiveRoomDistributionStats(request: Service.Request.queryLiveRoomDistributionStats, req: any): Promise<Service.Response.queryLiveRoomDistributionStatsResponse>;
137
+ /** 后台单个发券 */
138
+ adminSingleIssueCoupon(request: Service.Request.adminSingleIssueCoupon, req: any): Promise<Service.Response.distributePrize>;
106
139
  }
107
140
  }
@@ -212,6 +212,8 @@ export declare namespace Service {
212
212
  pageIndex?: number;
213
213
  /** 每页数量 */
214
214
  pageSize?: number;
215
+ /** 券ID */
216
+ id?: string;
215
217
  /** 券名称(模糊查询) */
216
218
  name?: string;
217
219
  /** 券类型 */
@@ -291,6 +293,8 @@ export declare namespace Service {
291
293
  createdAt: number;
292
294
  /** 更新时间 */
293
295
  updatedAt: number;
296
+ /** 创建人 */
297
+ creatorId: string;
294
298
  }
295
299
  /** 券模版列表响应 */
296
300
  interface getCouponTemplateList {
@@ -186,6 +186,8 @@ export declare namespace Service {
186
186
  availableCouponStats?: Entity.CouponGroupStats[];
187
187
  /** 用户可用积分数量 */
188
188
  userAvailablePoints?: number;
189
+ /** 使用兑换券券码列表 */
190
+ usedCoupons?: string[];
189
191
  }
190
192
  /** 积分商城用户选择后再次算价响应 */
191
193
  interface recalculatePointsMallOrder {
@@ -201,6 +203,8 @@ export declare namespace Service {
201
203
  requiredCoupons?: number;
202
204
  /** 使用积分数量 */
203
205
  usedPoints?: number;
206
+ /** 用户可用积分数量 */
207
+ userAvailablePoints?: number;
204
208
  /** 用户选择优惠券聚合 */
205
209
  selectedCouponStats?: Entity.CouponGroupStats[];
206
210
  /** 使用兑换券券码列表 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-promotion-service-node-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "EcommercePromotionService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",