♻ ️ refactor(model): replace gorm.io/datatypes with JSONValue for PrefillGroup.Items; fix JSON scan across drivers - Why: - Avoid introducing `gorm.io/datatypes` for a single field. - Align with existing pattern (`ChannelInfo`, `Properties`) using `Scanner`/`Valuer`. - Fix runtime error when drivers return JSON as string. - What: - Introduced `JSONValue` (based on `json.RawMessage`) implementing `sql.Scanner` and `driver.Valuer`, with `MarshalJSON`/`UnmarshalJSON` to preserve raw JSON in API. - Updated `PrefillGroup.Items` to use `JSONValue` with `gorm:"type:json"`. - Localized comments in `model/prefill_group.go` to Chinese. - Impact: - Resolves “unsupported Scan, storing driver.Value type string into type *json.RawMessage”. - Works with MySQL/Postgres/SQLite whether JSON is returned as `[]byte` or `string`. - API and DB schema remain unchanged; no `go.mod` changes; lints pass. Files changed: - model/prefill_group.go
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| ability.go | Loading commit data... | |
| channel.go | Loading commit data... | |
| channel_cache.go | Loading commit data... | |
| log.go | Loading commit data... | |
| main.go | Loading commit data... | |
| midjourney.go | Loading commit data... | |
| missing_models.go | Loading commit data... | |
| model_extra.go | Loading commit data... | |
| model_meta.go | Loading commit data... | |
| option.go | Loading commit data... | |
| prefill_group.go | Loading commit data... | |
| pricing.go | Loading commit data... | |
| pricing_refresh.go | Loading commit data... | |
| redemption.go | Loading commit data... | |
| setup.go | Loading commit data... | |
| task.go | Loading commit data... | |
| token.go | Loading commit data... | |
| token_cache.go | Loading commit data... | |
| topup.go | Loading commit data... | |
| twofa.go | Loading commit data... | |
| usedata.go | Loading commit data... | |
| user.go | Loading commit data... | |
| user_cache.go | Loading commit data... | |
| utils.go | Loading commit data... | |
| vendor_meta.go | Loading commit data... |