transformer

package
v2.3.24 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAccountTransformer

type AuthAccountTransformer struct {
	ID         int     `json:"id"`
	Login      string  `json:"login"`
	FirstName  string  `json:"first_name"`
	SecondName *string `json:"second_name"`
	LastName   *string `json:"last_name"`
	Email      *string `json:"email"`
	Phone      *string `json:"phone"`

	Roles []*RoleTransformer `json:"roles"`
}

func AuthAccountTransform

func AuthAccountTransform(m *model2.User) *AuthAccountTransformer

type AuthTokenTransformer

type AuthTokenTransformer struct {
	Token        string  `json:"accessToken"`
	RefreshToken string  `json:"refreshToken"`
	ExpiresAt    float64 `json:"expires"`
	TokenType    string  `json:"token_type"`
	UserID       int     `json:"user_id"`

	User *AuthAccountTransformer `json:"user"`
}

func AuthTokenTransform

func AuthTokenTransform(m *model2.AuthToken) *AuthTokenTransformer

type PermissionListTransformer

type PermissionListTransformer struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Desc string `json:"desc"`
}

func PermissionListTransform

func PermissionListTransform(c *gin.Context, p []model.Permission) (r []PermissionListTransformer)

type PermissionTransformer

type PermissionTransformer struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Desc string `json:"desc"`
}

func PermissionTransform

func PermissionTransform(c *gin.Context, m *model.Permission) *PermissionTransformer

type RoleListTransformer

type RoleListTransformer struct {
	ID    int           `json:"id"`
	Name  string        `json:"name"`
	Read  []interface{} `json:"read"`
	Write []interface{} `json:"write"`
	Exec  []interface{} `json:"exec"`
}

func RoleListTransform

func RoleListTransform(c *gin.Context, p *model2.Pagination[model.Role]) []RoleListTransformer

type RoleTransformer

type RoleTransformer struct {
	ID    int           `json:"id"`
	Name  string        `json:"name"`
	Read  []interface{} `json:"read"`
	Write []interface{} `json:"write"`
	Exec  []interface{} `json:"exec"`
}

func RoleTransform

func RoleTransform(m *model.Role) *RoleTransformer

func RoleWithNameTransform

func RoleWithNameTransform(m *model.Role) *RoleTransformer

type SessionListTransformer added in v2.3.7

type SessionListTransformer struct {
	ID        int       `json:"id"`
	UserID    int       `json:"user_id"`
	DeviceID  *string   `json:"device_name"`
	LoggedAt  time.Time `json:"logged_at"`
	UpdatedAt time.Time `json:"updated_at"`

	User *UserSimpleTransformer `json:"user"`
}

func SessionListTransform added in v2.3.7

func SessionListTransform(c *gin.Context, p *model.Pagination[model2.RefreshToken]) []SessionListTransformer

type SettingTransformer

type SettingTransformer struct {
	Settings *string `json:"settings"`
}

func SettingTransform

func SettingTransform(m *model.Setting) *SettingTransformer

type SimpleRoleTransformer

type SimpleRoleTransformer struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func SimpleRoleTransform

func SimpleRoleTransform(m *model.Role) *SimpleRoleTransformer

type UserListTransformer

type UserListTransformer struct {
	ID         int     `json:"id"`
	Login      string  `json:"login"`
	FirstName  string  `json:"first_name"`
	SecondName *string `json:"second_name"`
	LastName   *string `json:"last_name"`
	Email      *string `json:"email"`
	Phone      *string `json:"phone"`
	Blocked    bool    `json:"blocked"`

	Roles []*SimpleRoleTransformer `json:"roles"`
}

func UserListTransform

func UserListTransform(c *gin.Context, p *model2.Pagination[model.User]) []UserListTransformer

type UserSimpleTransformer added in v2.3.7

type UserSimpleTransformer struct {
	ID         int     `json:"id"`
	Login      string  `json:"login"`
	FirstName  string  `json:"first_name"`
	SecondName *string `json:"second_name"`
	LastName   *string `json:"last_name"`
}

func UserSimpleTransform added in v2.3.7

func UserSimpleTransform(m *model.User) *UserSimpleTransformer

type UserTransformer

type UserTransformer struct {
	ID         int     `json:"id"`
	Login      string  `json:"login"`
	FirstName  string  `json:"first_name"`
	SecondName *string `json:"second_name"`
	LastName   *string `json:"last_name"`
	Email      *string `json:"email"`
	Phone      *string `json:"phone"`
	Blocked    bool    `json:"blocked"`

	Roles []*SimpleRoleTransformer `json:"roles"`
}

func UserTransform

func UserTransform(m *model.User) *UserTransformer

Jump to

Keyboard shortcuts

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