Search in sources :

Example 21 with UserVo

use of com.ngtesting.platform.vo.UserVo 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)

Example 22 with UserVo

use of com.ngtesting.platform.vo.UserVo 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)

Example 23 with UserVo

use of com.ngtesting.platform.vo.UserVo 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 24 with UserVo

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

the class CasePriorityAction method setDefault.

@AuthPassport(validate = true)
@RequestMapping(value = "setDefault", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> setDefault(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");
    boolean success = casePriorityService.setDefaultPers(id, orgId);
    List<CasePriorityVo> vos = casePriorityService.listVos(orgId);
    ret.put("data", vos);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) CasePriorityVo(com.ngtesting.platform.vo.CasePriorityVo) 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 25 with UserVo

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

the class CaseTypeAction 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 CaseTypeVo());
        ret.put("code", Constant.RespCode.SUCCESS.getCode());
        return ret;
    }
    TestCaseType po = (TestCaseType) caseTypeService.get(TestCaseType.class, id);
    CaseTypeVo vo = caseTypeService.genVo(po);
    ret.put("data", vo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : UserVo(com.ngtesting.platform.vo.UserVo) CaseTypeVo(com.ngtesting.platform.vo.CaseTypeVo) HashMap(java.util.HashMap) TestCaseType(com.ngtesting.platform.entity.TestCaseType) 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

UserVo (com.ngtesting.platform.vo.UserVo)84 HashMap (java.util.HashMap)79 AuthPassport (com.ngtesting.platform.util.AuthPassport)78 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)78 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)78 JSONObject (com.alibaba.fastjson.JSONObject)77 TestUser (com.ngtesting.platform.entity.TestUser)9 List (java.util.List)7 CasePriorityVo (com.ngtesting.platform.vo.CasePriorityVo)5 CaseTypeVo (com.ngtesting.platform.vo.CaseTypeVo)5 RelationOrgGroupUserVo (com.ngtesting.platform.vo.RelationOrgGroupUserVo)5 TestRun (com.ngtesting.platform.entity.TestRun)4 TestSuite (com.ngtesting.platform.entity.TestSuite)4 CaseExeStatusVo (com.ngtesting.platform.vo.CaseExeStatusVo)4 CustomFieldVo (com.ngtesting.platform.vo.CustomFieldVo)4 OrgGroupVo (com.ngtesting.platform.vo.OrgGroupVo)4 TestCaseInRunVo (com.ngtesting.platform.vo.TestCaseInRunVo)4 TestRunVo (com.ngtesting.platform.vo.TestRunVo)4 TestSuiteVo (com.ngtesting.platform.vo.TestSuiteVo)4 Map (java.util.Map)4