优化代码
This commit is contained in:
@@ -10,11 +10,11 @@ public class NotificationController(INotificationService notificationService) :
|
||||
try
|
||||
{
|
||||
var key = await notificationService.GetVapidPublicKeyAsync();
|
||||
return BaseResponse<string>.Done(key);
|
||||
return key.Ok<string>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return BaseResponse<string>.Fail(ex.Message);
|
||||
return ex.Message.Fail<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class NotificationController(INotificationService notificationService) :
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return BaseResponse.Fail(ex.Message);
|
||||
return ex.Message.Fail();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class NotificationController(INotificationService notificationService) :
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return BaseResponse.Fail(ex.Message);
|
||||
return ex.Message.Fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user