代码跑通了,数据库插不进去
switch (v['type']){
case 100:
await MovieDao.addMovie(v)
break
}
}
import { LinRouter, success } from 'lin-mizar';
import { ContentService } from '../../service/content';
import { addContentValidator, contentValidator } from '../../validators/content';
const contentApi=new LinRouter(
{
prefix: "/v1/content",
}
)
contentApi.post('/', async ctx => {
const v= await new addContentValidator().validate(ctx)
await ContentService.addcontent(v.get('body'))
ctx .success({
msg:'请求成功'
})
})
module.exports={ contentApi}
、