微信小程序不二博客星球-创新互联
一、灵感![](/upload/otherpic42/708c8a27cb934c40a0161ca95d94300b.jpg)
![](/upload/otherpic42/3768250734304078a68be0c9ccc6e2b0.jpg)
![](/upload/otherpic42/651d2caa639741e2b5b8d934f5d7451d.jpg)
![](/upload/otherpic42/737bdf6a506d4cd7b1ae79e9fde4bfb7.jpg)
![](/upload/otherpic42/1bc086ef50b54db6a4b69e0f87b33ef5.jpg)
![](/upload/otherpic42/36eb8d2f1a8540b6b97dce6ba9637592.jpg)
![](/upload/otherpic42/e7caa40e546041b695281a9a12a1f5d6.jpg)
![](/upload/otherpic42/1dc95505a8cb46f1933891f87459f1e7.jpg)
![](/upload/otherpic42/5213e29bdbd647b29614fab8a6a6c2a7.jpg)
![](/upload/otherpic42/b781b2dcb2b0485d85f54f87fa138319.jpg)
![](/upload/otherpic42/violation-del.jpg)
![](/upload/otherpic42/1c71c75d52b448ef9fbe0792fa58cbc2.jpg)
后台截图![](/upload/otherpic42/962fc2750310482f8bec1fc33f64782a.jpg)
![](/upload/otherpic42/036103ec30314dbf920ebef080cb59e0.jpg)
![](/upload/otherpic42/837f7b2fa67d4bc1979c7a5ebdfed582.jpg)
2.2、项目结构
后端
小程序
后台管理
三、技术选型
3.1、语言介绍
当前题目:微信小程序不二博客星球-创新互联
标题来源:http://ybzwz.com/article/doiosd.html
趁着周末无聊,做了一款博客小程序,记录日常工作中遇到的一些问题,方便在手机上温故。
借鉴了网上的一些类似功能,用了大概近一个月的时间,完成了第一个版本。
主要功能有:
- 博客
- 专题
- 书籍推荐
- 圈子
- 动态
- 评论、收藏
- 积分获取
- 留言
- 等等
![](/upload/otherpic42/708c8a27cb934c40a0161ca95d94300b.jpg)
![](/upload/otherpic42/3768250734304078a68be0c9ccc6e2b0.jpg)
![](/upload/otherpic42/6fddd91ef28e40a182f22629b4859153.jpg)
![](/upload/otherpic42/651d2caa639741e2b5b8d934f5d7451d.jpg)
![](/upload/otherpic42/737bdf6a506d4cd7b1ae79e9fde4bfb7.jpg)
![](/upload/otherpic42/c15810e9e3594da6a1836e54c3029b13.jpg)
![](/upload/otherpic42/1bc086ef50b54db6a4b69e0f87b33ef5.jpg)
![](/upload/otherpic42/36eb8d2f1a8540b6b97dce6ba9637592.jpg)
![](/upload/otherpic42/05cddf80542f40258e7dad97939771ae.jpg)
![](/upload/otherpic42/e7caa40e546041b695281a9a12a1f5d6.jpg)
![](/upload/otherpic42/1dc95505a8cb46f1933891f87459f1e7.jpg)
![](/upload/otherpic42/f7eda25d35fb41c095ca0310ffb2ba97.jpg)
![](/upload/otherpic42/5213e29bdbd647b29614fab8a6a6c2a7.jpg)
![](/upload/otherpic42/b781b2dcb2b0485d85f54f87fa138319.jpg)
![](/upload/otherpic42/82655161fa2a40d2b5c32e722bb2607b.jpg)
![](/upload/otherpic42/violation-del.jpg)
![](/upload/otherpic42/1c71c75d52b448ef9fbe0792fa58cbc2.jpg)
![](/upload/otherpic42/75268c724ee2406b9710155b373d8fd1.jpg)
![](/upload/otherpic42/962fc2750310482f8bec1fc33f64782a.jpg)
![](/upload/otherpic42/036103ec30314dbf920ebef080cb59e0.jpg)
![](/upload/otherpic42/837f7b2fa67d4bc1979c7a5ebdfed582.jpg)
![](/upload/otherpic42/1233218d2b174ab8989d50ad8064a90f.jpg)
![](/upload/otherpic42/98d4213982b147f3a8dcbf700b9482a5.jpg)
![](/upload/otherpic42/2191435385ed4617bd234c7f4d38bce3.jpg)
![](/upload/otherpic42/97ebafa642e940209192515b0f91e7b6.jpg)
3.2、源码展示
- 小程序使用uniapp框架,开箱即用。
- 前端使用 vue、ElementUI。
- 后端使用 java 主流框架 Springboot。
- 中间件 Redis
获取积分
@Override
public void addRecord(IntegralValueEnum valueEnum, Long userId) { threadPoolTaskExecutor.execute(() ->{ if (ObjectUtils.isEmpty(userId)) { return;
}
switch (valueEnum.getType()) { // 增加积分
case IntegralTypeConstant.INCREASE:
// 当天积分获取记录
ListintegralRecordEntities = baseDao.selectList(Wrappers.lambdaQuery()
.eq(IntegralRecordEntity::getType, IntegralTypeConstant.INCREASE)
.eq(IntegralRecordEntity::getSourceName, valueEnum.getTitle())
.eq(IntegralRecordEntity::getCreator, userId)
.ge(IntegralRecordEntity::getCreateDate, DateUtils.getZeroDate(true))
.lt(IntegralRecordEntity::getCreateDate, DateUtils.getZeroDate(false))
.orderByDesc(IntegralRecordEntity::getCreateDate));
if (CollUtil.isEmpty(integralRecordEntities)) { updateIntegral(valueEnum, userId, valueEnum.value());
} else { // 今日已获得该类型的积分值
int sum = integralRecordEntities.stream().mapToInt(IntegralRecordEntity::getUpdateNum).sum();
if (sum >= valueEnum.getMaxNum()) { log.error("今日获取积分已达上限, name={}, userId={}", valueEnum.title(), userId);
return;
}
// 此次应加积分(忽略超出的积分)
int updateIntegralNum = (valueEnum.maxNum() - sum) >valueEnum.value() ? valueEnum.value() : valueEnum.maxNum() - sum;
updateIntegral(valueEnum, userId, updateIntegralNum);
}
break;
// 扣减积分
case IntegralTypeConstant.DEDUCTIONS:
IntegralEntity integralEntity = integralDao.selectOne(Wrappers.lambdaQuery()
.eq(IntegralEntity::getCreator, userId));
if (ObjectUtils.isEmpty(integralEntity)) { return;
}
int differenceValue = Math.max(integralEntity.getIntegralNum() - valueEnum.value(), 0);
updateIntegral(valueEnum, userId, differenceValue);
break;
default:
}
});
}
文章详情
public ArticleDTO appGet(Long id, UserEntity user) {ArticleEntity entity = this.selectById(id);
ArticleDTO articleDTO = ConvertUtils.sourceToTarget(entity, ArticleDTO.class);
articleDTO.setPictures(JsonUtils.parseArray(entity.getPictures(), String.class).toArray(new String[0]));
Long count = myLinkDao.selectCount(Wrappers.lambdaQuery()
.eq(MyLinkEntity::getCategory, BusinessTypeConstant.ARTICLE)
.eq(MyLinkEntity::getStatus, StringPool.ONE)
.eq(MyLinkEntity::getSourceId, id));
articleDTO.setCollectionNum(count.intValue());
if (ObjectUtils.isNotEmpty(user)) {Long i = myLinkDao.selectCount(Wrappers.lambdaQuery()
.eq(MyLinkEntity::getCategory, BusinessTypeConstant.ARTICLE)
.eq(MyLinkEntity::getStatus, StringPool.ZERO)
.eq(MyLinkEntity::getCreator, user.getId())
.eq(MyLinkEntity::getSourceId, id));
articleDTO.setIsCollect(i >0);
} else {articleDTO.setIsCollect(false);
}
return articleDTO;
}
有需要前后端源码的,可私聊看演示。
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧
当前题目:微信小程序不二博客星球-创新互联
标题来源:http://ybzwz.com/article/doiosd.html