u
This commit is contained in:
1 parent
d9c49b34db
commit
d33cef825a
36 files changed
+753
-1077
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"allapp/db"
|
||||
"allapp/logx"
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
@@ -18,10 +19,12 @@ func RefreshActive() app.HandlerFunc {
|
||||
}
|
||||
|
||||
// 异步刷新活跃时间
|
||||
go func() {
|
||||
if err := db.Queries.UpdateUserActiveTime(c, userID); err != nil {
|
||||
logx.CtxError(c, "刷新用户活跃时间失败, userID=%d, err=%v", userID, err)
|
||||
go func(userID int64) {
|
||||
ctx := context.Background()
|
||||
|
||||
if err := db.Queries.UpdateUserLastLoginTime(ctx, userID); err != nil {
|
||||
logx.CtxError(ctx, "刷新用户活跃时间失败, userID=%d, err=%v", userID, err)
|
||||
}
|
||||
}()
|
||||
}(userID)
|
||||
}
|
||||
}
|
||||
@@ -75,3 +75,8 @@ func _updatemoneycategoryMw() []app.HandlerFunc {
|
||||
// your code...
|
||||
return nil
|
||||
}
|
||||
|
||||
func _listmoneyrecordsMw() []app.HandlerFunc {
|
||||
// your code...
|
||||
return nil
|
||||
}
|
||||
@@ -25,11 +25,11 @@ func Register(r *server.Hertz) {
|
||||
_category.POST("/delete", append(_deleteusermoneycategoryMw(), money.DeleteUserMoneyCategory)...)
|
||||
_category.POST("/update", append(_updatemoneycategoryMw(), money.UpdateMoneyCategory)...)
|
||||
_category.POST("/updateSort", append(_updatemoneycategorysortMw(), money.UpdateMoneyCategorySort)...)
|
||||
_money.POST("/records", append(_listmoneyrecordsMw(), money.ListMoneyRecords)...)
|
||||
{
|
||||
_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)...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user