add base controller

This commit is contained in:
zhl 2021-08-05 15:36:02 +08:00
parent 9a04281641
commit bed292aa12
4 changed files with 12 additions and 2 deletions

View File

@ -16,6 +16,7 @@ module.exports = {
PORT: 2987,
DEBUG: 'jc:*',
NODE_ENV: 'production',
NODE_PATH: './dist',
},
},
],

View File

@ -59,7 +59,6 @@
"prettier": "^2.3.0",
"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0",
"tslint": "^6.1.1",
"typescript": "^4.1.3"
}
}

View File

@ -1,7 +1,7 @@
import fastify, { FastifyError, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'
import helmet from 'fastify-helmet'
import { IncomingMessage, Server, ServerResponse } from 'http'
import { RouterMap } from 'decorators/router'
import { RouterMap } from './decorators/router'
import { mongoose } from '@typegoose/typegoose'
import logger from 'logger/logger'
import config from 'config/config'

View File

@ -0,0 +1,10 @@
import { role, router } from '../decorators/router'
import BaseController from '../common/base.controller'
class SubscribeController extends BaseController {
@role('anon')
@router('post /api/svr/send_msg')
async receive(req: any) {
return {}
}
}