data

package
v1.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewArticleRepo

func NewArticleRepo(data *Data, logger log.Logger) biz.ArticleRepo

func NewColumnRepo

func NewColumnRepo(data *Data, logger log.Logger) biz.ColumnRepo

func NewCosServiceClient

func NewCosServiceClient(conf *conf.Data) *cos.Client

func NewCreationRepo

func NewCreationRepo(data *Data, logger log.Logger) biz.CreationRepo

func NewDB

func NewDB(conf *conf.Data) *gorm.DB

func NewNewsRepo

func NewNewsRepo(data *Data, logger log.Logger) biz.NewsRepo

func NewRecovery

func NewRecovery(d *Data) biz.Recovery

func NewRedis

func NewRedis(conf *conf.Data) redis.Cmdable

func NewTalkRepo

func NewTalkRepo(data *Data, logger log.Logger) biz.TalkRepo

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

Types

type Article

type Article struct {
	ArticleId int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Status    int32          `gorm:"default:1"`
	Auth      int32          `gorm:"default:1"`
}

type ArticleAgree

type ArticleAgree struct {
	gorm.Model
	ArticleId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid      string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status    int32  `gorm:"default:1"`
}

type ArticleCollect

type ArticleCollect struct {
	gorm.Model
	ArticleId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid      string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status    int32  `gorm:"default:1"`
}

type ArticleContentReview

type ArticleContentReview struct {
	gorm.Model
	ArticleId int32
	Kind      string
	Title     string
	Uuid      string `gorm:"index;size:20"`
	JobId     string `gorm:"size:100"`
	Label     string `gorm:"size:100"`
	Result    int32
	Section   string
}

type ArticleDraft

type ArticleDraft struct {
	gorm.Model
	Uuid   string `gorm:"index;size:20"`
	Status int32  `gorm:"default:1"`
}

type ArticleReview

type ArticleReview struct {
	gorm.Model
	ArticleId int32
	Kind      string
	Uid       string
	Uuid      string `gorm:"index;size:20"`
	JobId     string `gorm:"size:100"`
	Url       string `gorm:"size:1000"`
	Label     string `gorm:"size:100"`
	Result    int32
	Category  string `gorm:"size:100"`
	SubLabel  string `gorm:"size:100"`
	Score     int32
}

type ArticleStatistic

type ArticleStatistic struct {
	ArticleId int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Agree     int32          `gorm:"index;type:int unsigned;default:0"`
	View      int32          `gorm:"type:int unsigned;default:0"`
	Collect   int32          `gorm:"type:int unsigned;default:0"`
	Comment   int32          `gorm:"type:int unsigned;default:0"`
	Auth      int32          `gorm:"default:1"`
}

type Collect

type Collect struct {
	CollectionsId int32 `gorm:"primarykey;index"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
	Uuid          string         `gorm:"size:20"`
	CreationsId   int32          `gorm:"primarykey;index"`
	Mode          int32          `gorm:"primarykey;default:1"`
	Status        int32          `gorm:"default:1"`
}

type Collections

type Collections struct {
	CollectionsId int32 `gorm:"primarykey"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
	Uuid          string         `gorm:"index;size:20"`
	Auth          int32          `gorm:"default:1"`
	Article       int32          `gorm:"type:int unsigned;default:0"`
	Column        int32          `gorm:"type:int unsigned;default:0"`
	Talk          int32          `gorm:"type:int unsigned;default:0"`
}

type CollectionsContentReview

type CollectionsContentReview struct {
	gorm.Model
	CollectionsId int32
	Title         string
	Kind          string
	Uuid          string `gorm:"index;size:20"`
	JobId         string `gorm:"size:100"`
	Label         string `gorm:"size:100"`
	Result        int32
	Section       string
}

type CollectionsDraft

type CollectionsDraft struct {
	gorm.Model
	Uuid   string `gorm:"index;size:20"`
	Status int32  `gorm:"default:1"`
}

type Column

type Column struct {
	ColumnId  int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Status    int32          `gorm:"default:1"`
	Auth      int32          `gorm:"default:1"`
}

type ColumnAgree

type ColumnAgree struct {
	gorm.Model
	ColumnId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid     string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status   int32  `gorm:"default:1"`
}

type ColumnCollect

type ColumnCollect struct {
	gorm.Model
	ColumnId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid     string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status   int32  `gorm:"default:1"`
}

type ColumnContentReview

type ColumnContentReview struct {
	gorm.Model
	ColumnId int32
	Title    string
	Kind     string
	Uuid     string `gorm:"index;size:20"`
	JobId    string `gorm:"size:100"`
	Label    string `gorm:"size:100"`
	Result   int32
	Section  string
}

type ColumnDraft

type ColumnDraft struct {
	gorm.Model
	Uuid   string `gorm:"index;size:20"`
	Status int32  `gorm:"default:1"`
}

type ColumnInclusion

type ColumnInclusion struct {
	ColumnId  int32 `gorm:"primarykey"`
	ArticleId int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Uuid      string `gorm:"size:20"`
	Status    int32  `gorm:"default:1"`
}

type ColumnReview

type ColumnReview struct {
	gorm.Model
	ColumnId int32
	Kind     string
	Uid      string
	Uuid     string `gorm:"index;size:20"`
	JobId    string `gorm:"size:100"`
	Url      string `gorm:"size:1000"`
	Label    string `gorm:"size:100"`
	Result   int32
	Category string `gorm:"size:100"`
	SubLabel string `gorm:"size:100"`
	Score    int32
}

