feat(admin): Add My Login log

This commit is contained in:
lejianwen
2024-12-27 19:25:59 +08:00
parent 16427164f8
commit 72e3a9a841
7 changed files with 146 additions and 20 deletions

View File

@@ -47,3 +47,12 @@ func (us *LoginLogService) Update(u *model.LoginLog) error {
func (us *LoginLogService) BatchDelete(ids []uint) error {
return global.DB.Where("id in (?)", ids).Delete(&model.LoginLog{}).Error
}
func (us *LoginLogService) SoftDelete(l *model.LoginLog) error {
l.IsDeleted = model.IsDeletedYes
return us.Update(l)
}
func (us *LoginLogService) BatchSoftDelete(uid uint, ids []uint) error {
return global.DB.Model(&model.LoginLog{}).Where("user_id = ? and id in (?)", uid, ids).Update("is_deleted", model.IsDeletedYes).Error
}