mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 11:27:17 +08:00
33 lines
727 B
Go
33 lines
727 B
Go
package request
|
|
|
|
import "net/http"
|
|
|
|
type UserTokenList struct {
|
|
UserID uint `query:"user_id"`
|
|
Paginate
|
|
}
|
|
|
|
type UserTokenCreate struct {
|
|
UserID uint `json:"user_id" validate:"required|exists:users,id"`
|
|
IPs []string `json:"ips"`
|
|
ExpiredAt int64 `json:"expired_at" validate:"required"`
|
|
}
|
|
|
|
func (r *UserTokenCreate) Rules(_ *http.Request) map[string]string {
|
|
return map[string]string{
|
|
"IPs.*": "required|ipcidr",
|
|
}
|
|
}
|
|
|
|
type UserTokenUpdate struct {
|
|
ID uint `uri:"id"`
|
|
IPs []string `json:"ips"`
|
|
ExpiredAt int64 `json:"expired_at" validate:"required"`
|
|
}
|
|
|
|
func (r *UserTokenUpdate) Rules(_ *http.Request) map[string]string {
|
|
return map[string]string{
|
|
"IPs.*": "required|ipcidr",
|
|
}
|
|
}
|