This commit is contained in:
oneao committed 2025-11-30 22:40:56 +08:00
1 parent 5308dc8fda
commit d51eacb8ad
32 files changed
+1788 -513

No files matched your search

@@ -5,6 +5,7 @@ import (
"cn/oneao/base-go/utils/pathx"
"cn/oneao/base-go/utils/response"
"context"
"github.com/cloudwego/hertz/pkg/app"
)
@@ -31,6 +32,7 @@ func Auth() app.HandlerFunc {
// 获取 token
token := string(c.GetHeader("token"))
if token == "" {
response.Fail(c).Code(response.HttpCode.Unauthorized).Send()
c.Abort()
@@ -1,6 +1,6 @@
// Code generated by hertz generator.
package money_category
package money
import (
"github.com/cloudwego/hertz/pkg/app"
@@ -30,3 +30,13 @@ func _deleteusermoneycategoryMw() []app.HandlerFunc {
// your code...
return nil
}
func _updatemoneycategorysortMw() []app.HandlerFunc {
// your code...
return nil
}
func _querymoneyrecordMw() []app.HandlerFunc {
// your code...
return nil
}
@@ -1,9 +1,9 @@
// Code generated by hertz generator. DO NOT EDIT.
package money_category
package money
import (
money_category "cn/oneao/base-go/biz/handler/money_category"
money "cn/oneao/base-go/biz/handler/money"
"github.com/cloudwego/hertz/pkg/app/server"
)
@@ -19,8 +19,9 @@ func Register(r *server.Hertz) {
root := r.Group("/", rootMw()...)
{
_money := root.Group("/money", _moneyMw()...)
_money.GET("/category", append(_queryusermoneycategoryMw(), money_category.QueryUserMoneyCategory)...)
_money.GET("/category", append(_queryusermoneycategoryMw(), money.QueryUserMoneyCategory)...)
_category := _money.Group("/category", _categoryMw()...)
_category.GET("/delete", append(_deleteusermoneycategoryMw(), money_category.DeleteUserMoneyCategory)...)
_category.POST("/delete", append(_deleteusermoneycategoryMw(), money.DeleteUserMoneyCategory)...)
_category.POST("/updateSort", append(_updatemoneycategorysortMw(), money.UpdateMoneyCategorySort)...)
}
}
@@ -0,0 +1,24 @@
// 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)...)
}
}
@@ -4,14 +4,17 @@ package router
import (
auth "cn/oneao/base-go/biz/router/auth"
money_category "cn/oneao/base-go/biz/router/money_category"
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!
money_category.Register(r)
record.Register(r)
money.Register(r)
auth.Register(r)
}