From f1351497d983a25fd10238c1ffe9c7d1bf93bd0e Mon Sep 17 00:00:00 2001 From: areeqakbr Date: Thu, 12 Jun 2025 22:47:18 +0700 Subject: [PATCH] delete fishbone count on fishbone --- model/dto/res/fishbone_res.go | 1 - utils/helper/fishboneHelperRes.go | 7 ------- 2 files changed, 8 deletions(-) diff --git a/model/dto/res/fishbone_res.go b/model/dto/res/fishbone_res.go index d6105dd..fa96a6f 100644 --- a/model/dto/res/fishbone_res.go +++ b/model/dto/res/fishbone_res.go @@ -13,7 +13,6 @@ type FishboneResponse struct { DeviceStart string `json:"device_start"` DeviceEnd string `json:"device_end"` CoreAmount int `json:"core_amount"` - TotalFishbone int `json:"total_fishbone"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } diff --git a/utils/helper/fishboneHelperRes.go b/utils/helper/fishboneHelperRes.go index 721850d..1fb4258 100644 --- a/utils/helper/fishboneHelperRes.go +++ b/utils/helper/fishboneHelperRes.go @@ -12,11 +12,6 @@ func ConvertToFishboneResponses(fishbones []entity.Fishbone, totalFishbone map[u var responses []res.FishboneResponse for _, fishbone := range fishbones { - count := 0 - if fishboneCount, exist := totalFishbone[fishbone.ID]; exist { - count = fishboneCount - } - fishboneResp := res.FishboneResponse{ ID: fishbone.ID, FishboneCode: fishbone.FishboneCode, @@ -24,7 +19,6 @@ func ConvertToFishboneResponses(fishbones []entity.Fishbone, totalFishbone map[u DeviceStart: fishbone.DeviceStart.DeviceCode, DeviceEnd: fishbone.DeviceEnd.DeviceCode, CoreAmount: fishbone.CoreAmount, - TotalFishbone: count, CreatedAt: fishbone.CreatedAt, UpdatedAt: fishbone.UpdatedAt, } @@ -81,7 +75,6 @@ func GetFishboneStats(fishbones []entity.Fishbone) map[string]interface{} { } return map[string]interface{}{ - "total_fishbones": totalFishbones, "total_cores": totalCores, "average_cores": float64(totalCores) / float64(totalFishbones), "unique_backbones": len(backboneCount),