upload.go 375 B

12345678910111213141516
  1. package service
  2. import (
  3. "context"
  4. "io"
  5. "go-common/library/log"
  6. )
  7. // Upload http upload file.
  8. func (s *Service) Upload(c context.Context, fileName, fileType string, expire int64, body io.Reader) (location string, err error) {
  9. if location, err = s.d.Upload(c, fileName, fileType, expire, body); err != nil {
  10. log.Error("s.upload.Upload() error(%v)", err)
  11. }
  12. return
  13. }