Bug WISE-190 fixed.
Implement REST Console support.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package com.wisemapping.rest;
|
||||
|
||||
import com.mangofactory.swagger.annotations.ApiIgnore;
|
||||
import com.wisemapping.mail.NotificationService;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
import com.wisemapping.model.User;
|
||||
@@ -25,16 +26,21 @@ import com.wisemapping.rest.model.RestLogItem;
|
||||
import com.wisemapping.security.Utils;
|
||||
import com.wisemapping.service.MindmapService;
|
||||
import com.wisemapping.service.UserService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Api(value="UserApi",description = "Account Account Related Objects.")
|
||||
@Controller
|
||||
public class AccountController extends BaseController {
|
||||
@Qualifier("userService")
|
||||
@@ -100,6 +106,7 @@ public class AccountController extends BaseController {
|
||||
userService.updateUser(user);
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@RequestMapping(method = RequestMethod.POST, value = "logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
|
||||
|
@@ -18,18 +18,30 @@
|
||||
|
||||
package com.wisemapping.rest;
|
||||
|
||||
import com.mangofactory.swagger.annotations.ApiModel;
|
||||
import com.wisemapping.exceptions.WiseMappingException;
|
||||
import com.wisemapping.model.*;
|
||||
import com.wisemapping.model.AuthenticationType;
|
||||
import com.wisemapping.model.Collaboration;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.rest.model.RestUser;
|
||||
import com.wisemapping.service.MindmapService;
|
||||
import com.wisemapping.service.UserService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import com.wordnik.swagger.annotations.ApiParam;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -38,40 +50,42 @@ import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Api(value = "AdminApi", description = "Administrative Related Objects.")
|
||||
@Controller
|
||||
public class AdminController extends BaseController {
|
||||
@Qualifier("userService")
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Qualifier("mindmapService")
|
||||
@Autowired
|
||||
private MindmapService mindmapService;
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"})
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "application/xml"})
|
||||
@ResponseBody
|
||||
public ModelAndView getUserById(@PathVariable long id) throws IOException {
|
||||
public RestUser getUserById(@PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws IOException {
|
||||
final User userBy = userService.getUserBy(id);
|
||||
if (userBy == null) {
|
||||
throw new IllegalArgumentException("User could not be found");
|
||||
}
|
||||
return new ModelAndView("userView", "user", new RestUser(userBy));
|
||||
return new RestUser(userBy);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "text/html", "application/xml"})
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "application/xml"})
|
||||
@ResponseBody
|
||||
public ModelAndView getUserByEmail(@PathVariable String email) throws IOException {
|
||||
public RestUser getUserByEmail(@PathVariable String email) throws IOException {
|
||||
final User user = userService.getUserBy(email);
|
||||
if (user == null) {
|
||||
throw new IllegalArgumentException("User '" + email + "' could not be found");
|
||||
}
|
||||
return new ModelAndView("userView", "user", new RestUser(user));
|
||||
return new RestUser(user);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.CREATED)
|
||||
public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException {
|
||||
public void createUser(@RequestBody @ApiParam(required = true) RestUser user, HttpServletResponse response) throws WiseMappingException {
|
||||
if (user == null) {
|
||||
throw new IllegalArgumentException("User could not be found");
|
||||
}
|
||||
@@ -100,9 +114,10 @@ public class AdminController extends BaseController {
|
||||
response.setHeader("Location", "/service/admin/users/" + user.getId());
|
||||
}
|
||||
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void changePassword(@RequestBody String password, @PathVariable long id) throws WiseMappingException {
|
||||
public void changePassword(@RequestBody @ApiParam(required = true) String password, @PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws WiseMappingException {
|
||||
if (password == null) {
|
||||
throw new IllegalArgumentException("Password can not be null");
|
||||
}
|
||||
@@ -115,9 +130,10 @@ public class AdminController extends BaseController {
|
||||
userService.changePassword(user);
|
||||
}
|
||||
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}")
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void getUserByEmail(@PathVariable long id) throws WiseMappingException {
|
||||
public void getUserByEmail(@PathVariable @ApiParam(required = true, allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws WiseMappingException {
|
||||
final User user = userService.getUserBy(id);
|
||||
if (user == null) {
|
||||
throw new IllegalArgumentException("User '" + id + "' could not be found");
|
||||
@@ -125,6 +141,7 @@ public class AdminController extends BaseController {
|
||||
userService.deleteUser(user);
|
||||
}
|
||||
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge")
|
||||
public void purgeDB(@RequestParam(required = true) Integer minUid, @RequestParam(required = true) Integer maxUid, @RequestParam(required = true) Boolean apply) throws WiseMappingException, UnsupportedEncodingException {
|
||||
@@ -132,7 +149,6 @@ public class AdminController extends BaseController {
|
||||
for (int i = minUid; i < maxUid; i++) {
|
||||
|
||||
try {
|
||||
|
||||
System.out.println("Looking for user:" + i);
|
||||
final User user = userService.getUserBy(i);
|
||||
if (user != null) {
|
||||
@@ -179,6 +195,7 @@ public class AdminController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("Note: Administration permissions required.")
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge/history")
|
||||
public void purgeHistory(@RequestParam(required = true) Integer mapId) throws WiseMappingException, IOException {
|
||||
@@ -186,7 +203,6 @@ public class AdminController extends BaseController {
|
||||
mindmapService.purgeHistory(mapId);
|
||||
}
|
||||
|
||||
|
||||
private boolean isWelcomeMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
|
||||
// Is welcome map ?
|
||||
final String xmlStr = mindmap.getXmlStr();
|
||||
|
@@ -18,20 +18,37 @@
|
||||
|
||||
package com.wisemapping.rest;
|
||||
|
||||
|
||||
import com.wisemapping.exceptions.*;
|
||||
import com.mangofactory.swagger.annotations.ApiIgnore;
|
||||
import com.wisemapping.exceptions.ImportUnexpectedException;
|
||||
import com.wisemapping.exceptions.MapCouldNotFoundException;
|
||||
import com.wisemapping.exceptions.MultipleSessionsOpenException;
|
||||
import com.wisemapping.exceptions.SessionExpiredException;
|
||||
import com.wisemapping.exceptions.WiseMappingException;
|
||||
import com.wisemapping.importer.ImportFormat;
|
||||
import com.wisemapping.importer.Importer;
|
||||
import com.wisemapping.importer.ImporterException;
|
||||
import com.wisemapping.importer.ImporterFactory;
|
||||
import com.wisemapping.model.*;
|
||||
import com.wisemapping.rest.model.*;
|
||||
import com.wisemapping.model.Collaboration;
|
||||
import com.wisemapping.model.CollaborationProperties;
|
||||
import com.wisemapping.model.CollaborationRole;
|
||||
import com.wisemapping.model.MindMapHistory;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.rest.model.RestCollaboration;
|
||||
import com.wisemapping.rest.model.RestCollaborationList;
|
||||
import com.wisemapping.rest.model.RestMindmap;
|
||||
import com.wisemapping.rest.model.RestMindmapHistory;
|
||||
import com.wisemapping.rest.model.RestMindmapHistoryList;
|
||||
import com.wisemapping.rest.model.RestMindmapInfo;
|
||||
import com.wisemapping.rest.model.RestMindmapList;
|
||||
import com.wisemapping.security.Utils;
|
||||
import com.wisemapping.service.CollaborationException;
|
||||
import com.wisemapping.service.LockInfo;
|
||||
import com.wisemapping.service.LockManager;
|
||||
import com.wisemapping.service.MindmapService;
|
||||
import com.wisemapping.validator.MapInfoValidator;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiParam;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -39,15 +56,28 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@Api(value="mindmap",description = "User Mindmap Objects.")
|
||||
@Controller
|
||||
public class MindmapController extends BaseController {
|
||||
|
||||
@@ -58,12 +88,10 @@ public class MindmapController extends BaseController {
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"})
|
||||
@ResponseBody
|
||||
public ModelAndView retrieve(@PathVariable int id) throws WiseMappingException {
|
||||
public RestMindmap retrieve(@PathVariable int id) throws WiseMappingException {
|
||||
final User user = Utils.getUser();
|
||||
final Mindmap mindMap = findMindmapById(id);
|
||||
final RestMindmap map = new RestMindmap(mindMap, user);
|
||||
|
||||
return new ModelAndView("mapView", "map", map);
|
||||
return new RestMindmap(mindMap, user);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"})
|
||||
@@ -131,8 +159,8 @@ public class MindmapController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "text/html", "application/xml"})
|
||||
public ModelAndView retrieveList(@RequestParam(required = false) String q) throws IOException {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "application/xml"})
|
||||
public RestMindmapList retrieveList(@RequestParam(required = false) String q) throws IOException {
|
||||
final User user = Utils.getUser();
|
||||
|
||||
final MindmapFilter filter = MindmapFilter.parse(q);
|
||||
@@ -145,19 +173,18 @@ public class MindmapController extends BaseController {
|
||||
mindmaps.add(mindmap);
|
||||
}
|
||||
}
|
||||
final RestMindmapList restMindmapList = new RestMindmapList(mindmaps, user);
|
||||
return new ModelAndView("mapsView", "list", restMindmapList);
|
||||
return new RestMindmapList(mindmaps, user);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "text/html", "application/xml"})
|
||||
public ModelAndView retrieveHistory(@PathVariable int id) throws IOException {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "application/xml"})
|
||||
public RestMindmapHistoryList retrieveHistory(@PathVariable int id) throws IOException {
|
||||
final List<MindMapHistory> histories = mindmapService.findMindmapHistory(id);
|
||||
final RestMindmapHistoryList result = new RestMindmapHistoryList();
|
||||
for (MindMapHistory history : histories) {
|
||||
result.addHistory(new RestMindmapHistory(history));
|
||||
}
|
||||
return new ModelAndView("historyView", "list", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +207,7 @@ public class MindmapController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseBody
|
||||
public long updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor, @RequestParam(required = false) Long timestamp, @RequestParam(required = false) Long session) throws WiseMappingException, IOException {
|
||||
|
||||
@@ -216,6 +243,7 @@ public class MindmapController extends BaseController {
|
||||
return lockInfo.getTimestamp();
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"/maps/{id}/document/xml", "/maps/{id}/document/xml-pub"}, consumes = {"text/plain"}, produces = {"application/xml"})
|
||||
@ResponseBody
|
||||
public byte[] retrieveDocument(@PathVariable int id, @NotNull HttpServletResponse response) throws WiseMappingException, IOException {
|
||||
@@ -267,9 +295,9 @@ public class MindmapController extends BaseController {
|
||||
/**
|
||||
* The intention of this method is the update of several properties at once ...
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void update(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
|
||||
public void updateProperties(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
|
||||
|
||||
final Mindmap mindmap = findMindmapById(id);
|
||||
final User user = Utils.getUser();
|
||||
@@ -320,7 +348,7 @@ public class MindmapController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException {
|
||||
|
||||
@@ -339,7 +367,7 @@ public class MindmapController extends BaseController {
|
||||
mindmapService.updateMindmap(mindMap, !true);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException {
|
||||
final Mindmap mindMap = findMindmapById(id);
|
||||
@@ -380,8 +408,8 @@ public class MindmapController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "text/html", "application/xml"})
|
||||
public ModelAndView retrieveList(@PathVariable int id) throws MapCouldNotFoundException {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "application/xml"})
|
||||
public RestCollaborationList retrieveList(@PathVariable int id) throws MapCouldNotFoundException {
|
||||
final Mindmap mindMap = findMindmapById(id);
|
||||
|
||||
final Set<Collaboration> collaborations = mindMap.getCollaborations();
|
||||
@@ -390,14 +418,14 @@ public class MindmapController extends BaseController {
|
||||
collabs.add(new RestCollaboration(collaboration));
|
||||
}
|
||||
|
||||
final RestCollaborationList restCollaborationList = new RestCollaborationList();
|
||||
restCollaborationList.setCollaborations(collabs);
|
||||
final RestCollaborationList result = new RestCollaborationList();
|
||||
result.setCollaborations(collabs);
|
||||
|
||||
return new ModelAndView("collabsView", "list", restCollaborationList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException {
|
||||
|
||||
@@ -410,7 +438,7 @@ public class MindmapController extends BaseController {
|
||||
mindmapService.updateMindmap(mindMap, !true);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
|
||||
|
||||
@@ -435,9 +463,9 @@ public class MindmapController extends BaseController {
|
||||
mindmapService.removeMindmap(mindmap, user);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
|
||||
public void updateStarredState(@RequestBody @ApiParam(defaultValue = "false",allowableValues = "true,false") String value, @PathVariable int id) throws WiseMappingException {
|
||||
|
||||
final Mindmap mindmap = findMindmapById(id);
|
||||
final User user = Utils.getUser();
|
||||
@@ -452,7 +480,8 @@ public class MindmapController extends BaseController {
|
||||
mindmapService.updateCollaboration(user, collaboration);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
|
||||
@ApiIgnore
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void updateMapLock(@RequestBody String value, @PathVariable int id) throws IOException, WiseMappingException {
|
||||
final User user = Utils.getUser();
|
||||
@@ -467,6 +496,7 @@ public class MindmapController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/batch")
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void batchDelete(@RequestParam(required = true) String ids) throws IOException, WiseMappingException {
|
||||
|
@@ -31,6 +31,8 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.Calendar;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
|
||||
@XmlRootElement(name = "user")
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
@JsonAutoDetect(
|
||||
|
Reference in New Issue
Block a user