mirror of https://github.com/rocboss/paopao-ce
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.
31 lines
814 B
31 lines
814 B
// 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"
|
|
api "github.com/rocboss/paopao-ce/auto/api/s/v1"
|
|
"github.com/rocboss/paopao-ce/internal/conf"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// 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)
|
|
}
|
|
|
|
// RouteLocaloss register LocalOSS route if needed
|
|
func RouteLocaloss(e *gin.Engine) {
|
|
api.RegisterUserServant(e, newUserSrv())
|
|
}
|