delete fishbone count on fishbone
This commit is contained in:
parent
751461bc34
commit
f1351497d9
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue