Search in sources :

Example 1 with TestEnvVo

use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.

the class EnvServiceImpl method genVos.

@Override
public List<TestEnvVo> genVos(List<TestEnv> pos) {
    List<TestEnvVo> vos = new LinkedList<TestEnvVo>();
    for (TestEnv po : pos) {
        TestEnvVo vo = genVo(po);
        vos.add(vo);
    }
    return vos;
}
Also used : TestEnv(com.ngtesting.platform.entity.TestEnv) TestEnvVo(com.ngtesting.platform.vo.TestEnvVo) LinkedList(java.util.LinkedList)

Example 2 with TestEnvVo

use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.

the class EnvServiceImpl method getById.

@Override
public TestEnvVo getById(Long caseId) {
    TestEnv po = (TestEnv) get(TestEnv.class, caseId);
    TestEnvVo vo = genVo(po);
    return vo;
}
Also used : TestEnv(com.ngtesting.platform.entity.TestEnv) TestEnvVo(com.ngtesting.platform.vo.TestEnvVo)

Example 3 with TestEnvVo

use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.

the class EnvServiceImpl method genVo.

@Override
public TestEnvVo genVo(TestEnv po) {
    TestEnvVo vo = new TestEnvVo();
    vo.setId(po.getId());
    vo.setName(po.getName());
    vo.setDescr(po.getDescr());
    vo.setProjectId(po.getProjectId());
    return vo;
}
Also used : TestEnvVo(com.ngtesting.platform.vo.TestEnvVo)

Example 4 with TestEnvVo

use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.

the class EnvAction method save.

@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(HttpServletRequest request, @RequestBody JSONObject json) {
    Map<String, Object> ret = new HashMap<String, Object>();
    UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
    TestEnv po = envService.save(json, userVo);
    TestEnvVo vo = envService.genVo(po);
    optFacade.opt(WsConstant.WS_TODO, userVo.getId().toString());
    ret.put("data", vo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : UserVo(com.ngtesting.platform.vo.UserVo) TestEnv(com.ngtesting.platform.entity.TestEnv) HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) TestEnvVo(com.ngtesting.platform.vo.TestEnvVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 5 with TestEnvVo

use of com.ngtesting.platform.vo.TestEnvVo in project ngtesting-platform by aaronchen2k.

the class EnvAction method get.

@AuthPassport(validate = true)
@RequestMapping(value = "get", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> get(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 id = json.getLong("id");
    TestEnvVo vo = envService.getById(id);
    ret.put("data", vo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) TestEnvVo(com.ngtesting.platform.vo.TestEnvVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

TestEnvVo (com.ngtesting.platform.vo.TestEnvVo)7 TestEnv (com.ngtesting.platform.entity.TestEnv)5 JSONObject (com.alibaba.fastjson.JSONObject)3 AuthPassport (com.ngtesting.platform.util.AuthPassport)3 UserVo (com.ngtesting.platform.vo.UserVo)3 HashMap (java.util.HashMap)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 Constant (com.ngtesting.platform.config.Constant)1 LinkedList (java.util.LinkedList)1