This commit is contained in:
oneao committed 2025-12-01 17:28:59 +08:00
1 parent d51eacb8ad
commit 44b3ef27d2
50 files changed
+3141 -9734

No files matched your search

@@ -19,11 +19,14 @@ func Register(r *server.Hertz) {
root := r.Group("/", rootMw()...)
{
_auth := root.Group("/auth", _authMw()...)
_auth.POST("/refreshToken", append(_refreshaccesstokenMw(), auth.RefreshAccessToken)...)
{
_login := _auth.Group("/login", _loginMw()...)
_login.POST("/default", append(_logindefaultMw(), auth.LoginDefault)...)
}
{
_refresh := _auth.Group("/refresh", _refreshMw()...)
_refresh.GET("/token", append(_refreshaccesstokenMw(), auth.RefreshAccessToken)...)
}
{
_register := _auth.Group("/register", _registerMw()...)
_register.POST("/default", append(_registerdefaultMw(), auth.RegisterDefault)...)
@@ -40,3 +40,8 @@ func _refreshaccesstokenMw() []app.HandlerFunc {
// your code...
return nil
}
func _refreshMw() []app.HandlerFunc {
// your code...
return nil
}
@@ -5,7 +5,6 @@ import (
"cn/oneao/base-go/utils/pathx"
"cn/oneao/base-go/utils/response"
"context"
"github.com/cloudwego/hertz/pkg/app"
)
@@ -18,7 +17,7 @@ func Auth() app.HandlerFunc {
whitelistPaths := []string{
"/auth/login",
"/auth/register",
"/auth/refreshToken",
"/auth/refresh/token",
}
return func(ctx context.Context, c *app.RequestContext) {
@@ -23,5 +23,12 @@ func Register(r *server.Hertz) {
_category := _money.Group("/category", _categoryMw()...)
_category.POST("/delete", append(_deleteusermoneycategoryMw(), money.DeleteUserMoneyCategory)...)
_category.POST("/updateSort", append(_updatemoneycategorysortMw(), money.UpdateMoneyCategorySort)...)
{
_record := _money.Group("/record", _recordMw()...)
_record.POST("/delete", append(_deletemoneyrecordMw(), money.DeleteMoneyRecord)...)
_record.POST("/insert", append(_insertmoneyrecordMw(), money.InsertMoneyRecord)...)
_record.POST("/query", append(_querymoneyrecordMw(), money.QueryMoneyRecord)...)
_record.POST("/update", append(_updatemoneyrecordMw(), money.UpdateMoneyRecord)...)
}
}
}
@@ -40,3 +40,23 @@ func _querymoneyrecordMw() []app.HandlerFunc {
// your code...
return nil
}
func _recordMw() []app.HandlerFunc {
// your code...
return nil
}
func _insertmoneyrecordMw() []app.HandlerFunc {
// your code...
return nil
}
func _updatemoneyrecordMw() []app.HandlerFunc {
// your code...
return nil
}
func _deletemoneyrecordMw() []app.HandlerFunc {
// your code...
return nil
}
@@ -1,24 +0,0 @@
// Code generated by hertz generator. DO NOT EDIT.
package money
import (
money "cn/oneao/base-go/biz/handler/money"
"github.com/cloudwego/hertz/pkg/app/server"
)
/*
This file will register all the routes of the services in the master idl.
And it will update automatically when you use the "update" command for the idl.
So don't modify the contents of the file, or your code will be deleted when it is updated.
*/
// Register register routes based on the IDL 'api.${HTTP Method}' annotation.
func Register(r *server.Hertz) {
root := r.Group("/", rootMw()...)
{
_money := root.Group("/money", _moneyMw()...)
_money.POST("/record", append(_querymoneyrecordMw(), money.QueryMoneyRecord)...)
}
}
@@ -5,16 +5,12 @@ package router
import (
auth "cn/oneao/base-go/biz/router/auth"
money "cn/oneao/base-go/biz/router/money"
record "cn/oneao/base-go/biz/router/record"
"github.com/cloudwego/hertz/pkg/app/server"
)
// GeneratedRegister registers routers generated by IDL.
func GeneratedRegister(r *server.Hertz) {
//INSERT_POINT: DO NOT DELETE THIS LINE!
record.Register(r)
money.Register(r)
auth.Register(r)
money.Register(r)
}