完善服务端材质渲染(未测试),删除profile表中不必要的isActive字段及相关接口
This commit is contained in:
@@ -109,20 +109,6 @@ func (r *profileRepository) CountByUserID(ctx context.Context, userID int64) (in
|
||||
return count, err
|
||||
}
|
||||
|
||||
func (r *profileRepository) SetActive(ctx context.Context, uuid string, userID int64) error {
|
||||
return r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
if err := tx.Model(&model.Profile{}).
|
||||
Where("user_id = ?", userID).
|
||||
Update("is_active", false).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return tx.Model(&model.Profile{}).
|
||||
Where("uuid = ? AND user_id = ?", uuid, userID).
|
||||
Update("is_active", true).Error
|
||||
})
|
||||
}
|
||||
|
||||
func (r *profileRepository) UpdateLastUsedAt(ctx context.Context, uuid string) error {
|
||||
return r.db.WithContext(ctx).Model(&model.Profile{}).
|
||||
Where("uuid = ?", uuid).
|
||||
|
||||
Reference in New Issue
Block a user