model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayFieldToSql

func DisplayFieldToSql(table string, field *schema.Field, concat bool) string

func DisplayPatternToSql

func DisplayPatternToSql(pattern string, modelSchema *schema.Schema, table string, nested bool) (string, map[string]*params.Conditions)

func PermissionsPrefix

func PermissionsPrefix(model interface{}) string

Types

type BaseModel

type BaseModel struct {
	Delete       bool   `gorm:"-" json:"$delete,omitempty"`
	DISPLAY_NAME string `gorm:"-" query:"" json:",omitempty" label:"Nome di visualizzazione"`
}

func (BaseModel) QueryDISPLAY_NAME

func (BaseModel) QueryDISPLAY_NAME(c *gin.Context, model interface{}, modelSchema *schema.Schema, table string, nested bool, query *string, args *[]any, rels map[string]*params.Conditions) message.Message

type ConditionsModel

type ConditionsModel interface {
	DefaultConditions(*gorm.DB, string) (query string, args []interface{})
}

type DisplayNamePatternModel

type DisplayNamePatternModel interface {
	DisplayNamePattern() string
}

type DisplayNameRelationsModel

type DisplayNameRelationsModel interface {
	DisplayNameRelations() []string
}

type JoinsModel

type JoinsModel interface {
	DefaultJoins(*gorm.DB, string) string
}

type ModelWithPermissionsDelete

type ModelWithPermissionsDelete interface {
	PermissionsDelete(c *gin.Context) message.Message
}

type ModelWithPermissionsGet

type ModelWithPermissionsGet interface {
	PermissionsGet(c *gin.Context) message.Message
}

type ModelWithPermissionsPatch

type ModelWithPermissionsPatch interface {
	PermissionsPatch(c *gin.Context) message.Message
}

type ModelWithPermissionsPost

type ModelWithPermissionsPost interface {
	PermissionsPost(c *gin.Context) message.Message
}

type ModelWithPermissionsPrefix

type ModelWithPermissionsPrefix interface {
	PermissionsPrefix() string
}

type OrderedModel

type OrderedModel interface {
	DefaultOrder(*gorm.DB, string) string
}

type PermissionFunc

type PermissionFunc func(c *gin.Context) message.Message

func PermissionsDelete

func PermissionsDelete(model interface{}) PermissionFunc

func PermissionsGet

func PermissionsGet(model interface{}) PermissionFunc

func PermissionsPatch

func PermissionsPatch(model interface{}) PermissionFunc

func PermissionsPost

func PermissionsPost(model interface{}) PermissionFunc

type TableModel

type TableModel interface {
	TableName() string
}

type UpdateCondition

type UpdateCondition struct {
	Field    string      `json:"field"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

type UpdateConditions

type UpdateConditions struct {
	Name       string                 `json:"name"`
	Default    bool                   `json:"default"`
	Conditions map[string]interface{} `json:"conditions"`
}

type UpdateConditionsModel

type UpdateConditionsModel interface {
	UpdateConditions() []UpdateConditions
}

type ValidationModel

type ValidationModel interface {
	Validate(*gin.Context) message.Message
}

Jump to

Keyboard shortcuts

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