This commit is contained in:
2024-12-10 17:36:50 +08:00
parent 983cde2c7d
commit c63a553d6c
19 changed files with 352 additions and 29 deletions

View File

@@ -2,6 +2,7 @@ package config
import (
"fmt"
"github.com/golang-module/carbon/v2"
"github.com/spf13/viper"
"os"
)
@@ -22,6 +23,13 @@ func Load() {
handleArguments()
}
carbon.SetDefault(carbon.Default{
Layout: carbon.DateTimeLayout,
Timezone: carbon.PRC,
WeekStartsAt: carbon.Sunday,
Locale: "zh-CN", // 取值范围lang 目录下翻译文件名,不包含文件后缀
})
}
func check() {

View File

@@ -1,12 +1,13 @@
package config
import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
func Middleware(app *echo.Echo) {
//here are middlewares we use
app.Use(middleware.Logger())
app.Use(middleware.Recover())
}
//
// import (
// "github.com/labstack/echo/v4"
// "github.com/labstack/echo/v4/middleware"
// )
//
// func Middleware(app *echo.Echo) {
// //here are middlewares we use
// app.Use(middleware.Logger())
// app.Use(middleware.Recover())
// }

View File

@@ -1,12 +1,17 @@
package config
import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
func Route(app *echo.Echo) {
// here is the route for our site
staticFiles := app.Group("/")
staticFiles.Use(middleware.Static("./FrontEnd"))
}
//
// import (
// "github.com/labstack/echo/v4"
// "github.com/labstack/echo/v4/middleware"
// "zsxyww.com/scheduler/handler"
// )
//
// func Route(app *echo.Echo) {
// // here is the route for our site
// staticFiles := app.Group("/")
// staticFiles.Use(middleware.Static("./FrontEnd"))
//
// api := app.Group("/api/")
// api.GET("/getAssignment", handler.GetAssignment)
// }