根据比赛调整内容

This commit is contained in:
andy 2020-12-16 13:47:20 +08:00
parent 70abe45eb0
commit e8b6418aa6
3 changed files with 10 additions and 2 deletions

View File

@ -59,6 +59,11 @@ namespace OnlineUserPool.Hander
// targetData._Power.ToString(),
// targetData._Cadence.ToString()
//};
var weightKg = 0.0D;
if(targetData._Power >= 0)
{
weightKg = Math.Round(targetData._Power / item.Weight, 2);
}
var info = new MsgModel()
{
exit = item.End,
@ -72,7 +77,7 @@ namespace OnlineUserPool.Hander
CommandType = 1,
IsVirtual = true,
Speed = targetData._Speed,
WeightKg = Math.Round(targetData._Power / item.Weight, 2),
WeightKg = weightKg,
PreDistance = item.GetPreDistance()
};
msgModels.Add(info);

View File

@ -41,5 +41,7 @@ namespace OnlineUserPool.Model
public double WeightKg { get; set; }
public int Competitionid { get; set; }
public bool Saved { get; set; }
}
}

View File

@ -210,7 +210,8 @@ namespace OnlineUserPool.ViewModels
m.EndDistance,
m.IsVirtual,//后面要把这个字段过滤掉
m.WeightKg,
m.Competitionid
m.Competitionid,
m.Saved
}));
var data = Encoding.ASCII.GetBytes(jsonString);
foreach (var item in clients)