refactor: use controller base class
This commit is contained in:
parent
73e1c5a363
commit
34be432af7
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type FilesController struct {
|
type FilesController struct {
|
||||||
Ctx iris.Context
|
Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FilesController) PostUpload() {
|
func (f *FilesController) PostUpload() {
|
||||||
|
@ -95,11 +95,7 @@ func (f *FilesController) GetStatusBy(cidString string) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
err := ctx.JSON(&response.StatusResponse{Status: statusCode})
|
f.respondJSON(&response.StatusResponse{Status: statusCode})
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
logger.Get().Error("failed to create response", zap.Error(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
||||||
|
|
Loading…
Reference in New Issue