@be-link/ecommerce-client-backend-service-node-sdk 0.1.39 → 0.1.41
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/index.d.ts +2 -0
- package/index.js +3 -1
- package/modules/rule/service.d.ts +11 -0
- package/modules/rule/service.js +62 -0
- package/modules/rule/types.d.ts +77 -0
- package/modules/rule/types.js +2 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type { RoomService } from './modules/room/types';
|
|
2
2
|
export type { DataService } from './modules/data/types';
|
|
3
3
|
export type { DomainService } from './modules/domain/types';
|
|
4
|
+
export type { RuleService } from './modules/rule/types';
|
|
4
5
|
export { roomService } from './modules/room/service';
|
|
5
6
|
export { dataService } from './modules/data/service';
|
|
6
7
|
export { domainService } from './modules/domain/service';
|
|
8
|
+
export { ruleService } from './modules/rule/service';
|
|
7
9
|
export { ENUM as CLIENT_BACKEND_ENUM } from './enum';
|
|
8
10
|
export type { Room, RoomAutoStartConfig, RoomLoopVideo, RoomTag, RoomBindStore } from './types';
|
|
9
11
|
export type { Domain, Current } from './modules/domain/types';
|
package/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLIENT_BACKEND_ENUM = exports.domainService = exports.dataService = exports.roomService = void 0;
|
|
3
|
+
exports.CLIENT_BACKEND_ENUM = exports.ruleService = exports.domainService = exports.dataService = exports.roomService = void 0;
|
|
4
4
|
var service_1 = require("./modules/room/service");
|
|
5
5
|
Object.defineProperty(exports, "roomService", { enumerable: true, get: function () { return service_1.roomService; } });
|
|
6
6
|
var service_2 = require("./modules/data/service");
|
|
7
7
|
Object.defineProperty(exports, "dataService", { enumerable: true, get: function () { return service_2.dataService; } });
|
|
8
8
|
var service_3 = require("./modules/domain/service");
|
|
9
9
|
Object.defineProperty(exports, "domainService", { enumerable: true, get: function () { return service_3.domainService; } });
|
|
10
|
+
var service_4 = require("./modules/rule/service");
|
|
11
|
+
Object.defineProperty(exports, "ruleService", { enumerable: true, get: function () { return service_4.ruleService; } });
|
|
10
12
|
var enum_1 = require("./enum");
|
|
11
13
|
Object.defineProperty(exports, "CLIENT_BACKEND_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
|
|
12
14
|
// 服务.模块.枚举名称.枚举值 示例: DEMO_ENUM.ORDER_ENUM.STATUS.PENDING
|
|
@@ -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
|
+
}
|