data

package
v0.0.0-...-2981145 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewData, NewFormRepo)

Functions

This section is empty.

Types

type Data

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

func NewData

func NewData(cfg configs.Interface, xlogger *xlog.Logger) *Data

type FormAnswerModel

type FormAnswerModel struct {
	Id              uint64 `gorm:"primarykey"`
	UserUUID        string
	FormUUID        string
	FormContentUUID string
	Select          string
	Other           string
	ArrValue        string `gorm:"type:json"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       gorm.DeletedAt `gorm:"index"`
}

type FormContentModel

type FormContentModel struct {
	Id           uint64 `gorm:"primarykey"`
	UUID         string `gorm:"uniqueIndex;type:varchar(40)"`
	FormUUID     string `gorm:"type:varchar(40)"`
	ContentTitle string
	ContentType  string
	Extend       string `gorm:"type:json"`
	UserAnswer   string `gorm:"type:json"`
	Options      string `gorm:"type:json"`
	Sort         uint64
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    gorm.DeletedAt `gorm:"index"`
}

type FormModel

type FormModel struct {
	Id        uint64 `gorm:"primarykey"`
	UUID      string `gorm:"uniqueIndex;type:varchar(40)"`
	FormTitle string `gorm:"type:varchar(200)"`
	SubTitle  string `gorm:"type:varchar(200)"`
	Status    string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type FormRepo

type FormRepo interface {
	GetFormByUUID(uuid string) (*FormModel, error)
	ListForm() ([]FormModel, error)
	ListContentByFormUUID(formUUID string) ([]FormContentModel, error)
	CreateForm(form *FormModel) error
	UpdateForm(form *FormModel) error
	CreateFormContent(content *FormContentModel) error
	UpdateFormContent(content *FormContentModel) error
	CreateFormAnswer(answer *FormAnswerModel) error
}

func NewFormRepo

func NewFormRepo(data *Data) FormRepo

Jump to

Keyboard shortcuts

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