package model // CreateAccountRequest 创建账号请求 type CreateAccountRequest struct { Username string `json:"username" validate:"required,min=3,max=50"` Phone string `json:"phone" validate:"required,len=11"` Password string `json:"password" validate:"required,min=8,max=32"` UserType int `json:"user_type" validate:"required,min=1,max=4"` ShopID *uint `json:"shop_id"` ParentID *uint `json:"parent_id"` } // UpdateAccountRequest 更新账号请求 type UpdateAccountRequest struct { Username *string `json:"username" validate:"omitempty,min=3,max=50"` Phone *string `json:"phone" validate:"omitempty,len=11"` Password *string `json:"password" validate:"omitempty,min=8,max=32"` Status *int `json:"status" validate:"omitempty,min=0,max=1"` } // AccountListRequest 账号列表查询请求 type AccountListRequest struct { Page int `json:"page" query:"page" validate:"omitempty,min=1"` PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100"` Username string `json:"username" query:"username" validate:"omitempty,max=50"` Phone string `json:"phone" query:"phone" validate:"omitempty,max=20"` UserType *int `json:"user_type" query:"user_type" validate:"omitempty,min=1,max=4"` Status *int `json:"status" query:"status" validate:"omitempty,min=0,max=1"` } // AccountResponse 账号响应 type AccountResponse struct { ID uint `json:"id"` Username string `json:"username"` Phone string `json:"phone"` UserType int `json:"user_type"` ShopID *uint `json:"shop_id,omitempty"` ParentID *uint `json:"parent_id,omitempty"` Status int `json:"status"` Creator uint `json:"creator"` Updater uint `json:"updater"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` } // AssignRolesRequest 分配角色请求 type AssignRolesRequest struct { RoleIDs []uint `json:"role_ids" validate:"required,min=1"` }