Search in sources :

Example 1 with TestEnv

use of com.ngtesting.platform.entity.TestEnv 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 TestEnv

use of com.ngtesting.platform.entity.TestEnv 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 TestEnv

use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.

the class EnvServiceImpl method list.

@Override
public List<TestEnv> list(Long projectId) {
    DetachedCriteria dc = DetachedCriteria.forClass(TestEnv.class);
    dc.add(Restrictions.eq("deleted", Boolean.FALSE));
    dc.add(Restrictions.eq("disabled", Boolean.FALSE));
    dc.addOrder(Order.asc("createTime"));
    List<TestEnv> ls = findAllByCriteria(dc);
    return ls;
}
Also used : TestEnv(com.ngtesting.platform.entity.TestEnv) DetachedCriteria(org.hibernate.criterion.DetachedCriteria)

Example 4 with TestEnv

use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.

the class EnvServiceImpl method delete.

@Override
public TestEnv delete(Long id, Long clientId) {
    TestEnv po = (TestEnv) get(TestEnv.class, id);
    po.setDeleted(true);
    saveOrUpdate(po);
    return po;
}
Also used : TestEnv(com.ngtesting.platform.entity.TestEnv)

Example 5 with TestEnv

use of com.ngtesting.platform.entity.TestEnv 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)

Aggregations

TestEnv (com.ngtesting.platform.entity.TestEnv)8 TestEnvVo (com.ngtesting.platform.vo.TestEnvVo)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 DetachedCriteria (org.hibernate.criterion.DetachedCriteria)1