Search in sources :

Example 1 with CaseExeStatusVo

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

the class CaseExeStatusServiceImpl method genVo.

// @Override
// public void createDefaultBasicDataPers(Long orgId) {
// DetachedCriteria dc = DetachedCriteria.forClass(TestCaseExeStatus.class);
// dc.add(Restrictions.eq("isBuildIn", true));
// dc.add(Restrictions.eq("disabled", Boolean.FALSE));
// dc.add(Restrictions.eq("deleted", Boolean.FALSE));
// 
// dc.addOrder(Order.asc("displayOrder"));
// List<TestCaseExeStatus> ls = findAllByCriteria(dc);
// 
// for (TestCaseExeStatus p : ls) {
// TestCaseExeStatus temp = new TestCaseExeStatus();
// BeanUtilEx.copyProperties(temp, p);
// temp.setId(null);
// temp.setOrgId(orgId);
// temp.setBuildIn(false);
// saveOrUpdate(temp);
// }
// }
@Override
public CaseExeStatusVo genVo(TestCaseExeStatus po) {
    if (po == null) {
        return null;
    }
    CaseExeStatusVo vo = new CaseExeStatusVo();
    BeanUtilEx.copyProperties(vo, po);
    return vo;
}
Also used : CaseExeStatusVo(com.ngtesting.platform.vo.CaseExeStatusVo)

Example 2 with CaseExeStatusVo

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

the class CaseExeStatusServiceImpl method genVos.

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

Example 3 with CaseExeStatusVo

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

the class CaseExeStatusAction 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");
    if (id == null) {
        ret.put("data", new CaseExeStatusVo());
        ret.put("code", Constant.RespCode.SUCCESS.getCode());
        return ret;
    }
    TestCaseExeStatus po = (TestCaseExeStatus) caseExeStatusService.get(TestCaseExeStatus.class, id);
    CaseExeStatusVo vo = caseExeStatusService.genVo(po);
    ret.put("data", vo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : CaseExeStatusVo(com.ngtesting.platform.vo.CaseExeStatusVo) TestCaseExeStatus(com.ngtesting.platform.entity.TestCaseExeStatus) UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with CaseExeStatusVo

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

the class CaseExeStatusAction method list.

@AuthPassport(validate = true)
@RequestMapping(value = "list", 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 orgId = userVo.getDefaultOrgId();
    List<CaseExeStatusVo> vos = caseExeStatusService.listVos(orgId);
    ret.put("data", vos);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : CaseExeStatusVo(com.ngtesting.platform.vo.CaseExeStatusVo) UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 5 with CaseExeStatusVo

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

the class CaseExeStatusAction method changeOrder.

@AuthPassport(validate = true)
@RequestMapping(value = "changeOrder", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> changeOrder(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 orgId = userVo.getDefaultOrgId();
    Long id = json.getLong("id");
    String act = json.getString("act");
    boolean success = caseExeStatusService.changeOrderPers(id, act);
    List<CaseExeStatusVo> vos = caseExeStatusService.listVos(orgId);
    ret.put("data", vos);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : CaseExeStatusVo(com.ngtesting.platform.vo.CaseExeStatusVo) UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

CaseExeStatusVo (com.ngtesting.platform.vo.CaseExeStatusVo)7 JSONObject (com.alibaba.fastjson.JSONObject)4 AuthPassport (com.ngtesting.platform.util.AuthPassport)4 UserVo (com.ngtesting.platform.vo.UserVo)4 HashMap (java.util.HashMap)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)4 TestCaseExeStatus (com.ngtesting.platform.entity.TestCaseExeStatus)3 LinkedList (java.util.LinkedList)2 List (java.util.List)1