🎨 Optimize code structure

This commit is contained in:
微凉 2021-12-18 15:22:56 +08:00
parent 3ce94de823
commit c2142cc03a
3 changed files with 9 additions and 8 deletions

View File

@ -19,12 +19,16 @@ import (
var pan123Client = resty.New() var pan123Client = resty.New()
type BaseResp struct {
Code int `json:"code"`
Message string `json:"message"`
}
type Pan123TokenResp struct { type Pan123TokenResp struct {
Code int `json:"code"` BaseResp
Data struct { Data struct {
Token string `json:"token"` Token string `json:"token"`
} `json:"data"` } `json:"data"`
Message string `json:"message"`
} }
type Pan123File struct { type Pan123File struct {
@ -38,8 +42,7 @@ type Pan123File struct {
} }
type Pan123Files struct { type Pan123Files struct {
Code int `json:"code"` BaseResp
Message string `json:"message"`
Data struct { Data struct {
InfoList []Pan123File `json:"InfoList"` InfoList []Pan123File `json:"InfoList"`
Next string `json:"Next"` Next string `json:"Next"`
@ -47,8 +50,7 @@ type Pan123Files struct {
} }
type Pan123DownResp struct { type Pan123DownResp struct {
Code int `json:"code"` BaseResp
Message string `json:"message"`
Data struct { Data struct {
DownloadUrl string `json:"DownloadUrl"` DownloadUrl string `json:"DownloadUrl"`
} `json:"data"` } `json:"data"`

View File

@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
url "net/url" "net/url"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"

View File

@ -101,7 +101,6 @@ func Link(c *gin.Context) {
} }
common.SuccessResp(c, link) common.SuccessResp(c, link)
return return
} }
func Preview(c *gin.Context) { func Preview(c *gin.Context) {