@be-link/ecommerce-client-backend-service-node-sdk 0.1.4 → 0.1.6

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.
@@ -8,6 +8,10 @@ declare class DataServiceClass extends BaseService implements DataService.BaseCo
8
8
  getUserLiveStreamInfo(request: DataService.Request.UserLiveStreamInfo): Promise<DataService.Response.UserLiveStreamInfo>;
9
9
  /** 直播间观众列表查询 */
10
10
  getAudienceList(request: DataService.Request.AudienceList): Promise<DataService.Response.AudienceList>;
11
+ /** 直播间统计查询 */
12
+ getLiveStreamStatistics(request: DataService.Request.LiveStreamStatistics): Promise<DataService.Response.LiveStreamStatistics>;
13
+ /** 直播间商品销量排行查询 */
14
+ getLiveStreamProductTop(request: DataService.Request.LiveStreamProductTop): Promise<DataService.Response.LiveStreamProductTop>;
11
15
  }
12
16
  export declare const dataService: DataServiceClass;
13
17
  export default dataService;
@@ -37,6 +37,14 @@ let DataServiceClass = class DataServiceClass extends BaseService_1.default {
37
37
  getAudienceList(request) {
38
38
  return (0, http_1.callApi)(this.getApiUrl(this.getAudienceList), request);
39
39
  }
40
+ /** 直播间统计查询 */
41
+ getLiveStreamStatistics(request) {
42
+ return (0, http_1.callApi)(this.getApiUrl(this.getLiveStreamStatistics), request);
43
+ }
44
+ /** 直播间商品销量排行查询 */
45
+ getLiveStreamProductTop(request) {
46
+ return (0, http_1.callApi)(this.getApiUrl(this.getLiveStreamProductTop), request);
47
+ }
40
48
  };
