Search in sources :

Example 1 with CasePriorityVo

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

the class CasePriorityServiceImpl method genVos.

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

Example 2 with CasePriorityVo

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

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

the class CasePriorityAction method save.

@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(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();
    CasePriorityVo vo = json.getObject("model", CasePriorityVo.class);
    TestCasePriority po = casePriorityService.save(vo, orgId);
    CasePriorityVo projectVo = casePriorityService.genVo(po);
    Map<String, Map<String, String>> casePropertyMap = casePropertyService.getMap(orgId);
    ret.put("casePropertyMap", casePropertyMap);
    ret.put("data", projectVo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : TestCasePriority(com.ngtesting.platform.entity.TestCasePriority) UserVo(com.ngtesting.platform.vo.UserVo) HashMap(java.util.HashMap) CasePriorityVo(com.ngtesting.platform.vo.CasePriorityVo) 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 4 with CasePriorityVo

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

the class CasePriorityAction 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 = casePriorityService.changeOrderPers(id, act, 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 5 with CasePriorityVo

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

the class CasePriorityAction 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<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)

Aggregations

CasePriorityVo (com.ngtesting.platform.vo.CasePriorityVo)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 TestCasePriority (com.ngtesting.platform.entity.TestCasePriority)3 LinkedList (java.util.LinkedList)2 List (java.util.List)1 Map (java.util.Map)1