data

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewCommentRepo

func NewCommentRepo(data *Data, logger log.Logger) biz.CommentRepo

func NewCosServiceClient

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

func NewCreationServiceClient

func NewCreationServiceClient(r *nacos.Registry) creationv1.CreationClient

func NewDB

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

func NewRecovery

func NewRecovery(d *Data) biz.Recovery

func NewRedis

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

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

Types

type Comment

type Comment struct {
	CommentId      int32 `gorm:"primarykey"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      gorm.DeletedAt `gorm:"index"`
	CreationId     int32          `gorm:"index:creation"`
	CreationType   int32          `gorm:"index:creation"`
	CreationAuthor string         `gorm:"index;size:20"`
	Uuid           string         `gorm:"index;size:20"`
	Agree          int32          `gorm:"index;type:int unsigned;default:0"`
	Comment        int32          `gorm:"type:int unsigned;default:0"`
}

type CommentAgree

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

type CommentContentReview

type CommentContentReview struct {
	gorm.Model
	CommentId int32
	Comment   string
	Kind      string
	Uuid      string `gorm:"index;size:20"`
	JobId     string `gorm:"size:100"`
	Label     string `gorm:"size:100"`
	Result    int32
	Section   string
}

type CommentDraft

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

type CommentUser

type CommentUser struct {
	CreatedAt         time.Time
	UpdatedAt         time.Time
	Uuid              string `gorm:"primarykey;size:20"`
	Comment           int32  `gorm:"type:int unsigned;default:0"`
	ArticleReply      int32  `gorm:"type:int unsigned;default:0"`
	ArticleReplySub   int32  `gorm:"type:int unsigned;default:0"`
	TalkReply         int32  `gorm:"type:int unsigned;default:0"`
	TalkReplySub      int32  `gorm:"type:int unsigned;default:0"`
	ArticleReplied    int32  `gorm:"type:int unsigned;default:0"`
	ArticleRepliedSub int32  `gorm:"type:int unsigned;default:0"`
	TalkReplied       int32  `gorm:"type:int unsigned;default:0"`
	TalkRepliedSub    int32  `gorm:"type:int unsigned;default:0"`
}

type Data

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

func NewData

func NewData(db *gorm.DB, cos *cos.Client, redisCmd redis.Cmdable, mq *MqPro, cc creationv1.CreationClient, 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 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 Record

type Record struct {
	gorm.Model
	Uuid     string `gorm:"size:20"`
	CommonId int32
	Ip       string
}

type SubComment

type SubComment struct {
	CommentId      int32 `gorm:"primarykey"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      gorm.DeletedAt `gorm:"index"`
	CreationId     int32          `gorm:"index:creation"`
	CreationType   int32          `gorm:"index:creation"`
	CreationAuthor string         `gorm:"size:20"`
	RootId         int32          `gorm:"index"`
	RootUser       string         `gorm:"index;size:20"`
	ParentId       int32          `gorm:"index"`
	Uuid           string         `gorm:"index;size:20"`
	Reply          string         `gorm:"index;size:20"`
	Agree          int32          `gorm:"type:int unsigned;default:0"`
}

Jump to

Keyboard shortcuts

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