Documentation
¶
Index ¶
- type AuthAccountTransformer
- type AuthTokenTransformer
- type FilterListTransformer
- type FilterTransformer
- type PermissionListTransformer
- type PermissionTransformer
- type RoleListTransformer
- type RoleTransformer
- type SessionListTransformer
- type SettingTransformer
- type SimpleRoleTransformer
- type UserListTransformer
- type UserSimpleTransformer
- type UserTransformer
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"`
Profile interface{} `json:"profile,omitempty"`
}
func AuthAccountTransform ¶
func AuthAccountTransform[Model any](m *model2.User, profileTransformer profile.ITransformer[Model]) *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[Model any](m *model2.AuthToken, profileTransformer profile.ITransformer[Model]) *AuthTokenTransformer
type FilterListTransformer ¶ added in v2.3.99
type FilterListTransformer struct {
ID int `json:"id"`
Endpoint string `json:"endpoint"`
Name string `json:"name"`
Value string `json:"value"`
}
func FilterListTransform ¶ added in v2.3.99
func FilterListTransform(c *gin.Context, p *model2.Pagination[model.Filter]) []FilterListTransformer
type FilterTransformer ¶ added in v2.3.99
type FilterTransformer struct {
ID int `json:"id"`
Endpoint string `json:"endpoint"`
Name string `json:"name"`
Value string `json:"value"`
}
func FilterTransform ¶ added in v2.3.99
func FilterTransform(m *model.Filter) *FilterTransformer
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 ¶
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"`
Profile interface{} `json:"profile,omitempty"`
}
func UserListTransform ¶
func UserListTransform[Model any](c *gin.Context, p *model2.Pagination[model.User], profileTransformer profile.ITransformer[Model]) []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"`
Profile interface{} `json:"profile,omitempty"`
}
func UserTransform ¶
func UserTransform[Model any](m *model.User, profileTransformer profile.ITransformer[Model]) *UserTransformer
Click to show internal directories.
Click to hide internal directories.