feat: getting frontend dir, service binding

This commit is contained in:
2025-02-14 09:02:06 +07:00
parent d6825508e9
commit 013a3be72b
6 changed files with 48 additions and 13 deletions

View File

@@ -2,12 +2,19 @@ package generation
import (
"fmt"
"nto_cli/utils"
"os"
"strings"
)
func GenerateService(structName, mkName string) {
serviceFile, err := os.Create(mkName + "/" + strings.ToLower(structName) + ".service.ts")
func GetServiceBindPath(structName string) string {
path := utils.FindFrontendPath()
path += fmt.Sprintf("/bindings/app/internal/services/%sservice.ts", strings.ToLower(structName))
return path
}
func GenerateService(structName, mkPath string) {
serviceFile, err := os.Create(mkPath + "/" + strings.ToLower(structName) + ".service.ts")
if err != nil {
panic(err)
}