Documentation ¶
Index ¶
Constants ¶
View Source
const (
AppName = "user"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { Username string `json:"username" gorm:"column:username"` Password string `json:"password"` Role Role `json:"role"` // contains filtered or unexported fields }
func NewCreateUserRequest ¶
func NewCreateUserRequest() *CreateUserRequest
func (*CreateUserRequest) PasswordHash ¶
func (req *CreateUserRequest) PasswordHash()
func (*CreateUserRequest) SetIsHashed ¶
func (req *CreateUserRequest) SetIsHashed()
func (*CreateUserRequest) Validate ¶
func (req *CreateUserRequest) Validate() error
type DeleteUserRequest ¶
type DeleteUserRequest struct {
Id int64 `json:"id"`
}
type QueryUserBy ¶
type QueryUserBy int
const ( Query_UserBy_Id QueryUserBy = iota //普通用户 通过0 1来确定查询的id或者name条件 Query_UserBy_Username )
type QueryUserRequest ¶
type QueryUserRequest struct { QueryUserBy QueryUserBy `json:"queryuser_id"` QueryUserByUsername string `json:"queryuser_username"` }
func NewQueryUserRequestID ¶
func NewQueryUserRequestID(id string) *QueryUserRequest
func NewQueryUserRequestName ¶
func NewQueryUserRequestName(name string) *QueryUserRequest
type Service ¶
type Service interface { CreateUser(context.Context, *CreateUserRequest) (*User, error) DeleteUser(context.Context, *DeleteUserRequest) error QueryUser(context.Context, *QueryUserRequest) (*User, error) }
type User ¶
type User struct { *common.Meta *CreateUserRequest }
func NewUser ¶
func NewUser(req *CreateUserRequest) *User
func (*User) CheckPassword ¶
Click to show internal directories.
Click to hide internal directories.