Revision 53866
Added by Miriam Baglioni over 5 years ago
CommunityApiController.java | ||
---|---|---|
187 | 187 |
return communityApiCore.removeCommunitySubjects(id, subjects); |
188 | 188 |
} |
189 | 189 |
|
190 |
@RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.GET) |
|
191 |
@ApiOperation( |
|
192 |
value = "get the list of Zenodo communities associated to a given community", |
|
193 |
notes = "get the list of Zenodo communities associated to a given community", |
|
194 |
tags = { C_ZC, R }, |
|
195 |
response = CommunityZenodoCommunity[].class) |
|
196 |
@ApiResponses(value = { |
|
197 |
@ApiResponse(code = 200, message = "OK", response = CommunityZenodoCommunity[].class), |
|
198 |
@ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), |
|
199 |
@ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) |
|
200 |
public List<CommunityZenodoCommunity> getCommunityZenodoCommunities(@PathVariable final String id) throws CommunityException, CommunityNotFoundException { |
|
201 |
return communityApiCore.getCommunityZenodoCommunities(id); |
|
202 |
} |
|
203 |
|
|
204 |
@RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.POST) |
|
205 |
@ApiOperation( |
|
206 |
value = "associate a Zenodo community to the community", |
|
207 |
notes = "associate a Zenodo community to the community", |
|
208 |
tags = { C_ZC, W }) |
|
209 |
@ApiResponses(value = { |
|
210 |
@ApiResponse(code = 200, message = "OK"), |
|
211 |
@ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), |
|
212 |
@ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) |
|
213 |
public CommunityZenodoCommunity addCommunityZenodoCOmmunity( |
|
214 |
@PathVariable final String id, |
|
215 |
@RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, CommunityNotFoundException { |
|
216 |
|
|
217 |
return communityApiCore.addCommunityZenodoCommunity(id, zenodocommunity); |
|
218 |
|
|
219 |
} |
|
220 |
|
|
221 |
@RequestMapping(value = "/community/{id}/zenodocommunities", produces = { "application/json" }, method = RequestMethod.DELETE) |
|
222 |
@ApiOperation( |
|
223 |
value = "remove a Zenodo community from a community", |
|
224 |
notes = "remove a Zenodo community from a community", |
|
225 |
tags = { C_ZC, W }) |
|
226 |
@ApiResponses(value = { |
|
227 |
@ApiResponse(code = 200, message = "OK"), |
|
228 |
@ApiResponse(code = 404, message = "not found", response = CommunityNotFoundException.class), |
|
229 |
@ApiResponse(code = 500, message = "unexpected error", response = CommunityException.class) }) |
|
230 |
public void removeCommunityZenodoCOmmunity( |
|
231 |
@PathVariable final String id, |
|
232 |
@RequestBody final Integer zenodoCommId) throws CommunityException, CommunityNotFoundException { |
|
233 |
|
|
234 |
communityApiCore.removeCommunityZenodoCommunity(id, zenodoCommId); |
|
235 |
|
|
236 |
} |
|
190 | 237 |
} |
Also available in: Unified diff
update for concept zenodocommunities