You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// Copyright 2022 ROC. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package localoss
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/conf"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
type localossSrv struct {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// RouteLocalOSS register LocalOSS route if needed
|
|
|
|
func RouteLocalOSS(e *gin.Engine) {
|
|
|
|
savePath, err := filepath.Abs(conf.LocalOSSSetting.SavePath)
|
|
|
|
if err != nil {
|
|
|
|
logrus.Fatalf("get localOSS save path err: %v", err)
|
|
|
|
}
|
|
|
|
e.Static("/oss", savePath)
|
|
|
|
|
|
|
|
logrus.Infof("register LocalOSS route in /oss on save path: %s", savePath)
|
|
|
|
}
|