| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra;
|
| | |
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void bindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_BIND);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | saveDetail(MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_BIND));
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void unBindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_UNBIND);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | saveDetail(MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_UNBIND));
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void changeBindingSuccess(Long uid, int type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_CHANGE);
|
| | | saveDetail(MsgAccountDetailFactory.createBindSuccess(uid, type, MsgAccountDetailFactory.WAY_CHANGE));
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void taoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | saveDetail(MsgAccountDetailFactory.createBindFail(uid, MsgAccountDetailFactory.TYPE_TB, |
| | | MsgAccountDetailFactory.WAY_CHANGE, reason));
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode) {
|
| | | saveDetail(MsgAccountDetailFactory.createChangeInviteCode(uid, oldCode, newCode));
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,Integer type) {
|
| | | saveDetail( MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,
|
| | | targetNum2, type, null));
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void vipUpgradeSuccess(Long uid, int days) {
|
| | | saveDetail(MsgAccountDetailFactory.vipUpgradeSuccess(uid, days));
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void vipUpgradeFail(Long uid, String reason) {
|
| | | saveDetail(MsgAccountDetailFactory.vipUpgradeFail(uid, reason));
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void teacherInvite(Long uid, String nickname,String kefuName, String kefuWX) {
|
| | | saveDetail(MsgAccountDetailFactory.teacherInvite(uid, nickname, kefuName, kefuWX));
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void teacherSuccess(Long uid, int days, String kefuName, String kefuWX) {
|
| | | saveDetail(MsgAccountDetailFactory.teacherSuccess(uid, days, kefuName, kefuWX));
|
| | | }
|
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private void saveDetail(MsgAccountDetail detail) {
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | |
| | |
|
| | | @Override
|
| | | public void connectSuccess(Long uid, Long lessUid) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createConnectAccount(uid, lessUid);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // TODO Auto-generated method stub
|
| | | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void userRank(Long uid, String orderType, int orderCount, String rankName) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createUserRank(uid, orderType, orderCount, rankName);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | // TODO Auto-generated method stub
|
| | |
|
| | | @Override
|
| | | public void taoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createBindFail(uid, MsgAccountDetailFactory.TYPE_TB, |
| | | MsgAccountDetailFactory.WAY_CHANGE, reason);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void createChangeInviteCode(Long uid, String oldCode, String newCode) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.createChangeInviteCode(uid, oldCode, newCode);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void vipPreUpgrade(Long uid, String originalName, String upName, int days, long targetNum1, Long targetNum2,Integer type) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipPreUpgrade(uid, originalName, upName, days, targetNum1,
|
| | | targetNum2, type, null);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void vipUpgradeSuccess(Long uid, int days) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipUpgradeSuccess(uid, days);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void vipUpgradeFail(Long uid, String reason) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.vipUpgradeFail(uid, reason);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void teacherInvite(Long uid, String nickname,String kefuName, String kefuWX) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.teacherInvite(uid, nickname, kefuName, kefuWX);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void teacherSuccess(Long uid, int days, String kefuName, String kefuWX) {
|
| | | MsgAccountDetail detail = MsgAccountDetailFactory.teacherSuccess(uid, days, kefuName, kefuWX);
|
| | | try {
|
| | | msgAccountDetailService.addMsgAccountDetail(detail);
|
| | | // 消息内容
|
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | } catch (MsgAccountDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|