export

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusProcess = "process"
	StatusFinish  = "finish"
	StatusFail    = "fail"
	StatusExpire  = "expire"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddExportExcelRequest

type AddExportExcelRequest struct {
	Name string           `json:"name"`
	Rows [][]*ExportExcel `json:"rows"`
}

type AddExportRequest

type AddExportRequest struct {
	Name  string        `json:"name"`
	Files []*ExportFile `json:"files"`
	Ids   []uint32      `json:"ids"`
}

type Export

type Export struct {
	types.BaseModel
	UserId  uint32 `json:"user_id"`
	Name    string `json:"name"`
	Size    uint32 `json:"size"`
	Src     string `json:"src"`
	Version string `json:"version"`
	Reason  string `json:"reason"`
	Status  string `json:"status"`
}

type ExportExcel

type ExportExcel struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type ExportFile

type ExportFile struct {
	Sha    string `json:"sha"`
	Rename string `json:"rename"`
}

type Factory

type Factory interface {
	ExportFileSrc(src string) string
	ExportFile(ctx kratosx.Context, in *AddExportRequest) (int64, error)
	ExportExcel(ctx kratosx.Context, in *AddExportExcelRequest) (int64, error)
}

type PageExportRequest

type PageExportRequest struct {
	Page     uint32 `json:"page"`
	PageSize uint32 `json:"page_size"`
	UserId   uint32 `json:"user_id"`
}

type Repo

type Repo interface {
	PageExport(ctx kratosx.Context, req *PageExportRequest) ([]*Export, uint32, error)
	AddExport(ctx kratosx.Context, c *Export) (uint32, error)
	GetExportByVersion(ctx kratosx.Context, uid uint32, version string) (*Export, error)
	GetExport(ctx kratosx.Context, id uint32) (*Export, error)
	UpdateExport(ctx kratosx.Context, c *Export) error
	DeleteExport(ctx kratosx.Context, uid, id uint32) error
	UpdateExportExpire(ctx kratosx.Context, t int64) error
}

type UseCase

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

func NewUseCase

func NewUseCase(config *config.Config, repo Repo, factory Factory) *UseCase

func (*UseCase) AddExport

func (u *UseCase) AddExport(ctx kratosx.Context, in *AddExportRequest) (uint32, error)

func (*UseCase) AddExportExcel

func (u *UseCase) AddExportExcel(ctx kratosx.Context, in *AddExportExcelRequest) (uint32, error)

func (*UseCase) DeleteExport

func (u *UseCase) DeleteExport(ctx kratosx.Context, id uint32) error

func (*UseCase) PageExport

func (u *UseCase) PageExport(ctx kratosx.Context, in *PageExportRequest) ([]*Export, uint32, error)

Jump to

Keyboard shortcuts

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