use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.
the class EnvAction method List.
@AuthPassport(validate = true)
@RequestMapping(value = "query", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> List(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long projectId = json.getLong("projectId");
List<TestEnv> ls = envService.list(projectId);
List<TestEnvVo> vos = envService.genVos(ls);
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.
the class EnvServiceImpl method save.
@Override
public TestEnv save(JSONObject json, UserVo optUser) {
Long id = json.getLong("id");
TestEnv po;
TestEnvVo vo = JSON.parseObject(JSON.toJSONString(json), TestEnvVo.class);
Constant.MsgType action;
if (id != null) {
po = (TestEnv) get(TestEnv.class, id);
action = Constant.MsgType.update;
} else {
po = new TestEnv();
action = Constant.MsgType.create;
}
po.setName(vo.getName());
po.setDescr(vo.getDescr());
po.setProjectId(vo.getProjectId());
saveOrUpdate(po);
return po;
}
Aggregations