excel-export/biz/BaseExportBiz.go

33 lines
546 B
Go

package biz
import (
"fmt"
"time"
)
type baseExportBiz struct {
fileSize int
opts *ExportOpts
fileName string
}
func (e *baseExportBiz) FileSize() int {
return e.fileSize
}
func (e *baseExportBiz) FileName() string {
return e.fileName
}
func (e *baseExportBiz) FileNames() []string {
name := make([]string, e.fileSize+1)
for i := 0; i <= e.fileSize; i++ {
name[i] = fmt.Sprintf(e.fileName, i)
}
return name
}
func (e *baseExportBiz) setFileArg(begin time.Time) {
e.fileName = getFielName(e.opts.Path, e.opts.Tag, begin)
}