From 4bbb6bc119f387d443102357bbf3e79da27c198f Mon Sep 17 00:00:00 2001 From: zyj <18107291228@163.com> Date: Fri, 12 Sep 2025 18:40:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/profile_service.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/profile_service.go b/services/profile_service.go index c52ac3c..08940dc 100644 --- a/services/profile_service.go +++ b/services/profile_service.go @@ -3,6 +3,7 @@ package services import ( "go-desk-service/libs" "go-desk-service/models" + "time" "gorm.io/gorm" ) @@ -26,7 +27,15 @@ func (p *ProfileService) GetInfo(params *models.Profile) models.Profile { } // 更新账号信息 -func (p *ProfileService) UpdateAccount(userId int8, params *models.Profile) bool { +func (p *ProfileService) UpdateAccount(userId int64, params *models.Profile) bool { + params.UpdatedAt = time.Now() p.db.Model(&models.Profile{}).Where("user_id = ?", userId).Updates(params) return true } + +func (p *ProfileService) Create(params *models.Profile) bool { + params.CreatedAt = time.Now() + params.UpdatedAt = time.Now() + p.db.Create(params) + return true +}