API
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ResortController.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Mvc;
  6. using UnivateProperties_API.Repository.Timeshare;
  7. // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
  8. namespace UnivateProperties_API.Controllers.Timeshare
  9. {
  10. [Route("api/[controller]")]
  11. [ApiController]
  12. public class ResortController : ControllerBase
  13. {
  14. private readonly IResortRepository _Repo;
  15. public ResortController(IResortRepository repo)
  16. {
  17. _Repo = repo;
  18. }
  19. [HttpGet("{regionCode}")]
  20. public IActionResult Get(string regionCode)
  21. {
  22. return new OkObjectResult(_Repo.GetResortsByRegion(regionCode));
  23. }
  24. [HttpGet("GetResortDescription/{code}")]
  25. public IActionResult GetResortDescription(string code)
  26. {
  27. return new OkObjectResult(_Repo.GetResortDescription(code));
  28. }
  29. [HttpGet("GetResortImages/{code}")]
  30. public IActionResult GetResortImages(string code)
  31. {
  32. return new OkObjectResult(_Repo.GetResortImages(code));
  33. }
  34. [HttpGet("GetResortData/{code}")]
  35. public IActionResult GetResortData(string code)
  36. {
  37. return new OkObjectResult(_Repo.GetResortData(code));
  38. }
  39. [HttpGet("GetPublishedResortsWithListings")]
  40. public IActionResult GetResortsWithListings()
  41. {
  42. return new OkObjectResult(_Repo.GetResortsWithListings());
  43. }
  44. }
  45. }