refactor: upgrade to Go 1.26 and modernize code idioms
- Replace `interface{}` with `any` type alias across all packages
- Use built-in `min()`/`max()` for parameter clamping
- Use `slices.SortFunc`, `slices.Min`, `slices.Max` for cleaner code
- Use `strings.Cut()` for simpler string parsing in auth middleware
- Use `errors.Is()` for proper error comparison in handlers
- Update dependencies: golang.org/x/image 0.37.0 -> 0.38.0
- Add Wire code generation guidelines to ARCHITECTURE.md
- Disable Go cache in CI build workflow
This commit is contained in:
@@ -125,7 +125,7 @@ func (r *deviceTokenRepository) Upsert(token *model.DeviceToken) error {
|
||||
}
|
||||
|
||||
// 更新现有记录
|
||||
return r.db.Model(&existing).Updates(map[string]interface{}{
|
||||
return r.db.Model(&existing).Updates(map[string]any{
|
||||
"push_token": token.PushToken,
|
||||
"is_active": true,
|
||||
"device_name": token.DeviceName,
|
||||
@@ -151,7 +151,7 @@ func (r *deviceTokenRepository) Deactivate(deviceID string) error {
|
||||
func (r *deviceTokenRepository) Activate(deviceID string) error {
|
||||
return r.db.Model(&model.DeviceToken{}).
|
||||
Where("device_id = ?", deviceID).
|
||||
Updates(map[string]interface{}{
|
||||
Updates(map[string]any{
|
||||
"is_active": true,
|
||||
"last_used_at": time.Now(),
|
||||
}).Error
|
||||
|
||||
Reference in New Issue
Block a user