mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 19:40:34 +07:00
fix: gofmt && little fixes
This commit is contained in:
@@ -2,6 +2,7 @@ package generation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"nto_cli/utils"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -20,11 +21,11 @@ import type { IService } from "%s"
|
||||
|
||||
export default class %sService implements IService<%s> {
|
||||
async read(id: number) {
|
||||
return await GetById(id)
|
||||
return await GetById(id) as %s
|
||||
}
|
||||
|
||||
async readAll() {
|
||||
return await GetAll() as %s
|
||||
return await GetAll() as %s[]
|
||||
}
|
||||
|
||||
async create(item: %s) {
|
||||
@@ -33,16 +34,18 @@ export default class %sService implements IService<%s> {
|
||||
|
||||
async delete(id: number) {
|
||||
return await Delete(id)
|
||||
}
|
||||
}
|
||||
|
||||
async update(item: %s) {
|
||||
await Update(item)
|
||||
}
|
||||
|
||||
async count() {
|
||||
return await Count()
|
||||
}
|
||||
}
|
||||
`, utils.GetServiceBindPath(structName), structName, utils.GetServiceStructType(structName), utils.GetServiceType(), structName, structName, structName, structName))
|
||||
`, utils.GetServiceBindPath(structName), structName, utils.GetServiceStructType(structName), utils.GetServiceType(), structName, structName, structName, structName, structName, structName))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Fatalf("Failed to write to file: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user