This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
crudgen/internal/templates.go
2025-03-12 15:57:30 +07:00

36 lines
853 B
Go

package internal
type CrudTemplatesContext struct {
ServiceName string
EntityType string
EntityPlural string
}
var ServiceImports = []string{
"app/internal/dal",
"app/internal/database",
"app/internal/models",
"app/internal/utils",
"errors",
"gorm.io/gen/field",
"gorm.io/gorm",
}
const CreateMethod = "Create"
const GetAllMethod = "GetAll"
const GetByIdMethod = "GetById"
const UpdateMethod = "Update"
const DeleteMethod = "Delete"
const CountMethod = "Count"
const SortedByOrderMethod = "SortedByOrder"
var RawTemplates = map[string]string{
CreateMethod: CreateRawTemplate,
GetAllMethod: GetAllRawTemplate,
GetByIdMethod: GetByIdRawTemplate,
UpdateMethod: UpdateRawTemplate,
DeleteMethod: DeleteRawTemplate,
CountMethod: CountRawTemplate,
SortedByOrderMethod: SortedByOrderTemplate,
}