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

FeesController.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.AspNetCore.Mvc;
  7. using UnivateProperties_API.Model.Financial;
  8. using UnivateProperties_API.Repository.Financial;
  9. namespace UnivateProperties_API.Controllers.Financial
  10. {
  11. [Route("api/[controller]")]
  12. [ApiController]
  13. public class FeesController : ControllerBase
  14. {
  15. private readonly IListingRepository _repo;
  16. public FeesController(IListingRepository rp)
  17. {
  18. _repo = rp;
  19. }
  20. // GET: api/Fees/listingFee
  21. [HttpGet("listingFee")]
  22. public IActionResult Get()
  23. {
  24. return new OkObjectResult(_repo.GetListingFee());
  25. }
  26. // POST: api/Fees
  27. [HttpPost("listingFee")]
  28. public IActionResult Post([FromBody] ListingFee fee)
  29. {
  30. var feeObj = _repo.insertListingFee(fee);
  31. if (feeObj != null)
  32. {
  33. return new OkObjectResult(fee);
  34. }
  35. else
  36. {
  37. return new NoContentResult();
  38. }
  39. }
  40. // PUT: api/Fees/5
  41. [HttpPut("{id}")]
  42. public void Put(int id, [FromBody] string value)
  43. {
  44. }
  45. // DELETE: api/ApiWithActions/5
  46. [HttpDelete("{id}")]
  47. public void Delete(int id)
  48. {
  49. }
  50. }
  51. }