use of com.ngtesting.platform.entity.TestMsg in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method create.
@Override
public TestMsg create(TestRun run, Constant.MsgType action, UserVo optUser) {
TestMsg msg = new TestMsg();
msg.setName("用户" + StringUtil.highlightDict(optUser.getName()) + action.msg + "测试集" + StringUtil.highlightDict(run.getName()));
msg.setDescr(run.getDescr());
msg.setUserId(run.getUserId());
msg.setOptUserId(optUser.getId());
saveOrUpdate(msg);
return msg;
}
use of com.ngtesting.platform.entity.TestMsg 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.entity.TestMsg 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.entity.TestMsg in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method delete.
@Override
public void delete(Long msgId, Long userId) {
TestMsg po = (TestMsg) get(TestMsg.class, msgId);
po.setDeleted(true);
saveOrUpdate(po);
}
use of com.ngtesting.platform.entity.TestMsg 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;
}
Aggregations