Skip to content

Commit

Permalink
BUG: error on parse response of apply tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Moreno committed Oct 5, 2021
1 parent 4b99f6e commit bb09583
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions BotPVU/Models/PVU/PVUClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ public class ApplyToolRequest
public int toolId { get; set; }
public Token token { get; set; }
}
public class ApplyToolResponse
{
public int status { get; set; }
public object data { get; set; }
}

public class Reward
{
Expand Down
4 changes: 2 additions & 2 deletions BotPVU/PVUHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static Models.PVU.GetFarmResponse getFarmInfo()
/// <param name="farmId">_id</param>
/// <param name="toolId">1 Small Port, 2 Big POT, 3 water, 4 scarecrow, 5 greenhouse</param>
/// <returns></returns>
public static Models.PVU.GetFarmResponse UseTool(string farmId, int toolId)
public static Models.PVU.ApplyToolResponse UseTool(string farmId, int toolId)
{
try
{
Expand All @@ -52,7 +52,7 @@ public static Models.PVU.GetFarmResponse UseTool(string farmId, int toolId)
}
};
var jsonString = getRequest("https://backend-farm.plantvsundead.com/farms/apply-tool", "POST", JsonSerializer.Serialize(rq).ToString());
var objRes = JsonSerializer.Deserialize<Models.PVU.GetFarmResponse>(jsonString);
var objRes = JsonSerializer.Deserialize<Models.PVU.ApplyToolResponse>(jsonString);
return objRes;
}
catch (Exception ex)
Expand Down

0 comments on commit bb09583

Please sign in to comment.