Commit 1bd75841 authored by 吴泽佳's avatar 吴泽佳
parents 4961ff7c 1bc324ab
......@@ -20,4 +20,7 @@ public final class CommunityConstant {
public static final String OSS_PREFIX_FOLDER ="community/";
//图片压缩比例:50%
public static final String OSS_RESIZE_RATIO = "?x-oss-process=image/resize,p_50";
}
......@@ -50,11 +50,23 @@ public class ThemeAnalysDO {
private Double userWeight = 0.0;
public Double getRank() {
double viewRatio = 0.1;
double forwardRatio = 3;
double commentRatio = 2;
double likeRation = 1;
double collectRatio = 3;
double userWeightRatio = 0.8;
double initialWeight = 1.0;
double timeRation = 0.3;
// 质量=帖子质量+用户质量
double w = (double) (viewCount * 0.1 + forwardCount * 3 + commentCount * 2 + likeCount * 1 + collectCount * 3) + userWeight;
double i = 1; // 初始权重
double w = viewCount * viewRatio + forwardCount * forwardRatio + commentCount * commentRatio
+ likeCount * likeRation + collectCount * collectRatio
+ Math.pow(userWeight, userWeightRatio);
double i = initialWeight; // 初始权重
double t = Double.valueOf(minuteTillNow) / 60;
double g = 0.1; // 时间系数
double g = timeRation; // 时间系数
return (w + i) / Math.pow(t + 1, g);
}
......
......@@ -10,11 +10,11 @@ import lombok.Data;
public class QueryFollowReq {
@ApiModelProperty(value = "用户Id")
private String userId;
public String userId;
@ApiModelProperty(value = "查询类型,1:粉丝 2:关注")
private Integer queryType;
public Integer queryType;
@ApiModelProperty(value = "分页")
private Pageable page;
public Pageable page;
}
......@@ -22,6 +22,9 @@ public class ImagesDTO {
@ApiModelProperty("图片url")
private String remark;
@ApiModelProperty("压缩图片url")
private String resizeUrl;
@ApiModelProperty("图片宽度")
private Integer imgHeight;
......
......@@ -2,32 +2,12 @@ package com.tanpu.community.api.constants;
public class RedisKeyConstant {
//话题页浏览量
public static final String TOPIC_PAGE_VIEW_COUNT_ ="TOPIC_PAGE_VIEW_COUNT_";
//话题总浏览量=总浏览量+带这个话题的帖子量
public static final String TOPIC_TOTAL_VIEW_COUNT_="TOPIC_TOTAL_VIEW_COUNT_";
//点赞量
public static final String TOPIC_LIKE_COUNT_="TOPIC_LIKE_COUNT_";
public static final String THEME_LIKE_COUNT ="THEME_LIKE_COUNT_";
//收藏量
public static final String TOPIC_BOOK_COUNT_="TOPIC_BOOK_COUNT_";
//用户数
public static final String TOPIC_USER_COUNT_="TOPIC_USER_COUNT_";
public static final String THEME_COMMENT_COUNT ="THEME_COMMENT_COUNT_";
//讨论量=发布主题贴数+回复总数
public static final String TOPIC_DISCUSS_COUNT_="TOPIC_DISCUSS_COUNT_";
//发帖数
public static final String TOPIC_THEME_COUNT_="TOPIC_THEME_COUNT_";
//回帖数
public static final String TOPIC_COMMENT_COUNT_="TOPIC_COMMENT_COUNT_";
//总用户数=访问话题页+发帖+回帖(去重)
public static final String TOPIC_TOTAL_USER_COUNT_ ="TOPIC_TOTAL_USER_COUNT_";
//访问话题人数
public static final String TOPIC_USER_VIEW_COUNT_="TOPIC_USER_VIEW_COUNT_";
//发帖人数
public static final String TOPIC_POST_USER_COUNT_ ="TOPIC_POST_USER_COUNT_";
//回帖人数
public static final String TOPIC_COMMENT_USER_COUNT_ ="TOPIC_COMMENT_USER_COUNT_";
// 出现在用户的搜索列表中的主题id
public static final String THEME_APPEAR_IN_SEARCH_LIST = "THEME_APPEAR_IN_SEARCH_LIST_";
public static final String THEME_FORWARD_COUNT ="THEME_FORWARD_COUNT_";
// feign 查询用户信息
public static final String CACHE_FEIGN_USER_INFO = "CACHE_FEIGN_USER_INFO_";
......@@ -38,12 +18,9 @@ public class RedisKeyConstant {
// 主题本身
public static final String CACHE_THEME_ID = "CACHE_THEME_ID_";
// 转发主题本身
public static final String CACHE_FORMER_THEME_ID = "CACHE_FORMER_THEME_ID_";
public static final String CACHE_FORWARD_THEME_ID = "CACHE_FORWARD_THEME_ID_";
// 关注的人,上次浏览的最新主题last id
public static final String CACHE_IDOL_THEME_LAST_ID = "CACHE_IDOL_THEME_LAST_ID_";
public static final String THEME_VIEW_COUNT_="THEME_VIEW_COUNT_";
public static final String THEME_LIKE_COUNT_="THEME_LIKE_COUNT_";
public static final String THEME_BOOK_COUNT_="THEME_BOOK_COUNT_";
}
......@@ -78,6 +78,7 @@ public class HomePageController {
@PostMapping(value = "/addIdol")
@ApiOperation("关注/取消关注他人")
@ResponseBody
@AuthLogin
public CommonResp addIdol(@RequestBody FollowRelReq req) {
String userId = userHolder.getUserId();
homePageManager.addFollowRel(req, userId);
......
......@@ -31,7 +31,7 @@ public class TopicController {
@PostMapping(value = "/list")
@ApiOperation("APP全部话题页面,可搜索")
@ResponseBody
public CommonResp<Page<TopicRankQo>> getTopicBriefInfoList(@RequestBody TopicSearchReq req){
public CommonResp<Page<TopicRankQo>> getTopicList(@RequestBody TopicSearchReq req){
return CommonResp.success(topicManager.getAllTopicBriefInfo(req));
}
......@@ -39,7 +39,7 @@ public class TopicController {
@GetMapping(value = "/detailPage")
@ApiOperation("话题详情页顶部")
@ResponseBody
public CommonResp<TopicRankQo> gethotThemes(@RequestParam String topicId){
public CommonResp<TopicRankQo> getDetail(@RequestParam String topicId){
return CommonResp.success(topicManager.getDetail(topicId));
}
......@@ -47,7 +47,7 @@ public class TopicController {
@GetMapping(value = "/titleList")
@ApiOperation("首页顶部话题标题列")
@ResponseBody
public CommonResp<List<TopicRankQo>> getTitleList(){
public CommonResp<List<TopicRankQo>> getTop4Topic(){
return CommonResp.success(topicManager.getTop4TopicTitles());
}
......
......@@ -53,6 +53,9 @@ public class CommentManager {
// 发表评论(对主题)
public void comment(CreateCommentReq req, String userId) {
if (StringUtils.isEmpty(req.getComment())) {
throw new IllegalArgumentException("评论内容不能为空");
}
if (req.getComment().length()>500){
throw new IllegalArgumentException("评论内容不能超过500字");
}
......
package com.tanpu.community.manager;
import com.tanpu.community.service.RankService;
import com.tanpu.community.service.RecommendService;
import com.tanpu.community.service.RedisService;
import com.tanpu.community.service.VisitLogService;
import lombok.extern.slf4j.Slf4j;
......@@ -23,6 +24,9 @@ public class ConJobManager {
@Autowired
private RankService rankService;
@Autowired
private RecommendService recommendService;
/**
* 定时统计 话题 访问数据,并刷到redis
*/
......@@ -36,9 +40,17 @@ public class ConJobManager {
/**
* 定时统计主题、话题排行
*/
@Scheduled(cron = "0 */2 * * * ?")
@Scheduled(cron = "*/30 * * * * ?")
public void themeRank() {
rankService.rankThemes();
rankService.rankTopics();
}
/**
* 定时统计主题、话题排行
*/
@Scheduled(cron = "*/5 * * * * ?")
public void getThemeNewest() {
recommendService.refreshNewestThemes();
}
}
......@@ -59,7 +59,8 @@ public class HomePageManager {
//查询 个人中心 相关信息
public UserInfoResp queryUsersInfo(String userIdMyself, String userId) {
CommonResp<UserInfoResp> queryUsersListNew = feignClientForFatools.queryUsersListNew(StringUtils.isNotBlank(userId) ? userId : userIdMyself);
if (queryUsersListNew.isNotSuccess() || !ObjectUtils.anyNotNull(queryUsersListNew.getData())) throw new BizException("内部接口调用失败");
if (queryUsersListNew.isNotSuccess() || !ObjectUtils.anyNotNull(queryUsersListNew.getData()))
throw new BizException("内部接口调用失败");
UserInfoResp userInfoNew = queryUsersListNew.getData();
if (StringUtils.isNotBlank(userId) && !StringUtils.equals(userIdMyself, userId)) { //查询别人的个人主页
......@@ -95,7 +96,7 @@ public class HomePageManager {
}
// 查询首席投顾数量
CommonResp<Page<UserInfoNewChief>> pageCommonResp = feignClientForFatools.queryChiefFinancialAdviserList(1, 1);
if (pageCommonResp.isSuccess()){
if (pageCommonResp.isSuccess()) {
userInfoNew.getUserInfoNewChief().setChiefCount(pageCommonResp.getData().getTotalSize());
} else {
userInfoNew.getUserInfoNewChief().setChiefCount(0L);
......@@ -181,28 +182,32 @@ public class HomePageManager {
/**
* 用户关注列表
* @param req 目标用户
*
* @param req 目标用户
* @param userId 当前用户
* @return
*/
public Page<FollowQo> queryFollow(QueryFollowReq req, String userId) {
//TODO 数据库分页
List<String> userIds = QueryFollowTypeEnum.QUERY_FANS.getCode().equals(req.getQueryType()) ?
followRelService.queryFansByIdolId(req.getUserId()) : followRelService.queryIdolsByFollowerId(req.getUserId());
//数据库分页
Integer pageSize = req.page.pageSize;
Integer pageNumber = req.page.pageNumber;
Page<String> userIdsPage = QueryFollowTypeEnum.QUERY_FANS.getCode().equals(req.getQueryType()) ?
followRelService.queryFansByIdolId(req.userId, pageNumber, pageSize)
: followRelService.queryIdolsByFansId(req.userId, pageNumber, pageSize);
List<FollowQo> followQos = new ArrayList<>();
if (!CollectionUtils.isEmpty(userIds)) {
List<UserInfoResp> userInfoNews = feignClientForFatools.queryUserListNew(userIds);
if (!CollectionUtils.isEmpty(userIdsPage.getContent())) {
List<UserInfoResp> userInfoNews = feignClientForFatools.queryUserListNew(userIdsPage.getContent());
List<FollowQo> collect = userInfoNews.stream().map(ConvertUtil::userInfoNew2FollowQo).collect(Collectors.toList());
followQos = judgeFollowed(collect, userId);
}
//分页
return PageUtils.page(req.getPage(), followQos);
return PageUtils.page(userIdsPage,followQos);
}
//判断返回列表中的用户是否被当前用户关注
public List<FollowQo> judgeFollowed(List<FollowQo> followQos, String followerId) {
Set<String> idolSet = new HashSet<>(followRelService.queryIdolsByFollowerId(followerId));
Set<String> idolSet = new HashSet<>(followRelService.queryIdolsByFansId(followerId));
return followQos.stream().map(o -> {
if (idolSet.contains(o.getUserId())) {
o.setFollowed(true);
......
......@@ -160,6 +160,10 @@ public class ThemeManager {
*/
@Transactional
public CreateThemeResp publishTheme(CreateThemeReq req, String userId) {
if (CollectionUtils.isEmpty(req.getContent())) {
throw new BizException("正文内容不能为空");
}
// 保存主题表
ThemeEntity themeEntity = new ThemeEntity();
BeanUtils.copyProperties(req, themeEntity);
......@@ -171,13 +175,14 @@ public class ThemeManager {
//附件校验
checkAttachment(req.getContent());
if (StringUtils.isEmpty(req.getEditThemeId())) {
if (StringUtils.isBlank(req.getEditThemeId())) {
// 新建
themeService.insertTheme(themeEntity);
} else {
// 修改
themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
this.evictThemeCache(req.getEditThemeId());
}
// 保存附件表
List<ThemeAttachmentEntity> themeAttachments = ConvertUtil.themeReqToAttachmentList(req, themeEntity.getThemeId());
......@@ -218,7 +223,6 @@ public class ThemeManager {
// 转发主题
public CreateThemeResp forward(ForwardThemeReq req, String userId) {
ThemeEntity targetTheme = themeService.queryByThemeId(req.getFormerThemeId());
ThemeEntity themeEntity = ThemeEntity.builder()
.content(JsonUtil.toJson(req.getContent()))
.topicId(req.getTopicId())
......@@ -227,13 +231,14 @@ public class ThemeManager {
.themeType(ThemeTypeEnum.FORWARD.getCode())
.build();
if (StringUtils.isEmpty(req.getEditThemeId()) || req.getEditThemeId().equals(req.getFormerThemeId())) {
if (StringUtils.isBlank(req.getEditThemeId()) || req.getEditThemeId().equals(req.getFormerThemeId())) {
// 新建
themeService.insertTheme(themeEntity);
} else {
// 修改
themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
this.evictThemeCache(req.getEditThemeId());
}
try {
......@@ -241,6 +246,8 @@ public class ThemeManager {
} catch (Exception e) {
log.error("error in save theme to ES. themeId:{}, error:{}", themeEntity.getThemeId(), ExceptionUtils.getStackTrace(e));
}
//失效缓存
redisCache.evict(StringUtils.joinWith("_", THEME_FORWARD_COUNT, themeEntity.getThemeId()));
return CreateThemeResp.builder().themeId(themeEntity.getThemeId()).build();
}
......@@ -278,7 +285,7 @@ public class ThemeManager {
} else if (ThemeListTypeEnum.FOLLOW.getCode().equals(req.getType())) {
// 根据关注列表查询,按时间倒序
List<String> fansList = followRelService.queryIdolsByFollowerId(userId);
List<String> fansList = followRelService.queryIdolsByFansId(userId);
themes = themeService.queryByUserIdsCreateDesc(fansList, pageStart, pageSize);
if (CollectionUtils.isEmpty(excludeIds) && !themes.isEmpty()) {
......@@ -340,13 +347,21 @@ public class ThemeManager {
private void buildThemeQoExtraInfo(ThemeQo themeQo) {
String themeId = themeQo.getThemeId();
// 封装转发对象
FormerThemeQo former = redisCache.getObject(StringUtils.joinWith("_", CACHE_FORMER_THEME_ID, themeId), 60,
FormerThemeQo former = redisCache.getObject(StringUtils.joinWith("_", CACHE_FORWARD_THEME_ID, themeQo.getFormerThemeId()), 60,
() -> this.getFormerTheme(themeQo.getFormerThemeId()), FormerThemeQo.class);
themeQo.setFormerTheme(former);
// 点赞,收藏,转发
Integer likeCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME);
Integer commentCount = commentService.getCommentCountByThemeId(themeId);
Integer forwardCount = themeService.getForwardCountById(themeId);
Integer likeCount = redisCache.getObject(StringUtils.joinWith("_", THEME_LIKE_COUNT, themeId), 60,
() -> collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME), Integer.class);
Integer commentCount = redisCache.getObject(StringUtils.joinWith("_", THEME_COMMENT_COUNT, themeId), 60,
() -> commentService.getCommentCountByThemeId(themeId), Integer.class);
Integer forwardCount = redisCache.getObject(StringUtils.joinWith("_", THEME_FORWARD_COUNT, themeId), 60,
() -> themeService.getForwardCountById(themeId), Integer.class);
themeQo.setCommentCount(commentCount);
themeQo.setLikeCount(likeCount);
themeQo.setForwardCount(forwardCount);
......@@ -358,12 +373,12 @@ public class ThemeManager {
// 是否关注作者
themeQo.setFollow(followRelService.checkFollow(themeQo.getAuthorId(), userId));
// 是否点赞
CollectionEntity likeEntity = collectionService.getTarget(themeId, userId, CollectionTypeEnum.LIKE_THEME);
CollectionEntity likeEntity = collectionService.queryCollection(themeId, userId, CollectionTypeEnum.LIKE_THEME);
themeQo.setHasLiked(likeEntity != null);
// 是否转发
themeQo.setHasForward(themeService.judgeForwardByUser(themeId, userId));
// 是否收藏
CollectionEntity collectionEntity = collectionService.getTarget(themeId, userId, CollectionTypeEnum.COLLECT_THEME);
CollectionEntity collectionEntity = collectionService.queryCollection(themeId, userId, CollectionTypeEnum.COLLECT_THEME);
themeQo.setHasCollect(collectionEntity != null);
}
......@@ -371,7 +386,7 @@ public class ThemeManager {
private void buildThemeExtraInfoByUser(String userId, List<ThemeQo> themeQos) {
// 批量查询
List<String> themeIds = themeQos.stream().map(ThemeQo::getThemeId).collect(Collectors.toList());
Set<String> idolSet = new HashSet<>(followRelService.queryIdolsByFollowerId(userId));
Set<String> idolSet = new HashSet<>(followRelService.queryIdolsByFansId(userId));
Set<String> likeSet = collectionService.getTargets(themeIds, userId, CollectionTypeEnum.LIKE_THEME);
Set<String> bookSet = collectionService.getTargets(themeIds, userId, CollectionTypeEnum.COLLECT_THEME);
Set<String> forwardUsers = themeService.getForwardUsers(themeIds);
......@@ -386,8 +401,9 @@ public class ThemeManager {
/**
* 返回用户发布、回复、点赞、收藏的主题列表
* @param req 查询用户
* @param userId 当前用户
*
* @param req 查询用户
* @param userId 当前用户
* @return
*/
public List<ThemeQo> queryThemesByUser(QueryRecordThemeReq req, String userId) {
......@@ -395,19 +411,19 @@ public class ThemeManager {
List<ThemeEntity> themeEntities = Collections.emptyList();
switch (req.getRecordType()) {
case 1://发布
themeEntities = themeService.queryThemesByUserId(req.getUserId(), req.getLastId(), req.getPageSize());
themeEntities = themeService.queryThemesByUserIdCreateDesc(req.getUserId(), req.getLastId(), req.getPageSize());
break;
case 2://回复
List<ThemeQo> commentThemeList = getCommentThemeQos(req, userId);
return commentThemeList;
case 3://点赞
List<String> likeThemeIds = collectionService.getListByUser(req.getUserId(), CollectionTypeEnum.LIKE_THEME);
themeEntities = themeService.queryByThemeIds(likeThemeIds, req.getLastId(), req.getPageSize());
List<String> likeThemeIds = collectionService.getListByUser(req.getUserId(), CollectionTypeEnum.LIKE_THEME, req.getLastId(), req.getPageSize());
themeEntities = themeService.queryByThemeIds(likeThemeIds);
themeEntities = RankUtils.sortThemeEntityByIds(themeEntities, likeThemeIds);
break;
case 4://收藏
List<String> collectThemeIds = collectionService.getListByUser(req.getUserId(), CollectionTypeEnum.COLLECT_THEME);
List<String> collectThemeIds = collectionService.getListByUser(req.getUserId(), CollectionTypeEnum.COLLECT_THEME, req.getLastId(), req.getPageSize());
themeEntities = themeService.queryByThemeIds(collectThemeIds, req.getLastId(), req.getPageSize());
themeEntities = RankUtils.sortThemeEntityByIds(themeEntities, collectThemeIds);
break;
......@@ -421,7 +437,7 @@ public class ThemeManager {
throw new BizException("内部接口调用失败");
}
UserInfoResp user = userInfoNewCommonResp.getData();
themeQos.stream().forEach(o->reBuildAuthorInfo(o,user));
themeQos.stream().forEach(o -> reBuildAuthorInfo(o, user));
redisCache.put(StringUtils.joinWith("_", CACHE_FEIGN_USER_INFO, userId), user, 60);
}
......@@ -463,6 +479,8 @@ public class ThemeManager {
} else if (OperationTypeEnum.CANCEL.getCode().equals(req.getType())) {
collectionService.delete(req.getThemeId(), userId, CollectionTypeEnum.LIKE_THEME);
}
//失效缓存
redisCache.evict(StringUtils.joinWith("_", THEME_LIKE_COUNT, req.getThemeId()));
}
......@@ -490,7 +508,7 @@ public class ThemeManager {
public Integer getFollowUpdateCount(String userId) {
String lastIdStr = redisCache.get(CACHE_IDOL_THEME_LAST_ID + userId);
Long lastId = StringUtils.isBlank(lastIdStr) ? 0L : Long.parseLong(lastIdStr);
List<String> fansList = followRelService.queryIdolsByFollowerId(userId);
List<String> fansList = followRelService.queryIdolsByFansId(userId);
return themeService.queryCountFromLastId(fansList, lastId);
}
......@@ -505,7 +523,7 @@ public class ThemeManager {
//返回被转发主题
private FormerThemeQo getFormerTheme(String formerThemeId) {
if (StringUtils.isNotEmpty(formerThemeId)) {
if (StringUtils.isNotBlank(formerThemeId)) {
ThemeQo formerTheme = ConvertUtil.themeEntityToQo(themeService.queryByThemeId(formerThemeId));
if (formerTheme != null) {
batchFeignCallService.getAttachDetail(formerTheme);
......@@ -521,6 +539,8 @@ public class ThemeManager {
// 逻辑删除主题,校验用户
public void delete(String themeId, String userId) {
themeService.deleteById(themeId, userId);
this.evictThemeCache(themeId);
}
......@@ -531,7 +551,7 @@ public class ThemeManager {
*/
private void checkContent(CreateThemeReq req) {
if (ThemeTypeEnum.LONG_TEXT.getCode().equals(req.getThemeType()) && req.getTitle().length()>50){
if (ThemeTypeEnum.LONG_TEXT.getCode().equals(req.getThemeType()) && req.getTitle().length() > 50) {
throw new IllegalArgumentException("长文标题不能超过50字");
}
......@@ -545,12 +565,12 @@ public class ThemeManager {
// 腾讯云接口最多支持5000文字校验
// 检查内容是否涉黄违法
boolean b;
while (content.length()>5000){
while (content.length() > 5000) {
b = TencentcloudUtils.textModeration(content.substring(0, 5000));
if (!b) {
throw new BizException(ErrorCodeConstant.CONTENT_ILLEGAL);
}
content=content.substring(5000);
content = content.substring(5000);
}
b = TencentcloudUtils.textModeration(content);
if (!b) {
......@@ -653,7 +673,7 @@ public class ThemeManager {
return userInfoNewCommonResp.getData();
}
private void reBuildAuthorInfo(ThemeQo themeQo,UserInfoResp userInfo){
private void reBuildAuthorInfo(ThemeQo themeQo, UserInfoResp userInfo) {
themeQo.setNickName(userInfo.getNickName());
themeQo.setUserImg(userInfo.getHeadImageUrl());
themeQo.setUserIntroduction(userInfo.getIntroduction());
......@@ -669,4 +689,9 @@ public class ThemeManager {
themeQo.setWorkshopIntroduction(userInfo.getWorkshopIntroduction());
}
private void evictThemeCache(String themeId){
redisCache.evict(StringUtils.joinWith("_", CACHE_FORWARD_THEME_ID, themeId));
redisCache.evict(StringUtils.joinWith("_", CACHE_THEME_ID, themeId));
}
}
package com.tanpu.community.manager;
import com.tanpu.common.auth.UserHolder;
import com.tanpu.common.constant.ErrorCodeConstant;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.qo.TopicRankQo;
import com.tanpu.community.api.beans.req.page.Page;
import com.tanpu.community.api.beans.req.topic.TopicSearchReq;
import com.tanpu.community.dao.entity.community.TopicEntity;
import com.tanpu.community.service.RankService;
import com.tanpu.community.service.TopicService;
import com.tanpu.community.service.VisitLogService;
import com.tanpu.community.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import static com.tanpu.biz.common.enums.clue.PageEnum.COMM_VISIT_TOPIC_DETAIL;
@Service
public class TopicManager {
@Autowired
private VisitLogService visitLogService;
private TopicService topicService;
@Autowired
private RankService rankService;
@Resource
private UserHolder userHolder;
// 首页-话题标签
......@@ -43,10 +39,11 @@ public class TopicManager {
}
// 话题详情页
public TopicRankQo getDetail(String topicId) {
//TODO 临时埋点,接入新埋点后删除
visitLogService.addPageView(userHolder.getUserId(), topicId, COMM_VISIT_TOPIC_DETAIL);
TopicEntity topicEntity = topicService.queryById(topicId);
if (topicEntity==null){
throw new BizException(ErrorCodeConstant.TOPIC_NOT_FOUND);
}
return rankService.getTopicDetail(topicId);
}
......
......@@ -7,6 +7,7 @@ import com.tanpu.biz.common.enums.user.UserLevelEnum;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.enums.fund.ProductTypeEnum;
import com.tanpu.common.util.JsonUtil;
import com.tanpu.community.api.CommunityConstant;
import com.tanpu.community.api.beans.qo.AttachmentDetailVo;
import com.tanpu.community.api.beans.qo.ThemeContentQo;
import com.tanpu.community.api.beans.qo.ThemeQo;
......@@ -258,10 +259,10 @@ public class BatchFeignCallService {
Set<String> ifaFundIds,
Set<String> notNetFundIds,
Map<String, FundInfoBaseResp> fundMap) {
Map<String, FundInfoBaseResp> tampFundMap = null;
Map<String, FundInfoBaseResp> privateFundMap = null;
Map<String, FundInfoBaseResp> publicFundMap = null;
Map<String, FundInfoBaseResp> ifaFundMap = null;
Map<String, FundInfoBaseResp> tampFundMap;
Map<String, FundInfoBaseResp> privateFundMap;
Map<String, FundInfoBaseResp> publicFundMap;
Map<String, FundInfoBaseResp> ifaFundMap;
Map<String, FundInfoBaseResp> notNetFundMap = null;
if (!CollectionUtils.isEmpty(tanpuFundIds)) {
// ProductListReq productListReq = ProductListReq.builder()
......@@ -276,7 +277,7 @@ public class BatchFeignCallService {
}).collect(Collectors.toList());
tampFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
if (tampFundMap != null && tampFundMap.size() > 0) {
if (tampFundMap.size() > 0) {
fundMap.putAll(tampFundMap);
}
}
......@@ -291,7 +292,7 @@ public class BatchFeignCallService {
}).collect(Collectors.toList());
privateFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
if (privateFundMap != null && privateFundMap.size() > 0) {
if (privateFundMap.size() > 0) {
fundMap.putAll(privateFundMap);
}
}
......@@ -307,7 +308,7 @@ public class BatchFeignCallService {
ifaFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
if (ifaFundMap != null && ifaFundMap.size() > 0) {
if (ifaFundMap.size() > 0) {
fundMap.putAll(ifaFundMap);
}
}
......@@ -322,7 +323,7 @@ public class BatchFeignCallService {
}).collect(Collectors.toList());
publicFundMap = fundInfoBaseRespList.stream().collect(Collectors.toMap(FundInfoBaseResp::getFundId, item -> item));
if (publicFundMap != null && publicFundMap.size() > 0) {
if (publicFundMap.size() > 0) {
fundMap.putAll(publicFundMap);
}
}
......@@ -427,19 +428,20 @@ public class BatchFeignCallService {
//单图封装到imglist列表中
if (imgUrlMap.containsKey(themeContent.getValue())) {
FileRecordEntity imgEntity = imgUrlMap.get(themeContent.getValue());
String extInfo = imgEntity.getExtInfo();
if (!StringUtils.isEmpty(extInfo)) {
Map<String, Object> extMap = JsonUtil.toMap(extInfo);
if (imgEntity!=null && !StringUtils.isEmpty(imgEntity.getExtInfo())) {
Map<String, Object> extMap = JsonUtil.toMap(imgEntity.getExtInfo());
ImagesDTO imagesDTO = ImagesDTO.builder().imgHeight((Integer) extMap.get("height"))
.imgWidth((Integer) extMap.get("width"))
.remark(imgEntity.getUrl())
.relId(imgEntity.getFileId())
//压缩图片
.resizeUrl(imgEntity.getUrl() + CommunityConstant.OSS_RESIZE_RATIO)
.build();
themeContent.setImgList(Collections.singletonList(imagesDTO));
}
}
} else if (themeContent.getType().equals(RelTypeEnum.MULTIPLE_IMAGE.type)) {
//多图写入图片宽高
//多图写入图片宽高,压缩图片url
List<ImagesDTO> imgList = themeContent.getImgList();
for (ImagesDTO imagesDTO : imgList) {
if (imgUrlMap.containsKey(imagesDTO.getRelId())) {
......@@ -450,6 +452,8 @@ public class BatchFeignCallService {
imagesDTO.setImgHeight((Integer) extMap.get("height"));
imagesDTO.setImgWidth((Integer) extMap.get("width"));
}
//压缩图片地址
imagesDTO.setResizeUrl(imgEntity.getUrl() + CommunityConstant.OSS_RESIZE_RATIO);
}
}
......
......@@ -7,12 +7,18 @@ import com.tanpu.community.dao.entity.community.CollectionEntity;
import com.tanpu.community.dao.entity.community.TimesCountEntity;
import com.tanpu.community.dao.mapper.community.CollectionMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service
......@@ -48,7 +54,7 @@ public class CollectionService {
//根据用户、主题、类型查询未删除对象
public CollectionEntity getTarget(String targetId, String userId, CollectionTypeEnum type) {
public CollectionEntity queryCollection(String targetId, String userId, CollectionTypeEnum type) {
LambdaQueryWrapper<CollectionEntity> queryWrapper = new LambdaQueryWrapper<CollectionEntity>()
.eq(CollectionEntity::getCollectionType, type.getCode())
.eq(CollectionEntity::getUserId, userId)
......@@ -57,6 +63,15 @@ public class CollectionService {
return collectionMapper.selectOne(queryWrapper);
}
//根据用户、主题、类型查询未删除对象
public CollectionEntity queryIncludeDelete(String targetId, String userId, CollectionTypeEnum type) {
LambdaQueryWrapper<CollectionEntity> queryWrapper = new LambdaQueryWrapper<CollectionEntity>()
.eq(CollectionEntity::getCollectionType, type.getCode())
.eq(CollectionEntity::getUserId, userId)
.eq(CollectionEntity::getTargetId, targetId);
return collectionMapper.selectOne(queryWrapper);
}
//根据用户、主题、类型查询未删除对象
public Set<String> getTargets(List<String> targetIds, String userId, CollectionTypeEnum type) {
if (CollectionUtils.isEmpty(targetIds)){
......@@ -91,6 +106,27 @@ public class CollectionService {
.stream().map(CollectionEntity::getTargetId).collect(Collectors.toList());
}
// 根据用户id和行为type获取target_id列表
public List<String> getListByUser(String userId, CollectionTypeEnum type,String lastId,Integer pageSize) {
LambdaQueryWrapper<CollectionEntity> queryWrapper = new LambdaQueryWrapper<CollectionEntity>()
.eq(CollectionEntity::getUserId, userId)
.eq(CollectionEntity::getCollectionType, type.getCode())
.eq(CollectionEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode())
.orderByDesc(CollectionEntity::getCollectionTime);
if (StringUtils.isNotEmpty(lastId)) {
CollectionEntity target = queryIncludeDelete(lastId, userId, type);
if (target == null) return Collections.emptyList();
queryWrapper.lt(CollectionEntity::getCollectionType, target.getCollectionTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
return collectionMapper.selectList(queryWrapper)
.stream().map(CollectionEntity::getTargetId).collect(Collectors.toList());
}
// 统计单个对象(主题、评论)的数量(点赞、收藏)
public Integer getCountByTypeAndId(String targetId, CollectionTypeEnum type) {
......@@ -123,7 +159,7 @@ public class CollectionService {
//逻辑删除,修改delete_tag
@Transactional
public void delete(String themeId, String userId, CollectionTypeEnum type) {
CollectionEntity queryCollection = getTarget(themeId, userId, type);
CollectionEntity queryCollection = queryCollection(themeId, userId, type);
if (queryCollection != null) {
queryCollection.setDeleteTag(DeleteTagEnum.DELETED.getCode());
queryCollection.setUncollectionTime(LocalDateTime.now());
......
......@@ -109,7 +109,7 @@ public class CommentService {
CommentEntity commentEntity = commentMapper.selectOne(new LambdaQueryWrapper<CommentEntity>()
.eq(CommentEntity::getCommentId, lastId));
if (commentEntity == null) throw new BizException("评论未找到,id:" + lastId);
queryWrapper.lt(CommentEntity::getUpdateTime, commentEntity.getCreateTime());
queryWrapper.lt(CommentEntity::getCreateTime, commentEntity.getCreateTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
......@@ -145,8 +145,12 @@ public class CommentService {
// 失效关联主题缓存
private void evictThemeCache(String themeId){
// 评论内容
redisCache.evict(StringUtils.joinWith("_", CACHE_COMMENT_THEMEID, themeId));
// 主题内容
redisCache.evict(StringUtils.joinWith("_", CACHE_THEME_ID, themeId));
// 评论数
redisCache.evict(StringUtils.joinWith("_", THEME_LIKE_COUNT, themeId));
}
}
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.constant.BizStatus;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.req.page.Page;
import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.dao.entity.community.FollowRelEntity;
import com.tanpu.community.dao.mapper.community.FollowRelMapper;
......@@ -21,7 +23,7 @@ public class FollowRelService {
@Resource
private FollowRelMapper followRelMapper;
public List<String> queryIdolsByFollowerId(String followerId) {
public List<String> queryIdolsByFansId(String followerId) {
return followRelMapper.selectList(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getFansId, followerId)
.eq(FollowRelEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode()))
......@@ -29,19 +31,55 @@ public class FollowRelService {
.collect(Collectors.toList());
}
// @Cacheable(value = "tempCache", keyGenerator = "communityKeyGenerator")
public List<String> queryFansByIdolId(String idolId) {
public Page<String> queryIdolsByFansId(String fansId, Integer pageNum, Integer pageSize) {
Integer pageStart = (pageNum - 1) * pageSize;
List<FollowRelEntity> idols = followRelMapper.selectList(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getFansId, fansId)
.last("limit " + pageStart + ", " + pageSize)
.eq(FollowRelEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode()));
List<String> list = idols.stream().map(FollowRelEntity::getIdolId)
.collect(Collectors.toList());
Integer totalSize = followRelMapper.selectCount(new LambdaQueryWrapper<FollowRelEntity>().eq(FollowRelEntity::getFansId,fansId)
.eq(FollowRelEntity::getDeleteTag, BizStatus.DeleteTag.tag_init));
Page<String> tPage = new Page<>(pageNum, pageSize, (long) totalSize, 0, list);
int totalPage = list.size() / pageSize;
if (list.size() % pageSize == 0) {
tPage.setTotalPages(totalPage);
} else {
tPage.setTotalPages(totalPage + 1);
}
return tPage;
}
public Page<String> queryFansByIdolId(String idolId, Integer pageNum, Integer pageSize) {
Integer pageStart = (pageNum - 1) * pageSize;
LambdaQueryWrapper<FollowRelEntity> queryWrapper = new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getIdolId, idolId)
.last("limit " + pageStart + ", " + pageSize)
.eq(FollowRelEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return followRelMapper.selectList(queryWrapper)
List<String> list = followRelMapper.selectList(queryWrapper)
.stream().map(FollowRelEntity::getFansId).collect(Collectors.toList());
// 分页
Integer totalSize = followRelMapper.selectCount(new LambdaQueryWrapper<FollowRelEntity>().eq(FollowRelEntity::getIdolId, idolId)
.eq(FollowRelEntity::getDeleteTag, BizStatus.DeleteTag.tag_init));
Page<String> tPage = new Page<>(pageNum, pageSize, (long) totalSize, 0, list);
int totalPage = list.size() / pageSize;
if (list.size() % pageSize == 0) {
tPage.setTotalPages(totalPage);
} else {
tPage.setTotalPages(totalPage + 1);
}
return tPage;
}
@Transactional
public void addFollowRel(String idolId, String followerId) {
FollowRelEntity searchResult = queryRecord(idolId, followerId);
if (searchResult==null){
if (searchResult == null) {
FollowRelEntity entity = FollowRelEntity.builder()
.idolId(idolId)
.fansId(followerId)
......@@ -49,7 +87,7 @@ public class FollowRelService {
.build();
followRelMapper.insert(entity);
}else {
} else {
searchResult.setFollowTime(LocalDateTime.now());
searchResult.setDeleteTag(DeleteTagEnum.NOT_DELETED.getCode());
followRelMapper.updateById(searchResult);
......@@ -59,13 +97,14 @@ public class FollowRelService {
/**
* 逻辑删除关注关系
*
* @param idolId
* @param followerId
*/
@Transactional
public void deleteFollowRel(String idolId, String followerId) {
FollowRelEntity searchResult = queryRecord(idolId, followerId);
if (searchResult==null){
if (searchResult == null) {
throw new BizException("未找到关注关系");
}
searchResult.setUnfollowTime(LocalDateTime.now());
......@@ -73,18 +112,18 @@ public class FollowRelService {
followRelMapper.updateById(searchResult);
}
public FollowRelEntity queryRecord(String idolId, String followerId){
public FollowRelEntity queryRecord(String idolId, String followerId) {
return followRelMapper.selectOne(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getIdolId,idolId)
.eq(FollowRelEntity::getFansId,followerId));
.eq(FollowRelEntity::getIdolId, idolId)
.eq(FollowRelEntity::getFansId, followerId));
}
public boolean checkFollow(String idolId,String followerId){
public boolean checkFollow(String idolId, String followerId) {
return followRelMapper.selectCount(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getIdolId,idolId)
.eq(FollowRelEntity::getFansId,followerId)
.eq(FollowRelEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode()))
>0;
.eq(FollowRelEntity::getIdolId, idolId)
.eq(FollowRelEntity::getFansId, followerId)
.eq(FollowRelEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode()))
> 0;
}
......
......@@ -129,26 +129,28 @@ public class RecommendService {
int newTimes = newRatio;
int recTimes = pythonRatio;
String id;
while (hotTimes > 0 && hotThemeIds.size() > hotIdx) {
id = hotThemeIds.get(hotIdx);
while (newTimes > 0 && newThemeIds.size() > newIdx) {
id = newThemeIds.get(newIdx);
if (!set.contains(id)) {
result.add(id);
set.add(id);
}
hotIdx++;
hotTimes--;
newIdx++;
newTimes--;
}
while (newTimes > 0 && newThemeIds.size() > newIdx) {
id = newThemeIds.get(newIdx);
while (hotTimes > 0 && hotThemeIds.size() > hotIdx) {
id = hotThemeIds.get(hotIdx);
if (!set.contains(id)) {
result.add(id);
set.add(id);
}
newIdx++;
newTimes--;
hotIdx++;
hotTimes--;
}
while (recTimes > 0 && recThemeIds.size() > recIdx) {
id = recThemeIds.get(recIdx);
if (!set.contains(id)) {
......@@ -170,15 +172,14 @@ public class RecommendService {
int round = 0;
while (true) {
int hotStart = round * 6;
int newestStart = round * 3;
int hotStart = round * 3;
int newestStart = round * 6;
int recmdStart = round;
if (hotStart >= hotIds.size() && newestStart >= newestIds.size() && recmdStart >= recmdIds.size()) {
break;
}
retList.addAll(BizUtils.subList(hotIds, hotStart, hotStart + 6));
retList.addAll(BizUtils.subList(newestIds, newestStart, newestStart + 3));
retList.addAll(BizUtils.subList(hotIds, hotStart, hotStart + 6));
retList.addAll(BizUtils.subList(recmdIds, recmdStart, recmdStart + 1));
round++;
......
......@@ -18,8 +18,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service
......@@ -73,15 +77,15 @@ public class ThemeService {
}
//根据用户id查询主题list
public List<ThemeEntity> queryThemesByUserId(String userId, String lastId, Integer pageSize) {
public List<ThemeEntity> queryThemesByUserIdCreateDesc(String userId, String lastId, Integer pageSize) {
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getAuthorId, userId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode())
.orderByDesc(ThemeEntity::getId);
.orderByDesc(ThemeEntity::getCreateTime);
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
queryWrapper.lt(ThemeEntity::getCreateTime, lastEntity.getCreateTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
......@@ -100,7 +104,7 @@ public class ThemeService {
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
queryWrapper.lt(ThemeEntity::getCreateTime, lastEntity.getCreateTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
......@@ -126,67 +130,6 @@ public class ThemeService {
}
/**
* 查询非传入作者的主题(可分页)
*
* @param lastId
* @param pageSize
* @param userId
* @return
*/
public List<ThemeEntity> selectExcludeUser(String userId, String lastId, Integer pageSize) {
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<>();
if (!StringUtils.isEmpty(userId)) {
queryWrapper.ne(ThemeEntity::getAuthorId, userId);
}
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
queryWrapper.orderByDesc(ThemeEntity::getId);
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
/**
* 查询非传入作者的主题(可分页)
*
* @param lastId
* @param pageSize
* @param userId
* @return
*/
public List<ThemeEntity> queryByThemeIdsExcludeUser(List<String> themeIds, String userId, String lastId, Integer pageSize) {
if (CollectionUtils.isEmpty(themeIds)) {
return Collections.emptyList();
}
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.in(ThemeEntity::getThemeId, themeIds);
if (!StringUtils.isEmpty(userId)) {
queryWrapper.ne(ThemeEntity::getAuthorId, userId);
}
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
queryWrapper.orderByDesc(ThemeEntity::getId);
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
/**
......@@ -230,7 +173,6 @@ public class ThemeService {
if (CollectionUtils.isEmpty(userIds)){
return Collections.emptyList();
}
//TODO 索引优化
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.in(ThemeEntity::getAuthorId, userIds)
.last("limit " + pageStart + ", " + pageSize)
......
......@@ -75,7 +75,10 @@ public class TopicService {
}
public TopicEntity queryById(String topicId) {
return topicMapper.selectOne(new LambdaQueryWrapper<TopicEntity>().eq(TopicEntity::getTopicId, topicId));
return topicMapper.selectOne(new LambdaQueryWrapper<TopicEntity>()
.eq(TopicEntity::getTopicId, topicId)
.eq(TopicEntity::getIsConceal, StatusEnum.FALSE)
.eq(TopicEntity::getDeleteTag, StatusEnum.FALSE));
}
public List<TopicEntity> queryByIds(List<String> topicIds) {
......
......@@ -12,12 +12,14 @@ import java.util.List;
* @email: zhoupeng@wealthgrow.cn
*/
public class PageUtils {
public static <T> Page<T> page(Pageable pageable, List<T> list) {
if (CollectionUtils.isEmpty(list)) {
if(pageable==null){
return new Page<T>(1,0, (long)list.size(),1, list);
}
return new Page<>(pageable, 0L, new ArrayList<>());
return new Page<T>(pageable, 0L, new ArrayList<>());
} else {
if(pageable==null){
return new Page<T>(1,list.size(), (long)list.size(),1, list);
......@@ -64,4 +66,8 @@ public class PageUtils {
}
}
}
public static <T> Page<T> page(Page<String> o, List<T> list) {
return new Page<>(o.getPageNum(),o.getPageSize(),o.getTotalSize(),o.getTotalPages(),list);
}
}
......@@ -15,7 +15,7 @@ server:
spring.datasource:
community:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://rm-uf6r22t3d798q4kmk.mysql.rds.aliyuncs.com:3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
jdbc-url: jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
username: tamp_admin
password: '@imeng123'
maxActive: 2
......@@ -23,7 +23,8 @@ spring.datasource:
initialSize: 2
user:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://rm-uf6r22t3d798q4kmk.mysql.rds.aliyuncs.com:3306/tamp_user?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
jdbc-url: jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_user?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
username: tamp_admin
password: '@imeng123'
maxActive: 2
minIdle: 2
......@@ -80,6 +81,7 @@ es:
port: 9200
userName: 1
userPasswd: 2
index: test
tencent:
cloud:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment