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 {
|
import _ from 'lodash';
|
||||||
GroupTopicDocument,
|
|
||||||
GroupTopicModel,
|
|
||||||
} from '../../../models/group/topic';
|
|
||||||
import {
|
import {
|
||||||
TcService,
|
TcService,
|
||||||
TcDbService,
|
TcDbService,
|
||||||
TcContext,
|
TcContext,
|
||||||
call,
|
|
||||||
GroupPanelType,
|
GroupPanelType,
|
||||||
|
db,
|
||||||
|
call,
|
||||||
} from 'tailchat-server-sdk';
|
} from 'tailchat-server-sdk';
|
||||||
import { Types } from 'mongoose';
|
import type { GroupTopicDocument, GroupTopicModel } from '../models/topic';
|
||||||
import _ from 'lodash';
|
const { Types } = db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群组话题
|
||||||
|
*/
|
||||||
interface GroupTopicService
|
interface GroupTopicService
|
||||||
extends TcService,
|
extends TcService,
|
||||||
TcDbService<GroupTopicDocument, GroupTopicModel> {}
|
TcDbService<GroupTopicDocument, GroupTopicModel> {}
|
||||||
class GroupTopicService extends TcService {
|
class GroupTopicService extends TcService {
|
||||||
get serviceName(): string {
|
get serviceName(): string {
|
||||||
return 'group.topic';
|
return 'plugin:com.msgbyte.topic';
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit(): void {
|
onInit(): void {
|
||||||
this.registerLocalDb(require('../../../models/group/topic').default);
|
this.registerLocalDb(require('../models/topic').default);
|
||||||
|
|
||||||
this.registerAction('create', this.create, {
|
this.registerAction('create', this.create, {
|
||||||
params: {
|
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