/* * 實現(xiàn)朋友圈 點(diǎn)贊 取消點(diǎn)贊 * */ public Long likeComment(String publishId) { User user = UserThreadLocal.get(); //點(diǎn)贊 Boolean result = this.quanZiApi.likeComment(user.getId(), publishId); if(result){ //查詢點(diǎn)贊數(shù) return this.quanZiApi.queryLikeCount(publishId); } return null; } /* * 動態(tài)取消點(diǎn)贊 * * */ public Long disLikeComment(String publishId) { User user = UserThreadLocal.get(); //取消點(diǎn)贊 Boolean result = this.quanZiApi.disLikeComment(user.getId(), publishId); if(result){ //查詢點(diǎn)贊數(shù) return this.quanZiApi.queryLikeCount(publishId); } return null; } /** * 填充 戶信息 * */ private void fillUserInfoToQuanZiVo(UserInfo userInfo, QuanZiVo quanZiVo) { BeanUtil.copyProperties(userInfo, quanZiVo, “id”); quanZiVo.setGender(userInfo.getSex().name().toLowerCase()); quanZiVo.setTags(StringUtils.split(userInfo.getTags(), ‘,’)); //當(dāng)前 戶 User user = UserThreadLocal.get(); quanZiVo.setCommentCount(0); //TODO 評論數(shù) quanZiVo.setDistance(“1.2公 “); //TODO 距離 quanZiVo.setHasLiked(this.quanZiApi.queryUserIsLike(user.getId(), quanZiVo.getId()) ? 1 : 0); //是否點(diǎn)贊(1是,0否) quanZiVo.setLikeCount(Convert.toInt(this.quanZiApi.queryLikeCount(quanZiVo.getId()))); //點(diǎn)贊數(shù) quanZiVo.setHasLoved(0); //TODO 是否喜歡(1是,0否) quanZiVo.setLoveCount(0); //TODO 喜歡數(shù) }}
鄭重聲明:本文內(nèi)容及圖片均整理自互聯(lián)網(wǎng),不代表本站立場,版權(quán)歸原作者所有,如有侵權(quán)請聯(lián)系管理員(admin#wlmqw.com)刪除。
贊 (0)
最前線|比亞迪,市值破萬億
上一篇 2022年6月13日 06:11
未來所有的行業(yè)都值得用數(shù)字化技術(shù)重塑一遍?專家:重新定義網(wǎng)絡(luò)安全
下一篇 2022年6月13日 06:11