data

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 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, logger log.Logger) *cos.Client

func NewCreationRepo

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

func NewDB

func NewDB(conf *conf.Data, logger log.Logger) *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, logger log.Logger) redis.Cmdable

func NewTalkRepo

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

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

Types

type AchievementMqPro

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

func NewRocketmqAchievementProducer

func NewRocketmqAchievementProducer(conf *conf.Data, logger log.Logger) *AchievementMqPro

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:36"`
	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;size:36"`
	Status    int32  `gorm:"default:1"`
}

type ArticleCollect

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

type ArticleContentReview

type ArticleContentReview struct {
	gorm.Model
	ArticleId int32
	Kind      string
	Title     string
	Uuid      string `gorm:"index;size:36"`
	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:36"`
	Status int32  `gorm:"default:1"`
}

type ArticleMqPro

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

func NewRocketmqArticleProducer

func NewRocketmqArticleProducer(conf *conf.Data, logger log.Logger) *ArticleMqPro

type ArticleReview

type ArticleReview struct {
	gorm.Model
	ArticleId int32
	Kind      string
	Uid       string
	Uuid      string `gorm:"index;size:36"`
	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 ArticleReviewMqPro

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

func NewRocketmqArticleReviewProducer

func NewRocketmqArticleReviewProducer(conf *conf.Data, logger log.Logger) *ArticleReviewMqPro

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:36"`
	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"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
	Uuid          string         `gorm:"size:36"`
	CreationsId   int32          `gorm:"primarykey"`
	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:36"`
	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:36"`
	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:36"`
	Status int32  `gorm:"default:1"`
}

type CollectionsMqPro

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

func NewRocketmqCollectionsProducer

func NewRocketmqCollectionsProducer(conf *conf.Data, logger log.Logger) *CollectionsMqPro

type CollectionsReviewMqPro

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

func NewRocketmqCollectionsReviewProducer

func NewRocketmqCollectionsReviewProducer(conf *conf.Data, logger log.Logger) *CollectionsReviewMqPro

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:36"`
	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;size:36"`
	Status   int32  `gorm:"default:1"`
}

type ColumnCollect

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

type ColumnContentReview

type ColumnContentReview struct {
	gorm.Model
	ColumnId int32
	Title    string
	Kind     string
	Uuid     string `gorm:"index;size:36"`
	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:36"`
	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:36"`
	Status    int32  `gorm:"default:1"`
}

type ColumnMqPro

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

func NewRocketmqColumnProducer

func NewRocketmqColumnProducer(conf *conf.Data, logger log.Logger) *ColumnMqPro

type ColumnReview

type ColumnReview struct {
	gorm.Model
	ColumnId int32
	Kind     string
	Uid      string
	Uuid     string `gorm:"index;size:36"`
	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 ColumnReviewMqPro

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

func NewRocketmqColumnReviewProducer

func NewRocketmqColumnReviewProducer(conf *conf.Data, logger log.Logger) *ColumnReviewMqPro

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:36"`
	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:36"`
	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:36"`
	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, amp *ArticleMqPro, arp *ArticleReviewMqPro, tmp *TalkMqPro, trp *TalkReviewMqPro, cmp *ColumnMqPro, crq *ColumnReviewMqPro, cormq *CollectionsReviewMqPro, cmq *CollectionsMqPro, ap *AchievementMqPro, news *News, 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, logger log.Logger) *ElasticSearch

type News

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

func NewNewsClient

func NewNewsClient(conf *conf.Data) *News

type Record

type Record struct {
	gorm.Model
	Uuid       string `gorm:"size:36"`
	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:36"`
	AuthorId  string `gorm:"size:36"`
	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:36"`
	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;size:36"`
	Status int32  `gorm:"default:1"`
}

type TalkCollect

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

type TalkContentReview

type TalkContentReview struct {
	gorm.Model
	TalkId  int32
	Title   string
	Kind    string
	Uuid    string `gorm:"index;size:36"`
	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:36"`
	Status int32  `gorm:"default:1"`
}

type TalkMqPro

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

func NewRocketmqTalkProducer

func NewRocketmqTalkProducer(conf *conf.Data, logger log.Logger) *TalkMqPro

type TalkReview

type TalkReview struct {
	gorm.Model
	TalkId   int32
	Kind     string
	Uid      string
	Uuid     string `gorm:"index;size:36"`
	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 TalkReviewMqPro

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

func NewRocketmqTalkReviewProducer

func NewRocketmqTalkReviewProducer(conf *conf.Data, logger log.Logger) *TalkReviewMqPro

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:36"`
	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:36"`
	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