feat(login): 重构登录逻辑并迁移每日重置功能到 Personself 方法
将原本在 Controller.Login 中处理的每日重置逻辑(如电池、任务等)迁移到 service.Info.Personself 方法中,并移除对 gtime.Now().Time 的旧引用。同时更新了 相关的时间判断函数 IsToday,使其支持 *gtime.Time 类型。 此外,清理无用导入包,优化日志打印方式,并修复部分结构体字段定义与使用问题。
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/blazing/model"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// func Exec[T cool.UserModel, F any](userid uint32, s *cool.Service, processFunc func(F) F) bool {
|
||||
@@ -53,7 +55,12 @@ func (s *TaskService) Exec(id uint32, t func(*model.TaskEX) bool) {
|
||||
}
|
||||
|
||||
// IsToday 判断给定时间是否是今天
|
||||
func IsToday(t time.Time) bool {
|
||||
func IsToday(t1 *gtime.Time) bool {
|
||||
if t1 == nil {
|
||||
return false
|
||||
}
|
||||
t := t1.Time
|
||||
|
||||
// 获取当前时间
|
||||
now := time.Now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user