mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.6 KiB
Go
70 lines
2.6 KiB
Go
package models
|
|
|
|
import ()
|
|
|
|
type UserGet struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_id"`
|
|
}
|
|
|
|
type UserPatch struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_id"`
|
|
Username *string `json:"username" gorm:"varchar(100);unique;default:not null" parse:"json"`
|
|
Nickname *string `json:"nickname" parse:"json"`
|
|
Icon *string `json:"icon" parse:"json"`
|
|
Email *string `json:"email" gorm:"varchar(20);unique;default:null" parse:"json"`
|
|
Phone *string `json:"phone" gorm:"varchar(50);unique;default:null" parse:"json"`
|
|
Status *uint `json:"status" parse:"json"`
|
|
}
|
|
|
|
type UserDelete struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_id"`
|
|
}
|
|
|
|
type UserPost struct {
|
|
Username string `json:"username" gorm:"varchar(100);unique;default:not null" parse:"json"`
|
|
Nickname *string `json:"nickname" parse:"json"`
|
|
Icon *string `json:"icon" parse:"json"`
|
|
Email *string `json:"email" gorm:"varchar(20);unique;default:null" parse:"json"`
|
|
Phone *string `json:"phone" gorm:"varchar(50);unique;default:null" parse:"json"`
|
|
Salt string `json:"salt" gorm:"varchar(32)" parse:"json"`
|
|
Code string `json:"code" gorm:"varchar(128)" parse:"json"`
|
|
}
|
|
|
|
type UserList struct {
|
|
Username *string `json:"username" gorm:"type:varchar(100);unique;default:not null" parse:"query"`
|
|
Nickname *string `json:"nickname" gorm:"type:varchar(100)" parse:"query"`
|
|
Email *string `json:"email" gorm:"unique;type:varchar(50);default:null" parse:"query"`
|
|
Phone *string `json:"phone" gorm:"type:varchar(30);unique;default:null" parse:"query"`
|
|
Status *uint `json:"status" parse:"query"`
|
|
}
|
|
|
|
type UserRoleGet struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_role_id"`
|
|
UserID string `json:"user_id" parse:"path"`
|
|
}
|
|
|
|
type UserRolePatch struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_role_id"`
|
|
Status *string `json:"status" parse:"json"`
|
|
UserID string `json:"user_id" parse:"path"`
|
|
}
|
|
|
|
type UserRoleDelete struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@user_role_id"`
|
|
UserID string `json:"user_id" parse:"path"`
|
|
RoleID string `json:"role_id" parse:"json"`
|
|
AppID string `json:"app_id" parse:"json"`
|
|
}
|
|
|
|
type UserRolePost struct {
|
|
Status string `json:"status" parse:"json"`
|
|
RoleID string `json:"role_id" parse:"json"`
|
|
AppID string `json:"app_id" parse:"json"`
|
|
UserID string `json:"user_id" parse:"path"`
|
|
}
|
|
|
|
type UserRoleList struct {
|
|
UserID string `json:"user_id" parse:"path"`
|
|
Status *string `json:"status" parse:"query"`
|
|
}
|