1
我是ServiceStack的新手,我目前不熟悉如何開發良好API的結構。我正嘗試使用相同的玩家模型做2件獨立的事情:ServiceStack對多個服務使用相同的「模型」
//POSTS SECTION
[Route("/getplayernamechanged", "POST")]
[Route("/getplayernamechanged2", "POST")] //I want to use this route to return a Player name concat with the string "just another test"
public class Player
{
public string Name { get; set; }
}
public class PlayerResponse
{
public string Name { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
public class PlayerService : Service
{
public object Any(Player request)
{
return new PlayerResponse { Name = request.Name+" just a test"};
}
}
我該怎麼做? 謝謝
非常感謝。這就是我一直在尋找的! –
@JoãoMartins不客氣。祝你的項目好運。 – Scott