mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 16:46:37 +08:00
feat(message-gateway): add profile bot pairing card
This commit is contained in:
@@ -23,7 +23,10 @@ import {
|
||||
import { AuthService } from './auth';
|
||||
import { ConfigService } from './config';
|
||||
import { DbManageService } from './db-manage';
|
||||
import { AdminMessageGatewayService } from './message-gateway';
|
||||
import {
|
||||
AdminMessageGatewayService,
|
||||
UserMessageGatewayService,
|
||||
} from './message-gateway';
|
||||
import { PushService } from './push';
|
||||
import { AdminUploadService, UploadService } from './upload';
|
||||
import { UserService } from './user';
|
||||
@@ -45,6 +48,7 @@ const services = {
|
||||
dbManage: DbManageService,
|
||||
push: PushService,
|
||||
adminMessageGateway: AdminMessageGatewayService,
|
||||
userMessageGateway: UserMessageGatewayService,
|
||||
} as const;
|
||||
|
||||
export default services;
|
||||
@@ -169,7 +173,10 @@ export type {
|
||||
} from './db-manage';
|
||||
|
||||
export { PushService } from './push';
|
||||
export { AdminMessageGatewayService } from './message-gateway';
|
||||
export {
|
||||
AdminMessageGatewayService,
|
||||
UserMessageGatewayService,
|
||||
} from './message-gateway';
|
||||
export type {
|
||||
MessageChannel,
|
||||
MessageChannelDefinition,
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
|
||||
export * from './types';
|
||||
export * from './admin.service';
|
||||
export * from './user.service';
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type {
|
||||
BindMessageChannelRequest,
|
||||
MessageBinding,
|
||||
PublicMessageChannel,
|
||||
} from './types';
|
||||
|
||||
export class UserMessageGatewayService extends BaseService {
|
||||
protected static readonly basePath = '/api/v1/message-gateway';
|
||||
|
||||
static async listBindings(): Promise<MessageBinding[]> {
|
||||
return this.get<MessageBinding[]>('/bindings');
|
||||
}
|
||||
|
||||
static async listChannels(): Promise<PublicMessageChannel[]> {
|
||||
return this.get<PublicMessageChannel[]>('/channels');
|
||||
}
|
||||
|
||||
static async bind(data: BindMessageChannelRequest): Promise<MessageBinding> {
|
||||
return this.post<MessageBinding>('/bindings', data);
|
||||
}
|
||||
|
||||
static async unbind(id: string): Promise<void> {
|
||||
return this.delete<void>(`/bindings/${id}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user