You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dictionarydetail.go
    path of file: ./repos/simple-admin-core/rpc/ent
    
    the code of the file until where you have to start completion: // Code generated by ent, DO NOT EDIT.

package ent

import (
	"fmt"
	"strings"
	"time"

	"entgo.io/ent"
	"entgo.io/ent/dialect/sql"
	"github.com/suyuan32/simple-admin-core/rpc/ent/dictionary"
	"github.com/suyuan32/simple-admin-core/rpc/ent/dictionarydetail"
)

// DictionaryDetail is the model entity for the DictionaryDetail schema.
type DictionaryDetail struct {
	config `json:"-"`
	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// The title shown in the ui | 展示名称 （建议配合i18n）
	Title string `json:"title,omitempty"`
	// key | 键
	Key string `json:"key,omitempty"`
	// value | 值
	Value string `json:"value,omitempty"`
	// Dictionary ID | 字典ID
	DictionaryID uint64 `json:"dictionary_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DictionaryDetailQuery when eager-loading is set.
	Edges        DictionaryDetailEdges `json:"edges"`
	selectValues sql.SelectValues
}

// DictionaryDetailEdges holds the relations/edges for other nodes in the graph.
type DictionaryDetailEdges struct {
	// Dictionaries holds the value of the dictionaries edge.
	Dictionaries *Dictionary `json:"dictionaries,omitempty"`
	// loadedTypes holds the information for reporting if a
	// type was loaded (or requested) in e
    
func (dd *DictionaryDetail) assignValues(columns []string, values []any) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case dictionarydetail.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			dd.ID = uint64(value.Int64)
		case dictionarydetail.FieldCreatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field created_at", values[i])
			} else if value.Valid {
				dd.CreatedAt = value.Time
			}
		case dictionarydetail.FieldUpdatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
			} else if value.Valid {
				dd.UpdatedAt = value.Time
			}
		case dictionarydetail.FieldStatus:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field status", values[i])
			} else if value.Valid {
				dd.Status = uint8(value.Int64)
			}
		case dictionarydetail.FieldSort:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field sort", values[i])
			} else if value.Valid {
				dd.Sort = uint32(value.Int64)
			}
		case dictionarydetail.FieldTitle:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field title", values[i])
			} else if value.Valid {
				dd.Title = value.String
			}
		case dictionarydetail.FieldKey:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field key", values[i])
			} else if value.Valid {
				dd.Key = value.String
			}
		case dictionarydetail.FieldValue:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field value", values[i])
			} else if value.Valid {
				dd.Value = value.String
			}
		case dictionarydetail.FieldDictionaryID:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field dictionary_id", values[i])
			} else if value.Valid {
				dd.DictionaryID = uint64(value.Int64)
			}
		default:
			dd.selectValues.Set(columns[i], values[i])
		}
	}
	return nil
}