選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

45 行
1.1 KiB

  1. using AbrBlazorTools;
  2. using System.Net.Http;
  3. using System.Threading.Tasks;
  4. namespace Panel.ApiUtils
  5. {
  6. public class PlantsUtils : IPlantsUtils
  7. {
  8. private readonly IHttpClientWithLoginToken _client;
  9. public PlantsUtils(IHttpClientWithLoginToken client)
  10. {
  11. _client = client;
  12. }
  13. public Task<HttpResponseMessage> List()
  14. {
  15. return _client.HttpGet("/api/Plants/List");
  16. }
  17. public Task<HttpResponseMessage> Add(object plantModel)
  18. {
  19. return _client.HttpPost("/api/Plants/Add", plantModel);
  20. }
  21. public Task<HttpResponseMessage> Update(object plantModel)
  22. {
  23. return _client.HttpPut("/api/Plants/Update", plantModel);
  24. }
  25. public Task<HttpResponseMessage> Delete(Guid id)
  26. {
  27. return _client.HttpDelete($"/api/Plants/Delete/{id}");
  28. }
  29. }
  30. public interface IPlantsUtils
  31. {
  32. Task<HttpResponseMessage> List();
  33. Task<HttpResponseMessage> Add(object plantModel);
  34. Task<HttpResponseMessage> Update(object plantModel);
  35. Task<HttpResponseMessage> Delete(Guid id);
  36. }
  37. }