41
49
  __decorate([
42
50
  (0, tsoa_1.OperationId)('获取用户观看时长'),
@@ -63,6 +71,16 @@ __decorate([
63
71
  (0, tsoa_1.Post)('get-audience-list'),
64
72
  __param(0, (0, tsoa_1.Body)())
65
73
  ], DataServiceClass.prototype, "getAudienceList", null);
74
+ __decorate([
75
+ (0, tsoa_1.OperationId)('直播间统计查询'),
76
+ (0, tsoa_1.Post)('get-livestream-statistics'),
77
+ __param(0, (0, tsoa_1.Body)())
78
+ ], DataServiceClass.prototype, "getLiveStreamStatistics", null);
79
+ __decorate([
80
+ (0, tsoa_1.OperationId)('直播间商品销量排行查询'),
81
+ (0, tsoa_1.Post)('get-livestream-product-top'),
82
+ __param(0, (0, tsoa_1.Body)())
83
+ ], DataServiceClass.prototype, "getLiveStreamProductTop", null);
66
84
  DataServiceClass = __decorate([
67
85
  (0, tsoa_1.Route)('data'),
68
86
  (0, tsoa_1.Tags)('Data')
@@ -33,7 +33,6 @@ export declare namespace DataService {
33
33
  /** 查询观看类型 */
34
34
  viewType: ENUM.LIVE_STREAM_AUDIENCE.VIEW_TYPE;
35
35
  /** 用户行为 */
36
- action: ENUM.LIVE_STREAM_AUDIENCE.REPORT_ACTION;
37
36
  /** 事件发生时间,毫秒时间戳 */
38
37
  eventAt: number;
39
38
  }
@@ -61,6 +60,20 @@ export declare namespace DataService {
61
60
  /** 每页数量,默认20,最大100 */
62
61
  pageSize?: number;
63
62
  }
63
+ /**
64
+ * 直播间统计查询
65
+ */
66
+ interface LiveStreamStatistics {
67
+ /** 直播间id */
68
+ liveStreamRoomId: string;
69
+ }
70
+ /**
71
+ * 直播间商品销量排行查询
72
+ */
73
+ interface LiveStreamProductTop {
74
+ /** 直播间id */
75
+ liveStreamRoomId: string;
76
+ }
64
77
  }
65
78
  namespace Response {
66
79
  /**
@@ -91,6 +104,18 @@ export declare namespace DataService {
91
104
  list: Audience[];
92
105
  total: number;
93
106
  }
107
+ /**
108
+ * 直播间统计响应
109
+ */
110
+ interface LiveStreamStatistics {
111
+ roomStatistics: RoomStatistics;
112
+ }
113
+ /**
114
+ * 直播间商品销量排行响应
115
+ */
116
+ interface LiveStreamProductTop {
117
+ list: Product[];
118
+ }
94
119
  }
95
120
  interface BaseController {
96
121
  userLiveStreamRelation(request: Request.UserLiveStreamRelation, req?: FastifyRequest): Promise<void>;
@@ -98,8 +123,13 @@ export declare namespace DataService {
98
123
  userReport(request: Request.UserReport, req?: FastifyRequest): Promise<void>;
99
124
  getUserLiveStreamInfo(request: Request.UserLiveStreamInfo, req?: FastifyRequest): Promise<Response.UserLiveStreamInfo>;
100
125
  getAudienceList(request: Request.AudienceList, req?: FastifyRequest): Promise<Response.AudienceList>;
126
+ getLiveStreamStatistics(request: Request.LiveStreamStatistics, req?: FastifyRequest): Promise<Response.LiveStreamStatistics>;
127
+ getLiveStreamProductTop(request: Request.LiveStreamProductTop, req?: FastifyRequest): Promise<Response.LiveStreamProductTop>;
101
128
  }
102
129
  }
130
+ /**
131
+ * 观众
132
+ */
103
133
  export interface Audience {
104
134
  /** 主播间id */
105
135
  liveStreamRoomId: string;
@@ -128,3 +158,56 @@ export interface Audience {
128
158
  /** 最后一次进入时间,毫秒时间戳 */
129
159
  lastTime: number;
130
160
  }
161
+ /**
162
+ * 直播间统计
163
+ */
164
+ export interface RoomStatistics {
165
+ /** 直播间数据id */
166
+ id: number;
167
+ /** 直播间id */
168
+ liveStreamRoomId: string;
169
+ /** 交易总金额(待支付金额+实收金额、含退款金额) */
170
+ gmv: number;
171
+ /** 实收金额: 支付成功且未退款金额 */
172
+ actualReceivedAmount: number;
173
+ /** 客单价:交易总金额/下单人数 */
174
+ averageOrderAmount: string;
175
+ /** 成交订单数:支付成功订单数 */
176
+ transactOrderCount: number;
177
+ /** 下单人数去重 */
178
+ orderUserCount: number;
179
+ /** 成交转化率:支付成功人数/累计观看人数 */
180
+ orderConversionRate: string;
181
+ /** 退款金额 */
182
+ refundAmount: number;
183
+ /** 退款人数去重 */
184
+ refundUserCount: number;
185
+ /** 待支付金额 */
186
+ pendingPaymentAmount: number;
187
+ /** 商品销售量 */
188
+ salesVolume: number;
189
+ }
190
+ export interface Product {
191
+ /** 直播间id */
192
+ liveStreamRoomId: string;
193
+ /** 直播间id */
194
+ productId: string;
195
+ /** 商品名称 */
196
+ productName: string;
197
+ /** 商品图片 */
198
+ productImage: string;
199
+ /** 商品SKU ID */
200
+ skuId: string;
201
+ /** 商品SKU名称 */
202
+ attrs: Attr[];
203
+ /** 销售量 */
204
+ salesVolume: number;
205
+ /** 成交金额 */
206
+ paymentAmount: number;
207
+ }
208
+ export interface Attr {
209
+ /** 属性名称 */
210
+ attrName: string;
211
+ /** 属性值 */
212
+ attrValue: string;
213
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-client-backend-service-node-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "EcommerceClientBackendService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",