mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-07 03:10:33 +07:00
18 lines
400 B
Go
18 lines
400 B
Go
package generation
|
|
|
|
import (
|
|
"fmt"
|
|
"nto_cli/entities"
|
|
"nto_cli/utils"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func Generate(structName string, fields []entities.Field) {
|
|
mkPath := fmt.Sprintf("%s/frontend/src/%s", utils.FindFrontendPath() , strings.ToLower(structName))
|
|
if err := os.Mkdir(mkPath, 0755); err != nil {
|
|
panic(err)
|
|
}
|
|
GenerateService(structName, mkPath)
|
|
GenerateScheme(structName, fields, mkPath)
|
|
} |