use of com.ngtesting.platform.vo.TestMsgVo in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method getById.
@Override
public TestMsgVo getById(Long id) {
TestMsg po = (TestMsg) get(TestMsg.class, id);
TestMsgVo vo = genVo(po);
return vo;
}
use of com.ngtesting.platform.vo.TestMsgVo in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method list.
@Override
public List<TestMsgVo> list(Long userId, Boolean isRead) {
DetachedCriteria dc = DetachedCriteria.forClass(TestMsg.class);
dc.add(Restrictions.eq("userId", userId));
if (isRead != null) {
dc.add(Restrictions.eq("isRead", isRead));
}
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.desc("createTime"));
List<TestMsg> pos = findAllByCriteria(dc);
List<TestMsgVo> vos = genVos(pos);
return vos;
}
use of com.ngtesting.platform.vo.TestMsgVo in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method genVos.
@Override
public List<TestMsgVo> genVos(List<TestMsg> pos) {
List<TestMsgVo> vos = new LinkedList<>();
for (TestMsg po : pos) {
TestMsgVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.vo.TestMsgVo 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;
}
use of com.ngtesting.platform.vo.TestMsgVo in project ngtesting-platform by aaronchen2k.
the class MsgAction 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>();
Long msgId = json.getLong("id");
TestMsgVo vo = msgService.getById(msgId);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations