| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.exception.msg.MsgInviteDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | | public class MsgInviteDetailServiceImpl implements MsgInviteDetailService {
|
| | |
|
| | | @Resource
|
| | | private MsgInviteDetailMapper msgInviteDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addMsgInviteDetail(MsgInviteDetail detail) throws MsgInviteDetailException {
|
| | |
| | | update.setRead(false);
|
| | | msgInviteDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | userMsgReadStateService.addInviteMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<MsgInviteDetail> listMsgInviteDetail(Long uid, int page) {
|
| | | return null;
|
| | | return msgInviteDetailMapper.listByUid(uid, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countMsgInviteDetail(Long uid) {
|
| | | return 0;
|
| | | return msgInviteDetailMapper.countByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void readMsgByUid(Long uid) {
|
| | | msgInviteDetailMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByThreeSale(ThreeSale sale) {
|
| | | if (sale == null)
|
| | | return;
|
| | | msgInviteDetailMapper.deleteByThreeSaleId(sale.getId());
|
| | | }
|
| | |
|
| | | }
|