♻️ Refactor keybinding service
This commit is contained in:
@@ -17,7 +17,7 @@ type Document 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
|
||||
@@ -69,8 +69,7 @@ func (_m *Document) 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 = new(string)
|
||||
*_m.UUID = value.String
|
||||
_m.UUID = value.String
|
||||
}
|
||||
case document.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
@@ -145,10 +144,8 @@ func (_m *Document) String() string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("Document(")
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
|
||||
if v := _m.UUID; v != nil {
|
||||
builder.WriteString("uuid=")
|
||||
builder.WriteString(*v)
|
||||
}
|
||||
builder.WriteString("uuid=")
|
||||
builder.WriteString(_m.UUID)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("created_at=")
|
||||
builder.WriteString(_m.CreatedAt)
|
||||
|
||||
Reference in New Issue
Block a user