backend

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateController

func GenerateController(destPath, projName string, table config.TableSchema) error

func GenerateControllerRouter

func GenerateControllerRouter(destPath, projName string) error

func GenerateDAO

func GenerateDAO(destPath string, daoData DAOData) error

func GenerateMain

func GenerateMain(destPath, projName string, conf config.Config) error

func GenerateModel

func GenerateModel(destPath string, table config.TableSchema) error

Types

type BackendGeneratorImpl

type BackendGeneratorImpl struct {
	Config      config.Config
	Directories database.ProjectDirectories
}

func New

func New(
	config config.Config,
	directories database.ProjectDirectories,
) BackendGeneratorImpl

func (BackendGeneratorImpl) Generate

func (b BackendGeneratorImpl) Generate()

type ControllerData

type ControllerData struct {
	Version      string
	ProjectName  string
	Resource     string
	ResourceUrl  string
	TableIdField string
}

type DAOData

type DAOData struct {
	ProjectName  string
	Table        config.TableSchema
	DatabasePath string
}

type DAOTmplData

type DAOTmplData struct {
	Version           string
	ProjectName       string
	Resource          string
	Fields            []config.FieldSchema
	TableName         string
	TableColumns      []string
	DatabasePath      string
	QueryResource     string
	QueryResourceById string
	TableIdField      string
	ImportTime        bool
	ImportStrconv     bool
}

type FieldData

type FieldData struct {
	Name    string
	Type    string
	Exclude bool
}

type MainData

type MainData struct {
	Version     string
	ProjectName string
	Controllers []string
}

type ModelsData

type ModelsData struct {
	Version      string
	ImportTime   bool
	ResourceName string
	Fields       []FieldData
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL