@Test public void restore() { mockHelper.reset(); mockHelper.mock("/" + uriPrefix() + "/restore"); JSONObject object = mockHelper.getResponse().asJson(); Assert.assertEquals(9986, object.getIntValue("code")); Assert.assertEquals(message.get(Validators.PREFIX + "illegal-id", message.get(name() + ".id")), object.getString("message")); Assert.assertNull(recycleService().getRestoreId()); mockHelper.reset(); mockHelper.getRequest().addParameter("id", "id"); mockHelper.mock("/" + uriPrefix() + "/restore"); object = mockHelper.getResponse().asJson(); Assert.assertEquals(9986, object.getIntValue("code")); Assert.assertEquals(message.get(Validators.PREFIX + "illegal-id", message.get(name() + ".id")), object.getString("message")); Assert.assertNull(recycleService().getRestoreId()); String id = generator.uuid(); mockHelper.reset(); mockHelper.getRequest().addParameter("id", id); mockHelper.mock("/" + uriPrefix() + "/restore"); object = mockHelper.getResponse().asJson(); Assert.assertEquals(9995, object.getIntValue("code")); Assert.assertEquals(message.get(Validators.PREFIX + "illegal-sign"), object.getString("message")); Assert.assertNull(recycleService().getRestoreId()); mockHelper.reset(); mockHelper.getRequest().addParameter("id", id); sign.put(mockHelper.getRequest().getMap(), null); mockHelper.mock("/" + uriPrefix() + "/restore"); object = mockHelper.getResponse().asJson(); Assert.assertEquals(0, object.getIntValue("code")); Assert.assertEquals("", object.getString("data")); Assert.assertEquals(id, recycleService().getRestoreId()); }
@Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) public Object restore() { getRecycleService().restore(request.get("id")); return ""; }
RecycleCtrlSupport { @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) public Object restore() { getRecycleService().restore(request.get("id")); return ""; } }
RecycleCtrlSupport { @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) public Object restore() { getRecycleService().restore(request.get("id")); return ""; }  }
RecycleCtrlSupport { @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) public Object restore() { getRecycleService().restore(request.get("id")); return ""; }  @Execute(name = "delete", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) Object delete(); @Execute(name = "recycle", validates = { @Validate(validator = Validators.SIGN) }) Object recycle(); @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) Object restore(); }
RecycleCtrlSupport { @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) public Object restore() { getRecycleService().restore(request.get("id")); return ""; }  @Execute(name = "delete", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) Object delete(); @Execute(name = "recycle", validates = { @Validate(validator = Validators.SIGN) }) Object recycle(); @Execute(name = "restore", validates = { @Validate(validator = Validators.ID, parameter = "id", failureCode = 86), @Validate(validator = Validators.SIGN) }) Object restore();  }