import { User } from '@/models' ; import { event , ServiceModule } from '@/services/index' ; export default class UserService extends ServiceModule { get model ( ) { return this . app . database . getRepository ( User ) ! ; } param name param surname @ event ( '/user/add' ) async insert ( name , surname ) { return this . model . save ( { name , surname } ) ; } /**
     * 查找所有
     */ @ event ( '/user/find-all' ) async finAll ( ) { return this . model . find ( ) ; } }