@be-link/ecommerce-client-backend-service-node-sdk 0.1.38 → 0.1.40

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.
@@ -78,6 +78,47 @@ export declare namespace DataService {
78
78
  /** 事件发生时间,毫秒时间戳 */
79
79
  eventAt: number;
80
80
  }
81
+ /**
82
+ * 直播间观看任务信息分发结构
83
+ */
84
+ interface taskDurationPublish {
85
+ /** 直播间id */
86
+ liveStreamRoomId: string;
87
+ /** 任务id */
88
+ taskId: string;
89
+ /** 用户id */
90
+ userId: string;
91
+ /** 当时时间 */
92
+ currentTime: number;
93
+ /** 任务轮次时长 */
94
+ watchTime: number;
95
+ }
96
+ /**
97
+ * 用户直播间观看任务
98
+ */
99
+ interface userWatchTask {
100
+ /** 用户存储时长redis key */
101
+ userKey: string;
102
+ /** 直播间id */
103
+ liveStreamRoomId: string;
104
+ /** 当前时间 */
105
+ currentTime: number;
106
+ /** 任务 */
107
+ tasks: Task[];
108
+ }
109
+ /**
110
+ * 直播任务
111
+ */
112
+ interface Task {
113
+ id: string;
114
+ status: number;
115
+ taskStartTime: number;
116
+ taskEndTime: number;
117
+ liveStreamRoomId: string;
118
+ watchTime: number;
119
+ watchTimeRound: number;
120
+ updatedAt: number;
121
+ }
81
122
  /**
82
123
  * 根据用户id查询所在直播间信息
83
124
  */
@@ -17,6 +17,8 @@ declare class RoomServiceClass extends BaseService implements RoomService.BaseCo
17
17
  listByStoreBind(request: RoomService.Request.ListByStoreBind): Promise<RoomService.Response.ListByStoreBind>;
18
18
  /** 观看记录查询 */
19
19
  viewRecord(request: RoomService.Request.ViewRecord): Promise<RoomService.Response.ViewRecord>;
20
+ /** 门店直播规则查询 */
21
+ storeLiveStreamRule(request: RoomService.Request.StoreLiveStreamRule): Promise<RoomService.Response.StoreLiveStreamRule>;
20
22
  }
21
23
  export declare const roomService: RoomServiceClass;
22
24
  export default roomService;
@@ -59,6 +59,10 @@ let RoomServiceClass = class RoomServiceClass extends BaseService_1.default {
59
59
  viewRecord(request) {
60
60
  return (0, http_1.callApi)(this.getApiUrl(this.viewRecord), request);
61
61
  }
62
+ /** 门店直播规则查询 */
63
+ storeLiveStreamRule(request) {
64
+ return (0, http_1.callApi)(this.getApiUrl(this.storeLiveStreamRule), request);
65
+ }
62
66
  };
