🎨 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()
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"`

View File

@ -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"

View File

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