Search in sources :

Example 1 with TestCaseInRunVo

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

the class CaseInRunAction method rename.

@AuthPassport(validate = true)
@RequestMapping(value = "rename", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> rename(HttpServletRequest request, @RequestBody JSONObject json) {
    Map<String, Object> ret = new HashMap<String, Object>();
    UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
    TestCaseInRunVo vo = caseInRunService.renamePers(json, userVo);
    caseService.updateParentIfNeededPers(vo.getpId());
    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) TestCaseInRunVo(com.ngtesting.platform.vo.TestCaseInRunVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with TestCaseInRunVo

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

the class CaseInRunAction method move.

@AuthPassport(validate = true)
@RequestMapping(value = "move", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> move(HttpServletRequest request, @RequestBody JSONObject json) {
    Map<String, Object> ret = new HashMap<String, Object>();
    UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
    TestCaseInRunVo vo = caseInRunService.movePers(json, userVo);
    caseService.updateParentIfNeededPers(vo.getpId());
    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) TestCaseInRunVo(com.ngtesting.platform.vo.TestCaseInRunVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with TestCaseInRunVo

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

the class CaseInRunAction method setResult.

@AuthPassport(validate = true)
@RequestMapping(value = "setResult", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> setResult(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 caseInRunId = json.getLong("id");
    String result = json.getString("result");
    String status = json.getString("status");
    Long nextId = json.getLong("nextId");
    TestCaseInRunVo vo = caseInRunService.setResultPers(caseInRunId, result, status, nextId, userVo);
    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) TestCaseInRunVo(com.ngtesting.platform.vo.TestCaseInRunVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with TestCaseInRunVo

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

the class CaseInRunAction 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 orgId = userVo.getDefaultOrgId();
    Long caseId = json.getLong("id");
    TestCaseInRunVo vo = caseInRunService.getById(caseId);
    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) TestCaseInRunVo(com.ngtesting.platform.vo.TestCaseInRunVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)4 AuthPassport (com.ngtesting.platform.util.AuthPassport)4 TestCaseInRunVo (com.ngtesting.platform.vo.TestCaseInRunVo)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