2025-12-05 09:59:57 +08:00
|
|
|
package account
|
2025-12-04 17:09:04 +08:00
|
|
|
|
2025-12-05 14:25:39 +08:00
|
|
|
type Account struct {
|
2025-12-04 17:09:04 +08:00
|
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
|
Username string `gorm:"unique" json:"username"`
|
|
|
|
|
Password string `json:"-"`
|
2025-12-05 14:03:57 +08:00
|
|
|
Token string `json:"-"`
|
2025-12-04 17:09:04 +08:00
|
|
|
}
|
2025-12-16 18:46:24 +08:00
|
|
|
|
|
|
|
|
type CreateAccountRequest struct {
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type RenameRequest struct {
|
|
|
|
|
NewUsername string `json:"new_username"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FindByIDRequest struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FindByIDResponse struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FindByUsernameRequest struct {
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FindByUsernameResponse struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ChangePasswordRequest struct {
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
OldPassword string `json:"old_password"`
|
|
|
|
|
NewPassword string `json:"new_password"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type LoginRequest struct {
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
}
|