Pārlūkot izejas kodu

fix(flexCdn): 修复获取 cc ip list 时的排序问题

- 在查询 cloud_ip_items 表时添加了 Order("id desc") 方法
- 确保返回的 IP 列表按照 id 降序排列,以满足业务需求
fusu 2 nedēļas atpakaļ
vecāks
revīzija
eb00aa3974
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      internal/repository/api/flexCdn/cciplist.go

+ 1 - 1
internal/repository/api/flexCdn/cciplist.go

@@ -33,7 +33,7 @@ func (r *ccIpListRepository) GetCcIpList(ctx context.Context, serverId int64) ([
 	if err != nil {
 		return nil, err
 	}
-	return req, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND sourceCategory = ?", ipListId, "cc").Select("value,type, reason").Scan(&req).Error
+	return req, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND sourceCategory = ?", ipListId, "cc").Order("id desc").Select("value,type, reason").Scan(&req).Error
 }
 
 func (r *ccIpListRepository) GetHttpWebId(ctx context.Context, serverId int64) (int64, error) {