unbind device push token on logout

This commit is contained in:
richjohnrambo
2026-09-23 11:39:16 +08:00
parent c4355ac236
commit a0d0bf574e
5 changed files with 229 additions and 9 deletions
+18
View File
@@ -2618,6 +2618,24 @@ func (devicePushTokenMapper) Upsert(tenantID types.TenantID, token *types.Device
return tenantAdp.TenantDevicePushTokenUpsert(tenantID, token)
}
func (devicePushTokenMapper) Delete(tenantID types.TenantID, uid types.Uid, deviceID string) error {
deviceID = strings.TrimSpace(deviceID)
if uid.IsZero() || deviceID == "" {
return types.ErrMalformed
}
tenantAdp, err := tenantBusinessAdapter(tenantID)
if err != nil {
return err
}
deleter, ok := tenantAdp.(interface {
TenantDevicePushTokenDelete(types.TenantID, types.Uid, string) error
})
if !ok {
return nil
}
return deleter.TenantDevicePushTokenDelete(tenantID, uid, deviceID)
}
func (devicePushTokenMapper) GetAll(tenantID types.TenantID, uids ...types.Uid) (map[types.Uid][]types.DeviceDef, int, error) {
tenantAdp, err := tenantBusinessAdapter(tenantID)
if err != nil {