Search in sources :

Example 6 with TestCase

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

the class CaseAction 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);
    TestCase testCasePo = caseService.renamePers(json, userVo);
    caseService.updateParentIfNeededPers(testCasePo.getpId());
    TestCaseVo caseVo = caseService.genVo(testCasePo);
    ret.put("data", caseVo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : HashMap(java.util.HashMap) TestCase(com.ngtesting.platform.entity.TestCase) 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)6 TestCase (com.ngtesting.platform.entity.TestCase)6 AuthPassport (com.ngtesting.platform.util.AuthPassport)6 HashMap (java.util.HashMap)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)6 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)6