Search in sources :

Example 1 with TestCaseInRun

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

the class CaseInRunAction method delete.

@AuthPassport(validate = true)
@RequestMapping(value = "delete", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> delete(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 entityId = json.getLong("entityId");
    TestCaseInRun caseInRun = caseInRunService.deleteCaseFromRunPers(entityId, userVo);
    caseService.updateParentIfNeededPers(caseInRun.getpId());
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) TestCaseInRun(com.ngtesting.platform.entity.TestCaseInRun) 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

JSONObject (com.alibaba.fastjson.JSONObject)1 TestCaseInRun (com.ngtesting.platform.entity.TestCaseInRun)1 AuthPassport (com.ngtesting.platform.util.AuthPassport)1 UserVo (com.ngtesting.platform.vo.UserVo)1 HashMap (java.util.HashMap)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1