63
67
  __decorate([
64
68
  (0, tsoa_1.OperationId)('同步活动'),
@@ -120,6 +124,11 @@ __decorate([
120
124
  (0, tsoa_1.Post)('view-record'),
121
125
  __param(0, (0, tsoa_1.Body)())
122
126
  ], RoomServiceClass.prototype, "viewRecord", null);
127
+ __decorate([
128
+ (0, tsoa_1.OperationId)('门店直播规则查询'),
129
+ (0, tsoa_1.Post)('store-live-stream-rule'),
130
+ __param(0, (0, tsoa_1.Body)())
131
+ ], RoomServiceClass.prototype, "storeLiveStreamRule", null);
123
132
  RoomServiceClass = __decorate([
124
133
  (0, tsoa_1.Route)('room'),
125
134
  (0, tsoa_1.Tags)('Room')
@@ -61,6 +61,12 @@ export declare namespace RoomService {
61
61
  /** 直播间ID */
62
62
  liveStreamRoomId: string;
63
63
  }
64
+ interface StoreLiveStreamRule {
65
+ /** 直播间ID */
66
+ liveStreamRoomId: string;
67
+ /** 门店ID */
68
+ storeId: string;
69
+ }
64
70
  /**
65
71
  * 绑定门店
66
72
  */
@@ -185,6 +191,9 @@ export declare namespace RoomService {
185
191
  list: ViewRecordType[];
186
192
  total: number;
187
193
  }
194
+ interface StoreLiveStreamRule {
195
+ rule: boolean;
196
+ }
188
197
  }
189
198
  interface BaseController {
190
199
  sync(request: ListActivityAPIRequest): Promise<ListActivityAPIResponse>;
@@ -202,5 +211,6 @@ export declare namespace RoomService {
202
211
  */
203
212
  listByStoreBind(request: Request.ListByStoreBind, req?: FastifyRequest): Promise<Response.ListByStoreBind>;
204
213
  viewRecord(request: Request.ViewRecord, req?: FastifyRequest): Promise<Response.ViewRecord>;
214
+ storeLiveStreamRule(request: Request.StoreLiveStreamRule, req?: FastifyRequest): Promise<Response.StoreLiveStreamRule>;
205
215
  }
206
216
  }
@@ -0,0 +1,11 @@
1
+ import { RuleService } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class RuleServiceClass extends BaseService implements RuleService.BaseController {
4
+ protected prefixUrl: string;
5
+ createRoomVisibilityRule(request: RuleService.Request.Create): Promise<void>;
6
+ deleteRoomVisibilityRule(request: RuleService.Request.Delete): Promise<void>;
7
+ getRoomVisibilityRuleList(request: RuleService.Request.List): Promise<RuleService.Response.List>;
8
+ checkRoomVisibilityRule(request: RuleService.Request.Check): Promise<RuleService.Response.Check>;
9
+ }
10
+ export declare const ruleService: RuleServiceClass;
11
+ export default ruleService;
@@ -0,0 +1,62 @@
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.ruleService = void 0;
16
+ const tsoa_1 = require("tsoa");
17
+ const http_1 = require("../../utils/http");
18
+ const BaseService_1 = __importDefault(require("../BaseService"));
19
+ let RuleServiceClass = class RuleServiceClass extends BaseService_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.prefixUrl = '/rule';
23
+ }
24
+ createRoomVisibilityRule(request) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.createRoomVisibilityRule), request);
26
+ }
27
+ deleteRoomVisibilityRule(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.deleteRoomVisibilityRule), request);
29
+ }
30
+ getRoomVisibilityRuleList(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.getRoomVisibilityRuleList), request);
32
+ }
33
+ checkRoomVisibilityRule(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.checkRoomVisibilityRule), request);
35
+ }
36
+ };
37
+ __decorate([
38
+ (0, tsoa_1.OperationId)('创建直播间可见性规则'),
39
+ (0, tsoa_1.Post)('create'),
40
+ __param(0, (0, tsoa_1.Body)())
41
+ ], RuleServiceClass.prototype, "createRoomVisibilityRule", null);
42
+ __decorate([
43
+ (0, tsoa_1.OperationId)('删除直播间可见性规则'),
44
+ (0, tsoa_1.Post)('delete'),
45
+ __param(0, (0, tsoa_1.Body)())
46
+ ], RuleServiceClass.prototype, "deleteRoomVisibilityRule", null);
47
+ __decorate([
48
+ (0, tsoa_1.OperationId)('获取直播间可见性规则列表'),
49
+ (0, tsoa_1.Post)('list'),
50
+ __param(0, (0, tsoa_1.Body)())
51
+ ], RuleServiceClass.prototype, "getRoomVisibilityRuleList", null);
52
+ __decorate([
53
+ (0, tsoa_1.OperationId)('检查直播间可见性规则'),
54
+ (0, tsoa_1.Post)('check'),
55
+ __param(0, (0, tsoa_1.Body)())
56
+ ], RuleServiceClass.prototype, "checkRoomVisibilityRule", null);
57
+ RuleServiceClass = __decorate([
58
+ (0, tsoa_1.Route)('rule'),
59
+ (0, tsoa_1.Tags)('Rule')
60
+ ], RuleServiceClass);
61
+ exports.ruleService = new RuleServiceClass();
62
+ exports.default = exports.ruleService;
@@ -0,0 +1,77 @@
1
+ import { FastifyRequest } from 'fastify';
2
+ export declare namespace RuleService {
3
+ interface Info {
4
+ /** 直播间id */
5
+ liveStreamRoomId: string;
6
+ /** 规则分类:city-城市、delivery-配送、tag-标签 */
7
+ cate: string;
8
+ /** 规则值 */
9
+ ruleValue: string;
10
+ /** 规则效果:allow-允许、deny-拒绝 */
11
+ effect: string;
12
+ }
13
+ interface Extra {
14
+ /** 规则ID */
15
+ id: number;
16
+ /** 创建时间 */
17
+ createdAt: number;
18
+ }
19
+ type RoomVisibilityRule = Info & Extra;
20
+ namespace Request {
21
+ /**
22
+ * 获取直播间可见性规则列表
23
+ */
24
+ interface List {
25
+ /** 直播间id */
26
+ liveStreamRoomId: string;
27
+ }
28
+ /**
29
+ * 创建直播间可见性规则
30
+ */
31
+ type Create = Info;
32
+ /**
33
+ * 删除直播间可见性规则
34
+ */
35
+ interface Delete {
36
+ /** 规则 ID */
37
+ id: number;
38
+ }
39
+ /**
40
+ * 检查直播间可见性规则
41
+ */
42
+ interface Check {
43
+ /** 直播间id */
44
+ liveStreamRoomId: string;
45
+ /** 门店id */
46
+ storeId: string;
47
+ }
48
+ }
49
+ namespace Response {
50
+ /**
51
+ * 获取直播间可见性规则列表
52
+ */
53
+ interface List {
54
+ /** 规则列表 */
55
+ list: RoomVisibilityRule[];
56
+ }
57
+ /**
58
+ * 检查直播间可见性规则
59
+ */
60
+ interface Check {
61
+ /** 是否可见 */
62
+ visible: boolean;
63
+ /** 不可见时的提示信息 */
64
+ message?: string;
65
+ }
66
+ }
67
+ interface BaseController {
68
+ /** 创建直播间可见性规则 */
69
+ createRoomVisibilityRule(request: RuleService.Request.Create, req: FastifyRequest): Promise<void>;
70
+ /** 删除直播间可见性规则 */
71
+ deleteRoomVisibilityRule(request: RuleService.Request.Delete, req: FastifyRequest): Promise<void>;
72
+ /** 获取直播间可见性规则列表 */
73
+ getRoomVisibilityRuleList(request: RuleService.Request.List, req: FastifyRequest): Promise<RuleService.Response.List>;
74
+ /** 检查直播间可见性规则 */
75
+ checkRoomVisibilityRule(request: RuleService.Request.Check, req: FastifyRequest): Promise<RuleService.Response.Check>;
76
+ }
77
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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.38",
3
+ "version": "0.1.40",
4
4
  "description": "EcommerceClientBackendService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",