mirror of https://github.com/msgbyte/tailchat
chore: 迁移topic到单独插件上
parent
efa3f3634c
commit
db4930e36d
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "tailchat-plugin-topic",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"author": "moonrailgun",
|
||||
"description": "为群组提供话题功能",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21",
|
||||
"nanoid": "^3.1.23",
|
||||
"tailchat-server-sdk": "*"
|
||||
}
|
||||
}
|
@ -1,27 +1,28 @@
|
||||
import type {
|
||||
GroupTopicDocument,
|
||||
GroupTopicModel,
|
||||
} from '../../../models/group/topic';
|
||||
import _ from 'lodash';
|
||||
import {
|
||||
TcService,
|
||||
TcDbService,
|
||||
TcContext,
|
||||
call,
|
||||
GroupPanelType,
|
||||
db,
|
||||
call,
|
||||
} from 'tailchat-server-sdk';
|
||||
import { Types } from 'mongoose';
|
||||
import _ from 'lodash';
|
||||
import type { GroupTopicDocument, GroupTopicModel } from '../models/topic';
|
||||
const { Types } = db;
|
||||
|
||||
/**
|
||||
* 群组话题
|
||||
*/
|
||||
interface GroupTopicService
|
||||
extends TcService,
|
||||
TcDbService<GroupTopicDocument, GroupTopicModel> {}
|
||||
class GroupTopicService extends TcService {
|
||||
get serviceName(): string {
|
||||
return 'group.topic';
|
||||
return 'plugin:com.msgbyte.topic';
|
||||
}
|
||||
|
||||
onInit(): void {
|
||||
this.registerLocalDb(require('../../../models/group/topic').default);
|
||||
this.registerLocalDb(require('../models/topic').default);
|
||||
|
||||
this.registerAction('create', this.create, {
|
||||
params: {
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"label": "群组话题",
|
||||
"name": "com.msgbyte.topic",
|
||||
"url": "{BACKEND}/plugins/com.msgbyte.topic/index.js",
|
||||
"version": "0.0.0",
|
||||
"author": "moonrailgun",
|
||||
"description": "为群组提供话题功能",
|
||||
"requireRestart": true
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@plugins/com.msgbyte.topic",
|
||||
"main": "src/index.tsx",
|
||||
"version": "0.0.0",
|
||||
"description": "为群组提供话题功能",
|
||||
"private": true,
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"react": "17.0.2"
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
console.log('Plugin 群组话题 is loaded');
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react",
|
||||
"importsNotUsedAsValues": "error"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
declare module '@capital/common';
|
||||
declare module '@capital/component';
|
Loading…
Reference in New Issue