feat: add short_code field to device login API

- Add optional short_code parameter to DeviceLoginRequest
- Add ShortCode field to Device model
- Save short_code to database during device registration
- Add database migration for user_device.short_code column
- Fix duplicate variable declaration in routes.go
This commit is contained in:
EUForest
2026-01-10 18:11:24 +08:00
parent ed669d0620
commit 3359704a45
7 changed files with 10 additions and 2 deletions
+1
View File
@@ -558,6 +558,7 @@ type DeviceLoginRequest struct {
IP string `header:"X-Original-Forwarded-For"`
UserAgent string `json:"user_agent" validate:"required"`
CfToken string `json:"cf_token,optional"`
ShortCode string `json:"short_code,optional"`
}
type Document struct {