feat: generate schema from template

This commit is contained in:
2025-03-08 13:42:11 +07:00
parent c9a3a654dd
commit 7395354ae2
7 changed files with 116 additions and 68 deletions

View File

@@ -0,0 +1,27 @@
import { GetAll, Create, Delete, GetById, Update, Count } from "../../bindings/app/internal/services/authorservice.ts"
import type { Author } from "../../bindings/app/internal/services/models.ts"
import type { IService } from "../types/service.type.ts"
export default class AuthorService implements IService<Author> {
async read(id: number) {
return await GetById(id)
}
async readAll() {
return await GetAll() as Author[]
}
async create(item: Author) {
await Create(item)
}
async delete(id: number) {
return await Delete(id)
}
async update(item: Author) {
await Update(item)
}
async count() {
return await Count()
}
}