export

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	STATUS_FAIL      = "FAIL"
	STATUS_PROGRESS  = "PROGRESS"
	STATUS_COMPLETED = "COMPLETED"
	STATUS_EXPIRED   = "EXPIRED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyExportRequest added in v1.0.12

type CopyExportRequest struct {
	UserId       uint32 `json:"user_id"`
	DepartmentId uint32 `json:"department_id"`
	Scene        string `json:"scene"`
	Name         string `json:"name"`
}

type Export

type Export struct {
	Id           uint32  `json:"id"`
	UserId       uint32  `json:"userId"`
	DepartmentId uint32  `json:"departmentId"`
	Scene        string  `json:"scene"`
	Name         string  `json:"name"`
	Size         uint32  `json:"size"`
	Sha          string  `json:"sha"`
	Src          string  `json:"src"`
	URL          string  `json:"url"`
	Status       string  `json:"status"`
	Reason       *string `json:"reason"`
	ExpiredAt    int64   `json:"expiredAt"`
	CreatedAt    int64   `json:"createdAt"`
	UpdatedAt    int64   `json:"updatedAt"`
}

type ExportExcelCol added in v1.0.12

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

type ExportExcelReply added in v1.0.12

type ExportExcelReply struct {
	Id  uint32 `json:"id"`
	Sha string `json:"sha"`
	Src string `json:"src"`
}

type ExportExcelRequest added in v1.0.12

type ExportExcelRequest struct {
	UserId       uint32              `json:"user_id"`
	DepartmentId uint32              `json:"department_id"`
	Scene        string              `json:"scene"`
	Name         string              `json:"name"`
	Rows         [][]*ExportExcelCol `json:"rows"`
}

type ExportFileItem added in v1.0.12

type ExportFileItem struct {
	Value  string `json:"sha"`
	Rename string `json:"rename"`
}

type ExportFileReply added in v1.0.12

type ExportFileReply struct {
	Id uint32 `json:"id"`
}

type ExportFileRequest added in v1.0.12

type ExportFileRequest struct {
	UserId       uint32            `json:"userId"`
	DepartmentId uint32            `json:"departmentId"`
	Scene        string            `json:"scene"`
	Name         string            `json:"name"`
	Files        []*ExportFileItem `json:"files"`
	Ids          []uint32          `json:"ids"`
}

type GetExportRequest added in v1.0.12

type GetExportRequest struct {
	Id  *uint32 `json:"id"`
	Sha *string `json:"sha"`
}

type ListExportRequest added in v1.0.11

type ListExportRequest struct {
	Page          uint32   `json:"page"`
	PageSize      uint32   `json:"pageSize"`
	Order         *string  `json:"order"`
	OrderBy       *string  `json:"orderBy"`
	All           bool     `json:"all"`
	UserIds       []uint32 `json:"userIds"`
	DepartmentIds []uint32 `json:"departmentIds"`
}

type Repo

type Repo interface {
	// ListExport 获取导出信息列表
	ListExport(ctx kratosx.Context, req *ListExportRequest) ([]*Export, uint32, error)

	// CreateExport 创建导出信息
	CreateExport(ctx kratosx.Context, req *Export) (uint32, error)

	// ExportExcel 导出excel信息返回文件大小
	ExportExcel(ctx kratosx.Context, src string, rows [][]*ExportExcelCol) (uint32, error)

	// ExportFile 导出文件信息,并返回文件大小
	ExportFile(ctx kratosx.Context, src string, rows []*ExportFileItem) (uint32, error)

	// DeleteExport 删除导出信息
	DeleteExport(ctx kratosx.Context, ids []uint32) (uint32, error)

	// GetExport 获取指定的导出信息
	GetExport(ctx kratosx.Context, id uint32) (*Export, error)

	// CopyExport 获取指定的导出信息
	CopyExport(ctx kratosx.Context, export *Export, req *CopyExportRequest) (uint32, error)

	// UpdateExport 更新导出信息
	UpdateExport(ctx kratosx.Context, req *Export) error

	// GetExportBySha 获取指定的导出信息
	GetExportBySha(ctx kratosx.Context, sha string) (*Export, error)

	// GetExportFileKeyById 获取导出文件的key
	GetExportFileKeyById(ctx kratosx.Context, id uint32) (string, error)

	// VerifyURL 验证url签名
	VerifyURL(key string, expire string, sign string) error
}

type UseCase

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

func NewUseCase

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

func (*UseCase) DeleteExport

func (u *UseCase) DeleteExport(ctx kratosx.Context, ids []uint32) (uint32, error)

DeleteExport 删除导出信息

func (*UseCase) ExportExcel added in v1.0.12

func (u *UseCase) ExportExcel(ctx kratosx.Context, req *ExportExcelRequest) (*ExportExcelReply, error)

ExportExcel 创建导出表格

func (*UseCase) ExportFile added in v1.0.12

func (u *UseCase) ExportFile(ctx kratosx.Context, req *ExportFileRequest) (*ExportFileReply, error)

ExportFile 创建导出表格

func (*UseCase) GetExport added in v1.0.12

func (u *UseCase) GetExport(ctx kratosx.Context, req *GetExportRequest) (*Export, error)

GetExport 获取指定的导出信息

func (*UseCase) ListExport added in v1.0.11

func (u *UseCase) ListExport(ctx kratosx.Context, req *ListExportRequest) ([]*Export, uint32, error)

ListExport 获取导出信息列表

func (*UseCase) VerifyURL added in v1.0.12

func (u *UseCase) VerifyURL(key, expire, sign string) error

VerifyURL 验证url

Jump to

Keyboard shortcuts

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