Facebook
From swetha, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 211
  1.  
  2. Post -
  3. Get-
  4.  
  5. Put
  6.  
  7. Delete
  8.  
  9.  
  10. Profiles- name, email, phonenumber
  11.  
  12. @PostMapping(“/savedata”)
  13. {
  14. Name:
  15. Email
  16. Phone:
  17. }
  18.  
  19.  
  20. Jpareposit
  21.  
  22. @GetMapping({id})   Controller    Service      Dao
  23.  
  24. Crud - post - insert
  25. Select - findAll()
  26.  
  27. List<Profiles> DeleteByName();
  28.  
  29.  
  30. Http :  Post - /createProfile - Input :           TO get the data
  31.  
  32. RequestBody
  33. {
  34. Name:”swetha”;
  35. Email:”nswetha@safd”
  36. Phone:34343
  37. }
  38.  
  39. Output:
  40. ResponseBody
  41.  
  42. “Success “+ id, HttpStatus.Ok
  43.  
  44. Fail: “Failed”,
  45.  
  46.  
  47. TO get the data based on id:
  48.  
  49. GET - /getdata/{id}
  50.  
  51. @PathVariable
  52.  
  53. Service: findById()
  54.  
  55. Response body+ code
  56. {
  57. Name:”swetha”;
  58. Email:”nswetha@safd”
  59. Phone:34343
  60. }
  61.  
  62. Else
  63.  
  64. Failed code+ failure code
  65.  
  66. GET - /getdata/{Name}/{Email}
  67.  
  68. @PathVariable
  69.  
  70. Service: findByName()
  71.  
  72. Response body+ code
  73. {
  74. Name:”swetha”;
  75. Email:”nswetha@safd”
  76. Phone:34343
  77. }
  78. Else{
  79. Failed response+ code
  80.  
  81. }
  82.  
  83. GET - /getdata/{Email}
  84.  
  85. @PathVariable
  86.  
  87. Service: findByEmail()
  88.  
  89. Response body+ code
  90. {
  91. Name:”swetha”;
  92. Email:”nswetha@safd”
  93. Phone:34343
  94. }
  95. Else{
  96. Failed response+ code
  97.  
  98. }
  99.  
  100.  
  101. Put: -/updateprofile
  102. @RequestBody
  103. {
  104.  
  105. Name:”swetha”
  106. Email:”ads”
  107. }
  108.  
  109. service: findByName()
  110.  
  111. Response body:”updated”
  112.  
  113. Else:”failure”+statuscode
  114.  
  115. @deprecated
  116. Delete: /deletebyName/{name}/{id}
  117.  
  118. EmpId:
  119.  
  120. servce.deleteByName()
  121.  
  122. success+name
  123.  
  124. Else
  125.  
  126. Failure
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.