type ColumnStatistic

type ColumnStatistic struct {
	ColumnId  int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Agree     int32          `gorm:"type:int unsigned;index;default:0"`
	View      int32          `gorm:"type:int unsigned;default:0"`
	Collect   int32          `gorm:"type:int unsigned;default:0"`
	Auth      int32          `gorm:"default:1"`
}

type CreationUser

type CreationUser struct {
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Uuid        string `gorm:"primarykey;size:20"`
	Article     int32  `gorm:"type:int unsigned;default:0"`
	Column      int32  `gorm:"type:int unsigned;default:0"`
	Talk        int32  `gorm:"type:int unsigned;default:0"`
	Collections int32  `gorm:"type:int unsigned;default:0"`
	Collect     int32  `gorm:"type:int unsigned;default:0"`
	Subscribe   int32  `gorm:"type:int unsigned;default:0"`
}

type CreationUserVisitor

type CreationUserVisitor struct {
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Uuid        string `gorm:"primarykey;size:20"`
	Article     int32  `gorm:"type:int unsigned;default:0"`
	Column      int32  `gorm:"type:int unsigned;default:0"`
	Talk        int32  `gorm:"type:int unsigned;default:0"`
	Collections int32  `gorm:"type:int unsigned;default:0"`
}

type Data

type Data struct {
	// contains filtered or unexported fields
}

func NewData

func NewData(db *gorm.DB, redisCmd redis.Cmdable, cos *cos.Client, es *ElasticSearch, mq *MqPro, news *NewsClient, logger log.Logger) (*Data, func(), error)

func (*Data) DB

func (d *Data) DB(ctx context.Context) *gorm.DB

func (*Data) ExecTx

func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error

func (*Data) GroupRecover

func (d *Data) GroupRecover(ctx context.Context, fn func(ctx context.Context) error) func() error

func (*Data) Recover

func (d *Data) Recover(ctx context.Context, fn func(ctx context.Context)) func()

type ElasticSearch

type ElasticSearch struct {
	// contains filtered or unexported fields
}

func NewElasticsearch

func NewElasticsearch(conf *conf.Data) *ElasticSearch

type MqPro added in v1.3.0

type MqPro struct {
	// contains filtered or unexported fields
}

func NewRocketmqProducer added in v1.3.0

func NewRocketmqProducer(conf *conf.Data) *MqPro

type News

type News struct {
	Id string `gorm:"primarykey"`
}

type NewsClient added in v1.4.0

type NewsClient struct {
	// contains filtered or unexported fields
}

func NewNewsClient

func NewNewsClient(conf *conf.Data) *NewsClient

type Record

type Record struct {
	gorm.Model
	Uuid       string `gorm:"size:20"`
	CreationId int32
	Mode       int32 `gorm:"default:1"`
	Operation  string
	Ip         string
}

type Subscribe

type Subscribe struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	ColumnId  int32  `gorm:"primarykey"`
	Uuid      string `gorm:"primarykey;size:20"`
	AuthorId  string `gorm:"size:20"`
	Status    int32  `gorm:"default:1"`
}

type Talk

type Talk struct {
	TalkId    int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Status    int32          `gorm:"default:1"`
	Auth      int32          `gorm:"default:1"`
}

type TalkAgree

type TalkAgree struct {
	gorm.Model
	TalkId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid   string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status int32  `gorm:"default:1"`
}

type TalkCollect

type TalkCollect struct {
	gorm.Model
	TalkId int32  `gorm:"uniqueIndex:idx_unique"`
	Uuid   string `gorm:"uniqueIndex:idx_unique;index;size:20"`
	Status int32  `gorm:"default:1"`
}

type TalkContentReview

type TalkContentReview struct {
	gorm.Model
	TalkId  int32
	Title   string
	Kind    string
	Uuid    string `gorm:"index;size:20"`
	JobId   string `gorm:"size:100"`
	Label   string `gorm:"size:100"`
	Result  int32
	Section string
}

type TalkDraft

type TalkDraft struct {
	gorm.Model
	Uuid   string `gorm:"index;size:20"`
	Status int32  `gorm:"default:1"`
}

type TalkReview

type TalkReview struct {
	gorm.Model
	TalkId   int32
	Kind     string
	Uid      string
	Uuid     string `gorm:"index;size:20"`
	JobId    string `gorm:"size:100"`
	Url      string `gorm:"size:1000"`
	Label    string `gorm:"size:100"`
	Result   int32
	Category string `gorm:"size:100"`
	SubLabel string `gorm:"size:100"`
	Score    int32
}

type TalkStatistic

type TalkStatistic struct {
	TalkId    int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Uuid      string         `gorm:"index;size:20"`
	Agree     int32          `gorm:"index;type:int unsigned;default:0"`
	View      int32          `gorm:"type:int unsigned;default:0"`
	Collect   int32          `gorm:"type:int unsigned;default:0"`
	Comment   int32          `gorm:"type:int unsigned;default:0"`
	Auth      int32          `gorm:"default:1"`
}

type TimeLine

type TimeLine struct {
	gorm.Model
	Uuid        string `gorm:"index;size:20"`
	CreationsId int32  `gorm:"uniqueIndex:idx_unique"`
	Mode        int32  `gorm:"uniqueIndex:idx_unique;default:1"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL