Files
OpenList/server/controllers/common.go

24 lines
393 B
Go
Raw Normal View History

2020-12-29 13:37:58 +08:00
package controllers
2020-12-24 01:39:45 +08:00
import (
"github.com/Xhofe/alist/alidrive"
)
2020-12-24 01:39:45 +08:00
2021-02-04 10:02:34 +08:00
// common meta response
func MetaResponse(code int, msg string) alidrive.ReqData {
return alidrive.ReqData{
Code: code,
Data: nil,
Message: msg,
2020-12-24 01:39:45 +08:00
}
}
2021-02-04 10:02:34 +08:00
// common data response
func DataResponse(data interface{}) alidrive.ReqData {
return alidrive.ReqData{
Code: 200,
Data: data,
Message: "ok",
2020-12-24 01:39:45 +08:00
}
2020-12-29 13:37:58 +08:00
}