tools

package
v0.0.0-...-fdb5249 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(param *Param) error

func GenerateTables

func GenerateTables(outputPath, packageName string, tables []string, isNew bool) error

func InsertPermissionInfoDB

func InsertPermissionInfoDB(conn db.Connection, name, slug, httpMethod, httpPath string)

func InsertPermissionOfTable

func InsertPermissionOfTable(conn db.Connection, table string)

Types

type Config

type Config struct {
	Connection       string        `json:"connection"`
	Driver           string        `json:"driver"`
	Package          string        `json:"package"`
	Table            string        `json:"table"`
	Schema           string        `json:"schema"`
	Output           string        `json:"output"`
	Conn             db.Connection `json:"conn"`
	HideFilterArea   bool          `json:"hide_filter_area"`
	HideNewButton    bool          `json:"hide_new_button"`
	HideExportButton bool          `json:"hide_export_button"`
	HideEditButton   bool          `json:"hide_edit_button"`
	HideDeleteButton bool          `json:"hide_delete_button"`
	HideDetailButton bool          `json:"hide_detail_button"`
	HideFilterButton bool          `json:"hide_filter_button"`
	HideRowSelector  bool          `json:"hide_row_selector"`
	HidePagination   bool          `json:"hide_pagination"`
	HideQueryInfo    bool          `json:"hide_query_info"`
	FilterFormLayout form.Layout   `json:"filter_form_layout"`
	ExtraImport      string        `json:"extra_import"`

	TableTitle        string `json:"table_title"`
	TableDescription  string `json:"table_description"`
	FormTitle         string `json:"form_title"`
	FormDescription   string `json:"form_description"`
	DetailTitle       string `json:"detail_title"`
	DetailDescription string `json:"detail_description"`

	HideContinueEditCheckBox bool `json:"hide_continue_edit_check_box"`
	HideContinueNewCheckBox  bool `json:"hide_continue_new_check_box"`
	HideResetButton          bool `json:"hide_reset_button"`
	HideBackButton           bool `json:"hide_back_button"`

	DetailDisplay uint8 `json:"detail_display"`

	ExtraCode string `json:"extra_code"`
}

type Field

type Field struct {
	Head         string `json:"head"`
	Name         string `json:"name"`
	DBType       string `json:"db_type"`
	FormType     string `json:"form_type"`
	Filterable   bool   `json:"filterable"`
	Sortable     bool   `json:"sortable"`
	InfoEditable bool   `json:"info_editable"`
	Editable     bool   `json:"editable"`
	Hide         bool   `json:"hide"`
	FormHide     bool   `json:"form_hide"`
	EditHide     bool   `json:"edit_hide"`
	CreateHide   bool   `json:"create_hide"`
	Default      string `json:"default"`
	CanAdd       bool   `json:"can_add"`
	ExtraFun     string `json:"extra_fun"`
}

type Fields

type Fields []Field

type Param

type Param struct {
	Connection string `json:"connection"`
	Driver     string `json:"driver"`
	Package    string `json:"package"`

	Table      string `json:"table"`
	RowTable   string `json:"row_table"`
	TableTitle string `json:"table_title"`
	TableName  string `json:"table_name"`

	HideFilterArea   bool        `json:"hide_filter_area"`
	HideNewButton    bool        `json:"hide_new_button"`
	HideExportButton bool        `json:"hide_export_button"`
	HideEditButton   bool        `json:"hide_edit_button"`
	HideDeleteButton bool        `json:"hide_delete_button"`
	HideDetailButton bool        `json:"hide_detail_button"`
	HideFilterButton bool        `json:"hide_filter_button"`
	HideRowSelector  bool        `json:"hide_row_selector"`
	HidePagination   bool        `json:"hide_pagination"`
	HideQueryInfo    bool        `json:"hide_query_info"`
	FilterFormLayout form.Layout `json:"filter_form_layout"`

	HideContinueEditCheckBox bool `json:"hide_continue_edit_check_box"`
	HideContinueNewCheckBox  bool `json:"hide_continue_new_check_box"`
	HideResetButton          bool `json:"hide_reset_button"`
	HideBackButton           bool `json:"hide_back_button"`

	TablePageTitle    string `json:"table_title"`
	TableDescription  string `json:"table_description"`
	FormTitle         string `json:"form_title"`
	FormDescription   string `json:"form_description"`
	DetailTitle       string `json:"detail_title"`
	DetailDescription string `json:"detail_description"`

	ExtraImport string `json:"extra_import"`
	ExtraCode   string `json:"extra_code"`

	Fields       Fields `json:"fields"`
	FormFields   Fields `json:"form_fields"`
	DetailFields Fields `json:"detail_fields"`

	DetailDisplay uint8 `json:"detail_display"`

	Output string `json:"output"`
}

func NewParam

func NewParam(cfg Config) *Param

func NewParamWithFields

func NewParamWithFields(cfg Config, fields ...Fields) *Param

Jump to

Keyboard shortcuts

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