@be-link/ecommerce-client-backend-service-node-sdk 0.1.77 → 0.1.79
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/modules/BaseService.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export default abstract class BaseService {
|
|
|
7
7
|
/** URL一级路径 */
|
|
8
8
|
protected abstract prefixUrl: string;
|
|
9
9
|
/** 子网域名 */
|
|
10
|
-
protected readonly natDevHost = "
|
|
11
|
-
protected readonly natProdHost = "http://
|
|
10
|
+
protected readonly natDevHost = "http://192.168.92.0:8090/client-backend";
|
|
11
|
+
protected readonly natProdHost = "http://192.168.41.121:8090/client-backend";
|
|
12
12
|
/** 公网域名 */
|
|
13
13
|
protected readonly publicDevHost = "https://ecommerce-dev.wejourney.top/client-backend";
|
|
14
14
|
protected readonly publicProdHost = "";
|
package/modules/BaseService.js
CHANGED
|
@@ -12,8 +12,8 @@ const string_1 = require("../utils/string");
|
|
|
12
12
|
class BaseService {
|
|
13
13
|
constructor() {
|
|
14
14
|
/** 子网域名 */
|
|
15
|
-
this.natDevHost = '
|
|
16
|
-
this.natProdHost = 'http://
|
|
15
|
+
this.natDevHost = 'http://192.168.92.0:8090/client-backend';
|
|
16
|
+
this.natProdHost = 'http://192.168.41.121:8090/client-backend';
|
|
17
17
|
/** 公网域名 */
|
|
18
18
|
this.publicDevHost = 'https://ecommerce-dev.wejourney.top/client-backend';
|
|
19
19
|
this.publicProdHost = '';
|
package/modules/rule/types.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ declare class UserDataServiceClass extends BaseService implements UserDataServic
|
|
|
6
6
|
exportUserList(request: UserDataService.Request.ExportUserList): Promise<UserDataService.Response.ExportUserList>;
|
|
7
7
|
getLiveRoomUserList(request: UserDataService.Request.GetLiveRoomUserList): Promise<UserDataService.Response.GetLiveRoomUserList>;
|
|
8
8
|
exportLiveRoomUserList(request: UserDataService.Request.ExportLiveRoomUserList): Promise<UserDataService.Response.ExportLiveRoomUserList>;
|
|
9
|
+
getUserLiveWatchSummary(request: UserDataService.Request.GetUserLiveWatchSummary): Promise<UserDataService.Response.GetUserLiveWatchSummary>;
|
|
10
|
+
getUserLiveWatchCalendar(request: UserDataService.Request.GetUserLiveWatchCalendar): Promise<UserDataService.Response.GetUserLiveWatchCalendar>;
|
|
11
|
+
replaceThirdPartyUserIdToUserId(request: UserDataService.Request.ReplaceThirdPartyUserIdToUserId): Promise<UserDataService.Response.ReplaceThirdPartyUserIdToUserId>;
|
|
9
12
|
}
|
|
10
13
|
export declare const userDataService: UserDataServiceClass;
|
|
11
14
|
export default userDataService;
|
|
@@ -33,6 +33,15 @@ let UserDataServiceClass = class UserDataServiceClass extends BaseService_1.defa
|
|
|
33
33
|
exportLiveRoomUserList(request) {
|
|
34
34
|
return (0, http_1.callApi)(this.getApiUrl(this.exportLiveRoomUserList), request);
|
|
35
35
|
}
|
|
36
|
+
getUserLiveWatchSummary(request) {
|
|
37
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getUserLiveWatchSummary), request);
|
|
38
|
+
}
|
|
39
|
+
getUserLiveWatchCalendar(request) {
|
|
40
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getUserLiveWatchCalendar), request);
|
|
41
|
+
}
|
|
42
|
+
replaceThirdPartyUserIdToUserId(request) {
|
|
43
|
+
return (0, http_1.callApi)(this.getApiUrl(this.replaceThirdPartyUserIdToUserId), request);
|
|
44
|
+
}
|
|
36
45
|
};
|
|
37
46
|
__decorate([
|
|
38
47
|
(0, tsoa_1.OperationId)('获取用户列表'),
|
|
@@ -54,6 +63,21 @@ __decorate([
|
|
|
54
63
|
(0, tsoa_1.Post)('export-live-room-user-list'),
|
|
55
64
|
__param(0, (0, tsoa_1.Body)())
|
|
56
65
|
], UserDataServiceClass.prototype, "exportLiveRoomUserList", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, tsoa_1.OperationId)('获取用户看播汇总数据'),
|
|
68
|
+
(0, tsoa_1.Post)('get-user-live-watch-summary'),
|
|
69
|
+
__param(0, (0, tsoa_1.Body)())
|
|
70
|
+
], UserDataServiceClass.prototype, "getUserLiveWatchSummary", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, tsoa_1.OperationId)('获取用户看播日历数据'),
|
|
73
|
+
(0, tsoa_1.Post)('get-user-live-watch-calendar'),
|
|
74
|
+
__param(0, (0, tsoa_1.Body)())
|
|
75
|
+
], UserDataServiceClass.prototype, "getUserLiveWatchCalendar", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, tsoa_1.OperationId)('thirdPartyUserId置换userId'),
|
|
78
|
+
(0, tsoa_1.Post)('replace-third-party-user-id-to-user-id'),
|
|
79
|
+
__param(0, (0, tsoa_1.Body)())
|
|
80
|
+
], UserDataServiceClass.prototype, "replaceThirdPartyUserIdToUserId", null);
|
|
57
81
|
UserDataServiceClass = __decorate([
|
|
58
82
|
(0, tsoa_1.Route)('userData'),
|
|
59
83
|
(0, tsoa_1.Tags)('UserData')
|
|
@@ -93,6 +93,27 @@ export declare namespace UserDataService {
|
|
|
93
93
|
/** 每页数量,默认20,最大1000 */
|
|
94
94
|
pageSize?: number;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* 获取用户看播汇总数据
|
|
98
|
+
*/
|
|
99
|
+
interface GetUserLiveWatchSummary {
|
|
100
|
+
/** 用户ID */
|
|
101
|
+
userId: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 获取用户看播日历数据
|
|
105
|
+
*/
|
|
106
|
+
interface GetUserLiveWatchCalendar {
|
|
107
|
+
/** 用户ID */
|
|
108
|
+
userId: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* thirdPartyUserId 置换 userId
|
|
112
|
+
*/
|
|
113
|
+
interface ReplaceThirdPartyUserIdToUserId {
|
|
114
|
+
/** 第三方用户ID列表,最大1000个 */
|
|
115
|
+
thirdPartyUserIds: number[];
|
|
116
|
+
}
|
|
96
117
|
}
|
|
97
118
|
namespace Response {
|
|
98
119
|
/**
|
|
@@ -136,12 +157,87 @@ export declare namespace UserDataService {
|
|
|
136
157
|
*/
|
|
137
158
|
interface ExportLiveRoomUserList extends IBatchExport {
|
|
138
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* 获取用户看播汇总数据响应
|
|
162
|
+
*/
|
|
163
|
+
interface GetUserLiveWatchSummary {
|
|
164
|
+
/** 已观看场次(进入过直播间的场次数) */
|
|
165
|
+
watchedCount: number;
|
|
166
|
+
/** 已完播场次(观看时长达到完播阈值的场次数) */
|
|
167
|
+
completedCount: number;
|
|
168
|
+
/** 总观看时长(分钟),前端展示如 "127.5h" 时可自行换算为小时 */
|
|
169
|
+
totalWatchDurationMinutes: number;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* 获取用户看播日历数据响应
|
|
173
|
+
*/
|
|
174
|
+
interface GetUserLiveWatchCalendar {
|
|
175
|
+
/**
|
|
176
|
+
* 按天的看播记录(长度固定 14)
|
|
177
|
+
* 排序:可以从近到远或从远到近,自行约定
|
|
178
|
+
*/
|
|
179
|
+
days: UserLiveWatchDayItem[];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* thirdPartyUserId 置换 userId 响应
|
|
183
|
+
*/
|
|
184
|
+
interface ReplaceThirdPartyUserIdToUserId {
|
|
185
|
+
[thirdPartyUserId: string]: {
|
|
186
|
+
userId: string;
|
|
187
|
+
storeId: string;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 用户看播日历 - 单日数据
|
|
193
|
+
*/
|
|
194
|
+
interface UserLiveWatchDayItem {
|
|
195
|
+
/** 日期字符串,例如 "2026-01-15" */
|
|
196
|
+
date: string;
|
|
197
|
+
/** 周几,前端用来展示,例如 "周一"(可选) */
|
|
198
|
+
weekDay: string;
|
|
199
|
+
/** 早场记录(实际 9:00~10:15,统计窗口 8:45~11:00) */
|
|
200
|
+
morningSession: UserLiveWatchSessionItem;
|
|
201
|
+
/** 午场记录(实际 14:00~15:15,统计窗口 13:45~16:00) */
|
|
202
|
+
noonSession: UserLiveWatchSessionItem;
|
|
203
|
+
/** 晚场记录(实际 20:00~21:15,统计窗口 19:45~22:00) */
|
|
204
|
+
eveningSession: UserLiveWatchSessionItem;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 用户看播日历 - 单场次数据
|
|
208
|
+
*/
|
|
209
|
+
interface UserLiveWatchSessionItem {
|
|
210
|
+
/**
|
|
211
|
+
* 该时间段内选中的直播间ID:
|
|
212
|
+
* - 有直播且被选中那场 ⇒ 对应 liveStreamRoomId
|
|
213
|
+
* - NO_LIVE(无直播)时可以不返回或返回空字符串
|
|
214
|
+
*/
|
|
215
|
+
liveStreamRoomId?: string;
|
|
216
|
+
/**
|
|
217
|
+
* 选中直播间名称:
|
|
218
|
+
* - 有直播且被选中那场 ⇒ 对应名称
|
|
219
|
+
* - NO_LIVE 时可以不返回或返回空字符串
|
|
220
|
+
*/
|
|
221
|
+
liveStreamRoomName?: string;
|
|
222
|
+
/** 用户在该时间段选中直播的观看总时长(分钟,向下取整的整数) */
|
|
223
|
+
watchMinutes: number;
|
|
224
|
+
/**
|
|
225
|
+
* 看播状态(英文枚举,前端根据状态展示对应颜色):
|
|
226
|
+
* - COMPLETED ⇒ 已完成
|
|
227
|
+
* - INCOMPLETE ⇒ 未完成(包括 AudienceStatistics 有记录但分钟数为 0 的情况)
|
|
228
|
+
* - NOT_WATCHED ⇒ 未观看(有直播但用户完全没看,没有任何 AudienceStatistics 记录)
|
|
229
|
+
* - NO_LIVE ⇒ 无直播(该时间段内没有任何直播)
|
|
230
|
+
*/
|
|
231
|
+
status: 'COMPLETED' | 'INCOMPLETE' | 'NOT_WATCHED' | 'NO_LIVE';
|
|
139
232
|
}
|
|
140
233
|
interface BaseController {
|
|
141
234
|
getUserList(request: Request.GetUserList, req?: FastifyRequest): Promise<Response.GetUserList>;
|
|
142
235
|
exportUserList(request: Request.ExportUserList, req?: FastifyRequest): Promise<Response.ExportUserList>;
|
|
143
236
|
getLiveRoomUserList(request: Request.GetLiveRoomUserList, req?: FastifyRequest): Promise<Response.GetLiveRoomUserList>;
|
|
144
237
|
exportLiveRoomUserList(request: Request.ExportLiveRoomUserList, req?: FastifyRequest): Promise<Response.ExportLiveRoomUserList>;
|
|
238
|
+
getUserLiveWatchSummary(request: Request.GetUserLiveWatchSummary, req?: FastifyRequest): Promise<Response.GetUserLiveWatchSummary>;
|
|
239
|
+
getUserLiveWatchCalendar(request: Request.GetUserLiveWatchCalendar, req?: FastifyRequest): Promise<Response.GetUserLiveWatchCalendar>;
|
|
240
|
+
replaceThirdPartyUserIdToUserId(request: Request.ReplaceThirdPartyUserIdToUserId, req?: FastifyRequest): Promise<Response.ReplaceThirdPartyUserIdToUserId>;
|
|
145
241
|
}
|
|
146
242
|
}
|
|
147
243
|
/**
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -158,6 +158,8 @@ export interface ViewRecord {
|
|
|
158
158
|
coverImage: string;
|
|
159
159
|
/** 竖屏直播的封面图 URL。若未设置该参数值,则默认读取 CoverImage 的值。若通过控制台配置竖屏直播封面图且配置成功,则封面图的 URL 无协议头。若通过调用 API 接口配置竖屏直播封面图,则封面图的 URL 有协议头。 */
|
|
160
160
|
verticalCoverImage: string;
|
|
161
|
+
/** 分享封面,用于门店分享 */
|
|
162
|
+
shareCover: string;
|
|
161
163
|
/** 观看 URL。 */
|
|
162
164
|
viewUrl: string;
|
|
163
165
|
}
|