upload.go
836 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package v1
import (
"gitlab.fjmaimaimai.com/mmm-go/ability/controllers"
"gitlab.fjmaimaimai.com/mmm-go/ability/protocol"
"gitlab.fjmaimaimai.com/mmm-go/ability/services/upload"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/mybeego"
)
type UploadController struct {
controllers.BaseController
}
//Image
func(this *UploadController)Image(){
var(
msg *mybeego.Message
err error
)
defer func(){
this.Resp(msg)
}()
var request = &protocol.ImageRequest{}
//if err:=json.Unmarshal(this.ByteBody,&request);err!=nil{
// log.Error(err)
// msg = mybeego.NewMessage(1)
// return
//}
//if b,m :=this.Valid(request);!b{
// msg = m
// return
//}
if request.Files,err =this.GetFiles("file");err!=nil{
log.Error(err)
return
}
msg = this.GenMessage(upload.Image(request))
}