You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/api/init.go

40 lines
981 B
Go

11 months ago
//
// Copyright (C) 2024 veypi <i@veypi.com>
// 2025-03-04 16:08:06
// Distributed under terms of the MIT license.
//
// Auto generated by OneBD. DO NOT EDIT
package api
import (
10 months ago
"github.com/veypi/OneAuth/api/app"
6 months ago
"github.com/veypi/OneAuth/api/sms"
10 months ago
"github.com/veypi/OneAuth/api/token"
"github.com/veypi/OneAuth/api/user"
"github.com/veypi/OneAuth/cfg"
"github.com/veypi/OneAuth/libs/auth"
7 months ago
"github.com/vyes-ai/vigo"
"github.com/vyes-ai/vigo/contrib/common"
11 months ago
)
var Router = vigo.NewRouter().UseBefore(auth.CheckJWT).UseAfter(common.JsonResponse, common.JsonErrorResponse)
11 months ago
var (
_ = Router.Extend("user", user.Router)
_ = Router.Extend("token", token.Router)
_ = Router.Extend("app", app.Router)
6 months ago
_ = Router.Extend("sms", sms.Router)
_ = Router.Get("cfg", vigo.SkipBefore, getCfg)
11 months ago
)
6 months ago
var _ = Router.Any("*", vigo.SkipBefore, func(x *vigo.X) error {
return vigo.ErrNotFound
10 months ago
})
func getCfg(x *vigo.X) any {
return map[string]any{
"sms": cfg.Config.SMS.Enable,
}
}