mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-09-21 08:06:08 +08:00
Merge branch 'github_dev' of https://github.com/ctripcorp/zeus into github_dev
This commit is contained in:
commit
c2f68c2323
|
@ -283,9 +283,15 @@ public class GroupResource {
|
|||
@Path("/group/delete")
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
@Authorize(name = "deleteGroup")
|
||||
public Response delete(@Context HttpHeaders hh, @Context HttpServletRequest request, @QueryParam("groupId") Long groupId) throws Exception {
|
||||
if (groupId == null)
|
||||
throw new Exception("Missing parameter.");
|
||||
public Response delete(@Context HttpHeaders hh, @Context HttpServletRequest request,
|
||||
@QueryParam("groupId") Long groupId,
|
||||
@QueryParam("groupName") String groupName) throws Exception {
|
||||
if (groupId == null) {
|
||||
if (groupName != null && !groupName.isEmpty())
|
||||
groupId = groupCriteriaQuery.queryByName(groupName);
|
||||
}
|
||||
if (groupId == null || groupId == 0L)
|
||||
throw new ValidationException("groupId is not given or does not exist.");
|
||||
groupRepository.delete(groupId);
|
||||
return responseHandler.handle("Group is deleted.", hh.getMediaType());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue