♻️ Refactor backup service complete.
Some checks failed
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (c-cpp) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
CodeQL Advanced / Analyze (rust) (push) Has been cancelled

This commit is contained in:
2025-12-16 23:20:40 +08:00
parent 1ab934cee9
commit 8fce8bdca4
29 changed files with 467 additions and 1171 deletions

View File

@@ -17,7 +17,7 @@ type KeyBinding struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// UUID for cross-device sync (UUIDv7)
UUID string `json:"uuid"`
UUID *string `json:"uuid"`
// creation time
CreatedAt string `json:"created_at"`
// update time
@@ -71,7 +71,8 @@ func (_m *KeyBinding) assignValues(columns []string, values []any) error {
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field uuid", values[i])
} else if value.Valid {
_m.UUID = value.String
_m.UUID = new(string)
*_m.UUID = value.String
}
case keybinding.FieldCreatedAt:
if value, ok := values[i].(*sql.NullString); !ok {
@@ -152,8 +153,10 @@ func (_m *KeyBinding) String() string {
var builder strings.Builder
builder.WriteString("KeyBinding(")
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
builder.WriteString("uuid=")
builder.WriteString(_m.UUID)
if v := _m.UUID; v != nil {
builder.WriteString("uuid=")
builder.WriteString(*v)
}
builder.WriteString(", ")
builder.WriteString("created_at=")
builder.WriteString(_m.CreatedAt)