mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 14:30:35 +07:00
fix: service imports
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
)
|
||||
|
||||
func GetServiceBindPath(structName string) string {
|
||||
path := fmt.Sprintf("../bindings/app/internal/services/%sservice.ts", strings.ToLower(structName))
|
||||
path := fmt.Sprintf("../../bindings/app/internal/services/%sservice.ts", strings.ToLower(structName))
|
||||
return path
|
||||
}
|
||||
|
||||
func GetServiceStructType(structName string) string {
|
||||
path := "../bindings/app/internal/services/models.ts"
|
||||
path := "../../bindings/app/internal/services/models.ts"
|
||||
return path
|
||||
}
|
||||
|
||||
func GetServiceType() string {
|
||||
path := "./types/service.type.ts"
|
||||
path := "../types/service.type.ts"
|
||||
return path
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func GenerateService(structName, mkPath string) {
|
||||
import type { %s } from "%s"
|
||||
import type { Service } from "%s"
|
||||
|
||||
export class %sService implements Service {
|
||||
export class %sService implements Service<%s> {
|
||||
async read(id: number) {
|
||||
return await GetById(id)
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export class %sService implements Service {
|
||||
return await ExportToExcel()
|
||||
}
|
||||
}
|
||||
`, GetServiceBindPath(structName), structName, GetServiceStructType(structName), GetServiceType(), structName, structName, structName, structName))
|
||||
`, GetServiceBindPath(structName), structName, GetServiceStructType(structName), GetServiceType(), structName, structName, structName, structName, structName))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user