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