user

package
v0.0.0-...-41ad4b5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FieldFilterCondition = []base.SerializersField{
		{
			Field: "id",
			Type:  base.ContainsExpressionEnum,
		},
		{
			Field: "username",
			Type:  base.LikeExpressionEnum,
		},
		{
			Field: "name",
			Type:  base.LikeExpressionEnum,
		}, {
			Field: "email",
			Type:  base.LikeExpressionEnum,
		}, {
			Field:  "isAdmin",
			Column: "is_admin",
			Type:   base.EqualExpressionEnum,
		}, {
			Field:  "isActive",
			Column: "is_active",
			Type:   base.EqualExpressionEnum,
		}, {
			Field:  "groupId",
			Column: "group_id",
			Type:   base.EqualExpressionEnum,
		},
		{
			Field:  "users",
			Column: "username",
			Type:   base.ContainsExpressionEnum,
		},
		{
			Field:  "userIds",
			Column: "id",
			Type:   base.ContainsExpressionEnum,
		},
	}
)

Functions

func Create

func Create(c echo.Context) error

func CurrentUserInfo

func CurrentUserInfo(c echo.Context) error

func Delete

func Delete(c echo.Context) error

func List

func List(c echo.Context) error

func Login

func Login(ctx echo.Context) error

func Logout

func Logout(ctx echo.Context) error

func Update

func Update(c echo.Context) error

Types

type LoginForm

type LoginForm struct {
	Username string `validate:"required" json:"username"`
	Password string `validate:"required" json:"password"`
}

type LoginResponseContent

type LoginResponseContent struct {
	Value      string `json:"value"`
	ExpireTime string `json:"expireTime"`
}

type Serializer

type Serializer struct {
	Filter map[string]interface{}
	// contains filtered or unexported fields
}

func NewSerializer

func NewSerializer() *Serializer

func (*Serializer) ExtraFilter

func (c *Serializer) ExtraFilter(query map[string]interface{}) map[string]interface{}

func (*Serializer) GetParams

func (c *Serializer) GetParams() base.SerializersParams

func (*Serializer) Order

func (c *Serializer) Order() []string

func (*Serializer) Preload

func (c *Serializer) Preload() []string

func (*Serializer) QueryBeforeHook

func (c *Serializer) QueryBeforeHook(ctx echo.Context, tx *gorm.DB, query map[string]interface{}) (*gorm.DB, error)

func (*Serializer) Response

func (c *Serializer) Response(data base.ResponseContent, query map[string]interface{}) base.ResponseContent

Jump to

Keyboard shortcuts

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