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"`
|
DeviceStart string `json:"device_start"`
|
||||||
DeviceEnd string `json:"device_end"`
|
DeviceEnd string `json:"device_end"`
|
||||||
CoreAmount int `json:"core_amount"`
|
CoreAmount int `json:"core_amount"`
|
||||||
TotalFishbone int `json:"total_fishbone"`
|
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,6 @@ func ConvertToFishboneResponses(fishbones []entity.Fishbone, totalFishbone map[u
|
||||||
var responses []res.FishboneResponse
|
var responses []res.FishboneResponse
|
||||||
|
|
||||||
for _, fishbone := range fishbones {
|
for _, fishbone := range fishbones {
|
||||||
count := 0
|
|
||||||
if fishboneCount, exist := totalFishbone[fishbone.ID]; exist {
|
|
||||||
count = fishboneCount
|
|
||||||
}
|
|
||||||
|
|
||||||
fishboneResp := res.FishboneResponse{
|
fishboneResp := res.FishboneResponse{
|
||||||
ID: fishbone.ID,
|
ID: fishbone.ID,
|
||||||
FishboneCode: fishbone.FishboneCode,
|
FishboneCode: fishbone.FishboneCode,
|
||||||
|
|
@ -24,7 +19,6 @@ func ConvertToFishboneResponses(fishbones []entity.Fishbone, totalFishbone map[u
|
||||||
DeviceStart: fishbone.DeviceStart.DeviceCode,
|
DeviceStart: fishbone.DeviceStart.DeviceCode,
|
||||||
DeviceEnd: fishbone.DeviceEnd.DeviceCode,
|
DeviceEnd: fishbone.DeviceEnd.DeviceCode,
|
||||||
CoreAmount: fishbone.CoreAmount,
|
CoreAmount: fishbone.CoreAmount,
|
||||||
TotalFishbone: count,
|
|
||||||
CreatedAt: fishbone.CreatedAt,
|
CreatedAt: fishbone.CreatedAt,
|
||||||
UpdatedAt: fishbone.UpdatedAt,
|
UpdatedAt: fishbone.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +75,6 @@ func GetFishboneStats(fishbones []entity.Fishbone) map[string]interface{} {
|
||||||
}
|
}
|
||||||
|
|
||||||
return map[string]interface{}{
|
return map[string]interface{}{
|
||||||
"total_fishbones": totalFishbones,
|
|
||||||
"total_cores": totalCores,
|
"total_cores": totalCores,
|
||||||
"average_cores": float64(totalCores) / float64(totalFishbones),
|
"average_cores": float64(totalCores) / float64(totalFishbones),
|
||||||
"unique_backbones": len(backboneCount),
|
"unique_backbones": len(backboneCount),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue