fix service api (#556)

* fix service api

* update ServiceResponseItem

* fix: ddns lock
This commit is contained in:
UUBulb
2024-12-05 21:00:02 +08:00
committed by GitHub
parent 2234cff5eb
commit 040c8df02e
10 changed files with 124 additions and 53 deletions

View File

@@ -20,8 +20,8 @@ import (
// @Success 200 {object} model.CommonResponse[[]model.Notification]
// @Router /notification [get]
func listNotification(c *gin.Context) ([]*model.Notification, error) {
singleton.NotificationsLock.RLock()
defer singleton.NotificationsLock.RUnlock()
singleton.NotificationSortedLock.RLock()
defer singleton.NotificationSortedLock.RUnlock()
var notifications []*model.Notification
if err := copier.Copy(&notifications, &singleton.NotificationListSorted); err != nil {