文件存储-增加文件上传记录接口,增加定时同步租户文件存储容量信息接口

This commit is contained in:
2025-12-26 13:59:02 +08:00
parent 5693dd4952
commit 36c9b61db0
14 changed files with 518 additions and 0 deletions

35
main.go Normal file
View File

@@ -0,0 +1,35 @@
package main
import (
"context"
"github.com/gogf/gf/v2/os/glog"
"github.com/gogf/gf/v2/os/gtimer"
"oss/controller"
"oss/service"
"time"
"gitee.com/red-future---jilin-g/common/http"
"gitee.com/red-future---jilin-g/common/jaeger"
_ "gitee.com/red-future---jilin-g/common/mongo"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
)
func main() {
ctx := context.Background()
defer jaeger.ShutDown(ctx)
// 注册路由
http.RouteRegister([]interface{}{
controller.File,
})
gtimer.AddSingleton(ctx, time.Minute*5, func(ctx context.Context) {
err := service.TenantOssTotal.UpdateUsedOssSize(ctx)
if err != nil {
glog.Error(ctx, "UpdateUsedOssSize err: %v", err)
}
})
// 保持应用运行
select {}
}