chart_setting.go 1.2 KB
package domain

import (
	"context"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/db/transaction"
)

type ChartSetting struct {
	Id       int64  // ID
	ChartId  int64  // 图表ID
	Property string // 属性
	Style    string // 样式
	Series   string // 系列值-数据绑定

	CreatedAt int64 `json:",omitempty"`
	UpdatedAt int64 `json:",omitempty"`
	DeletedAt int64 `json:",omitempty"`
	Version   int   `json:",omitempty"`
}

type ChartSettingRepository interface {
	Insert(ctx context.Context, conn transaction.Conn, dm *ChartSetting) (*ChartSetting, error)
	Update(ctx context.Context, conn transaction.Conn, dm *ChartSetting) (*ChartSetting, error)
	UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ChartSetting) (*ChartSetting, error)
	Delete(ctx context.Context, conn transaction.Conn, dm *ChartSetting) (*ChartSetting, error)
	FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ChartSetting, error)
	Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ChartSetting, error)
}

func (m *ChartSetting) Identify() interface{} {
	if m.Id == 0 {
		return nil
	}
	return m.Id
}