/** 准备转发微博 */ public String toForward() { try { setWeiboMsg(messageService.getWeiboById(postId)); if (weiboMsg == null) { data.fail(Constant.ResultMessage.FORWARD_FAIL_POST); return SUCCESS; } } catch (Exception e) { data.fail(Constant.ResultMessage.ERROR); logger.error("{}", data.getDesc(), e); } return SUCCESS; }
/** 发微博 */ public String publish() { try { long uid = getUserLaicaiWeiboId(); if (uid < 1) { data.fail(Constant.ResultMessage.PUBLISH_FAIL_LOGIN); logger.info(data.getDesc()); return SUCCESS; } if (weiboMsg == null) { data.fail(Constant.ResultMessage.PUBLISH_FAIL); logger.info(data.getDesc()); return SUCCESS; } weiboMsg.setOwnerId(uid); messageService.publish(weiboMsg); } catch (Exception e) { data.fail(Constant.ResultMessage.PUBLISH_FAIL); logger.error("{}", data.getDesc(), e); } return SUCCESS; }