app_page.go
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package domain
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/db/transaction"
)
type AppPage struct {
Id int64 // 唯一标识
Name string // 名称
Charts []int64 // 图表
Key string // 分享,预览时绑定映射到Id
TenantId int64 // 租户ID
Cover string // 封面
CreatedAt int64 `json:",omitempty"`
UpdatedAt int64 `json:",omitempty"`
DeletedAt int64 `json:",omitempty"`
Version int `json:",omitempty"`
}
type AppPageRepository interface {
Insert(ctx context.Context, conn transaction.Conn, dm *AppPage) (*AppPage, error)
Update(ctx context.Context, conn transaction.Conn, dm *AppPage) (*AppPage, error)
UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *AppPage) (*AppPage, error)
Delete(ctx context.Context, conn transaction.Conn, dm *AppPage) (*AppPage, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*AppPage, error)
FindOneByKey(ctx context.Context, conn transaction.Conn, key string) (*AppPage, error)
FindOneByChartId(ctx context.Context, conn transaction.Conn, tenantId, chartId int64) (*AppPage, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*AppPage, error)
FindByName(ctx context.Context, conn transaction.Conn, tenantId int64, name string) (int64, []*AppPage, error)
}
func (m *AppPage) Identify() interface{} {
if m.Id == 0 {
return nil
}
return m.Id
}