Search in sources :

Example 6 with TestMsg

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

the class MsgAction method markRead.

@AuthPassport(validate = true)
@RequestMapping(value = "markRead", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> markRead(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");
    TestMsg msg = msgService.markReadPers(id, userVo.getId());
    TestMsgVo vo = msgService.genVo(msg);
    optFacade.opt(WsConstant.WS_TODO, userVo.getId().toString());
    ret.put("data", vo);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : TestMsg(com.ngtesting.platform.entity.TestMsg) UserVo(com.ngtesting.platform.vo.UserVo) TestMsgVo(com.ngtesting.platform.vo.TestMsgVo) 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 TestMsg

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

the class MsgServiceImpl method markReadPers.

@Override
public TestMsg markReadPers(Long id, Long id1) {
    TestMsg po = (TestMsg) get(TestMsg.class, id);
    po.setRead(Boolean.TRUE);
    saveOrUpdate(po);
    return po;
}
Also used : TestMsg(com.ngtesting.platform.entity.TestMsg)

Aggregations

TestMsg (com.ngtesting.platform.entity.TestMsg)7 TestMsgVo (com.ngtesting.platform.vo.TestMsgVo)4 JSONObject (com.alibaba.fastjson.JSONObject)1 AuthPassport (com.ngtesting.platform.util.AuthPassport)1 UserVo (com.ngtesting.platform.vo.UserVo)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 DetachedCriteria (org.hibernate.criterion.DetachedCriteria)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1