Skip to content

Commit

Permalink
feat: add url for the uploaded api
Browse files Browse the repository at this point in the history
  • Loading branch information
saltbo committed Feb 7, 2021
1 parent ba730d5 commit f17c150
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions internal/app/service/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ func (f *File) PreSignPutURL(matter *model.Matter) (url string, headers http.Hea
}

func (f *File) UploadDone(uid int64, alias string) (*model.Matter, error) {
m, err := f.FindUserMatter(uid, alias)
if err != nil {
return nil, err
}

if err := f.Matter.Uploaded(alias); err != nil {
return nil, err
}

m, err := f.FindUserMatter(uid, alias)
link, err := f.BuildGetURL(alias)
if err != nil {
return nil, err
}

//provider, err := f.sStorage.GetProvider(m.Sid)
//if err != nil {
// return nil, err
//}

//m.SetURL(provider.PublicURL)
m.URL = link
return m, nil
}

Expand Down
12 changes: 6 additions & 6 deletions internal/pkg/bind/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ type QueryFiles struct {
}

type BodyFile struct {
Sid int64 `json:"sid" binding:"required"`
Name string `json:"name" binding:"required"`
Size int64 `json:"size" binding:"required"`
Type string `json:"type"`
Dir string `json:"dir"`
Public bool `json:"public"`
Sid int64 `json:"sid" binding:"required"`
Name string `json:"name" binding:"required"`
Size int64 `json:"size" binding:"required"`
Type string `json:"type"`
Dir string `json:"dir"`
//Public bool `json:"public"`
}

func (p *BodyFile) ToMatter(uid int64) *model.Matter {
Expand Down

0 comments on commit f17c150

Please sign in to comment.