#RestfulApi

17 messages · Page 1 of 1 (latest)

tawdry gyro
#

So am doing my restful api spring library management project, i have 4 Classes (DTOs too) User, Contactinfo etc etc...
So i have already Created Post, Get, Put, Delete methods for my controllers, now i want extra Post method for my User controller where i can Post present(existing) Contactinfo to present(existing) user... i am stuck dont know what method to implement or what to do, @postmapping(/user/userId/addContact/contactId) <- probably something like that but idk ...

stone cometBOT
#

This post has been reserved for your question.

Hey @tawdry gyro! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

ripe crater
#

In that case I'd say PUT /user/userid/contact/conractid

#

You shouldn't add verbs as part of the resource

tawdry gyro
#

Ohhh yes sounds smart i will try tomorrow

#

Btw what controller method probably will like what return type should it have and what parameters should i give ? And how to write service implementation method to use in controller method ?

ripe crater
stone cometBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

tawdry gyro
#

i mean

#

here what return type method should have what path variables do i need ?

#

also

#

how to write method correctly for assignTeamTocourse?

tawdry gyro
#

thats my controller