Search in sources :

Example 6 with CasePriorityVo

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

the class CasePriorityAction 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 CasePriorityVo());
        ret.put("code", Constant.RespCode.SUCCESS.getCode());
        return ret;
    }
    TestCasePriority po = (TestCasePriority) casePriorityService.get(TestCasePriority.class, id);
    CasePriorityVo vo = casePriorityService.genVo(po);
    ret.put("data", vo);
    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) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 7 with CasePriorityVo

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

the class CasePriorityServiceImpl method genVo.

@Override
public CasePriorityVo genVo(TestCasePriority po) {
    if (po == null) {
        return null;
    }
    CasePriorityVo vo = new CasePriorityVo();
    BeanUtilEx.copyProperties(vo, po);
    return vo;
}
Also used : CasePriorityVo(com.ngtesting.platform.vo.CasePriorityVo)

Example 8 with CasePriorityVo

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

the class CasePriorityServiceImpl method listVos.

@Override
public List<CasePriorityVo> listVos(Long orgId) {
    List ls = list(orgId);
    List<CasePriorityVo> vos = genVos(ls);
    return vos;
}
Also used : CasePriorityVo(com.ngtesting.platform.vo.CasePriorityVo) List(java.util.List) LinkedList(java.util.LinkedList)

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