mirror of https://github.com/msgbyte/tailchat
parent
8be2c2dedb
commit
efa3f3634c
@ -0,0 +1,7 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
externalDeps: ['react'],
|
||||||
|
pluginRoot: path.resolve(__dirname, './web'),
|
||||||
|
outDir: path.resolve(__dirname, '../../public'),
|
||||||
|
};
|
@ -0,0 +1,20 @@
|
|||||||
|
import { db } from 'tailchat-server-sdk';
|
||||||
|
const { getModelForClass, prop, modelOptions, TimeStamps } = db;
|
||||||
|
|
||||||
|
@modelOptions({
|
||||||
|
options: {
|
||||||
|
customName: 'p_{{pickPluginName id}}',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export class {{pickPluginNameUp id}} extends TimeStamps implements db.Base {
|
||||||
|
_id: db.Types.ObjectId;
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type {{pickPluginNameUp id}}Document = db.DocumentType<{{pickPluginNameUp id}}>;
|
||||||
|
|
||||||
|
const model = getModelForClass({{pickPluginNameUp id}});
|
||||||
|
|
||||||
|
export type {{pickPluginNameUp id}}Model = typeof model;
|
||||||
|
|
||||||
|
export default model;
|
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "tailchat-plugin-{{pickPluginName id}}",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"author": "{{author}}",
|
||||||
|
"description": "{{desc}}",
|
||||||
|
"license": "MIT",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {},
|
||||||
|
"devDependencies": {},
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
import { TcService, TcDbService } from 'tailchat-server-sdk';
|
||||||
|
import type { {{pickPluginNameUp id}}Document, {{pickPluginNameUp id}}Model } from '../models/{{pickPluginName id}}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务管理服务
|
||||||
|
*/
|
||||||
|
interface {{pickPluginNameUp id}}Service
|
||||||
|
extends TcService,
|
||||||
|
TcDbService<{{pickPluginNameUp id}}Document, {{pickPluginNameUp id}}Model> {}
|
||||||
|
class {{pickPluginNameUp id}}Service extends TcService {
|
||||||
|
get serviceName() {
|
||||||
|
return 'plugin:{{id}}';
|
||||||
|
}
|
||||||
|
|
||||||
|
onInit() {
|
||||||
|
this.registerLocalDb(require('../models/{{pickPluginName id}}').default);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {{pickPluginNameUp id}}Service;
|
Loading…
Reference in New Issue