Search in sources :

Example 6 with CaseTypeVo

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

the class CaseTypeAction 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 = caseTypeService.changeOrderPers(id, act, orgId);
    List<CaseTypeVo> vos = caseTypeService.listVos(orgId);
    ret.put("data", vos);
    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) 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 7 with CaseTypeVo

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

the class CaseTypeAction 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<CaseTypeVo> vos = caseTypeService.listVos(orgId);
    Map<String, Map<String, String>> casePropertyMap = casePropertyService.getMap(orgId);
    ret.put("data", vos);
    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) JSONObject(com.alibaba.fastjson.JSONObject) HashMap(java.util.HashMap) Map(java.util.Map) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 8 with CaseTypeVo

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

the class CaseTypeServiceImpl method genVos.

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

Aggregations

CaseTypeVo (com.ngtesting.platform.vo.CaseTypeVo)8 JSONObject (com.alibaba.fastjson.JSONObject)5 AuthPassport (com.ngtesting.platform.util.AuthPassport)5 UserVo (com.ngtesting.platform.vo.UserVo)5 HashMap (java.util.HashMap)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 TestCaseType (com.ngtesting.platform.entity.TestCaseType)3 LinkedList (java.util.LinkedList)2 Map (java.util.Map)2 List (java.util.List)1