diff --git a/drivers/123/123.go b/drivers/123/123.go index f647a840..2525e1e6 100644 --- a/drivers/123/123.go +++ b/drivers/123/123.go @@ -19,12 +19,16 @@ import ( var pan123Client = resty.New() +type BaseResp struct { + Code int `json:"code"` + Message string `json:"message"` +} + type Pan123TokenResp struct { - Code int `json:"code"` + BaseResp Data struct { Token string `json:"token"` } `json:"data"` - Message string `json:"message"` } type Pan123File struct { @@ -38,8 +42,7 @@ type Pan123File struct { } type Pan123Files struct { - Code int `json:"code"` - Message string `json:"message"` + BaseResp Data struct { InfoList []Pan123File `json:"InfoList"` Next string `json:"Next"` @@ -47,8 +50,7 @@ type Pan123Files struct { } type Pan123DownResp struct { - Code int `json:"code"` - Message string `json:"message"` + BaseResp Data struct { DownloadUrl string `json:"DownloadUrl"` } `json:"data"` diff --git a/drivers/123/driver.go b/drivers/123/driver.go index a469d512..5f455bef 100644 --- a/drivers/123/driver.go +++ b/drivers/123/driver.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" jsoniter "github.com/json-iterator/go" log "github.com/sirupsen/logrus" - url "net/url" + "net/url" "path/filepath" "strconv" "strings" diff --git a/server/controllers/path.go b/server/controllers/path.go index 405be4bc..0dbfec49 100644 --- a/server/controllers/path.go +++ b/server/controllers/path.go @@ -101,7 +101,6 @@ func Link(c *gin.Context) { } common.SuccessResp(c, link) return - } func Preview(c *gin.Context) {