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
@@ -0,0 +1,2 @@
-- Remove short_code column from user_device table
ALTER TABLE `user_device` DROP COLUMN `short_code`;
@@ -0,0 +1,2 @@
-- Add short_code column to user_device table
ALTER TABLE `user_device` ADD COLUMN `short_code` VARCHAR(255) DEFAULT '' COMMENT 'Short Code' AFTER `identifier`;