|
- package main
-
- import (
- "biukop.com/sfm/loan"
- log "github.com/sirupsen/logrus"
- "net/http"
- "strconv"
- )
-
- func apiV1StepsMetaGet(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
- id := r.URL.Path[len(apiV1Prefix+"upload-meta/"):] //remove prefix
- intId, e := strconv.Atoi(id)
- if e != nil {
- log.Println("invalid id for upload get", id, e)
- apiV1Client403Error(w, r, ss) // bad request
- return
- }
-
- ulmeta := loan.Uploads{}
- e = ulmeta.Read(int64(intId))
- if e != nil {
- log.Println("upload not found", id, e)
- apiV1Client404Error(w, r, ss) // bad request
- return
- }
- apiV1SendJson(ulmeta, w, r, ss)
- }
|