项目介绍
随着计算机技术的成熟,互联网的建立,如今,PC平台上有许多关于文章管理方面的应用程序,但由于使用时间和地点上的限制,用户在使用上存在着种种不方便,而开发一款基于微信小程序的文章管理系统,能够有效地解决这个问题。
本基于微信小程序的文章管理系统是针对文章管理而开发,采用微信开发者工具进行微信端开发,使用MYSQL数据库进行系统数据的储存,系统满足用户通过微信客户端进行文章管理的需求。本小程序是以微信为入口的,可以说是在自带接近10亿的流量人口。整个系统不仅操作简单、便捷,而且节约用户的时间及资源成本等,仅需通过一部手机和微信号即可满足用户们的需求。
论文首先阐述了基于微信小程序的文章管理系统的开发背景,并对开发基于微信小程序的文章管理系统所采用的相关技术进行了详细的介绍,然后对此应用软件进行了需求分析、设计,最后对系统进行测试、维护,保证系统的正常运行。
开发环境
编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,微信开发者工具,jdk1.8,maven
支持定做:java/php/python/android/小程序vue/爬虫/c#/asp.net
系统实现
5.1微信端功能模块的实现
5.1.1注册登录界面
没有账号的用户可进行注册操作,注册时可选择注册类型进入对应角色的注册界面,注册后可进行登录系统,微信端注册登录界面展示如图5.1所示。
图5.1 微信端注册登录界面
5.1.2首页界面
所有用户登录后均可进入首页查看首页信息,首页界面展示如图5.2所示。
图5.2首页界面
5.1.3文章界面
用户登录后可查看文章信息,并可根据条件快速查询所需文章,可选择文章进行查看详情操作,文章界面展示如图5.3所示。
图5.3 文章界面
5.1.4我要发帖界面
作者和用户登录后均可进行发帖操作,我要发帖界面展示如图5.4所示。
图5.4 我要发帖界面
5.1.5添加文章界面
作者登录后可进行添加文章操作,添加文章界面展示如图5.5所示。
图5.5 添加文章界面
5.1.6我的收藏管理界面
用户和作者均可管理个人收藏信息,我的收藏管理界面展示如图5.6所示。
图5.6 我的收藏管理界面
5.2管理员功能模块的实现
5.2.1管理员登录界面
管理员要想进入系统后台对系统进行管理操作,必须登录系统后台,管理员登录界面展示如图5.7所示。
图5.7 管理员登录界面
5.2.2用户管理界面
管理员登录后可添加、修改和删除用户信息,用户管理界面如图5.8所示。
图5.8 用户管理界面
5.2.3作者管理界面
管理员在作者管理界面可查看所有作者信息,对已有作者信息可进行编辑和删除操作,同时也可添加作者信息,作者管理界面如图5.9所示。
图5.9 作者管理界面
5.2.4文章管理界面
管理员可管理文章信息,对已有文章信息可进行编辑和删除,文章管理界面展示如图5.10所示。
图5.10 文章管理界面
5.2.5文章分类管理界面
管理员可增删改查文章分类信息,文章分类管理界面展示如图5.11所示。
图5.11 文章分类管理界面
5.2.6论坛管理界面
管理员可管理论坛信息,论坛管理界面展示如图5.12所示。
图5.12 论坛管理界面
核心代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WenzhangEntity;
import com.entity.view.WenzhangView;
import com.service.WenzhangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 文章
* 后端接口
* @author
* @email
* @date
*/
@RestController
@RequestMapping("/wenzhang")
public class WenzhangController {
@Autowired
private WenzhangService wenzhangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WenzhangEntity wenzhang,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("zuozhe")) {
wenzhang.setZuozhezhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<WenzhangEntity> ew = new EntityWrapper<WenzhangEntity>();
PageUtils page = wenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WenzhangEntity wenzhang, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("zuozhe")) {
wenzhang.setZuozhezhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<WenzhangEntity> ew = new EntityWrapper<WenzhangEntity>();
PageUtils page = wenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WenzhangEntity wenzhang){
EntityWrapper<WenzhangEntity> ew = new EntityWrapper<WenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( wenzhang, "wenzhang"));
return R.ok().put("data", wenzhangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WenzhangEntity wenzhang){
EntityWrapper< WenzhangEntity> ew = new EntityWrapper< WenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( wenzhang, "wenzhang"));
WenzhangView wenzhangView = wenzhangService.selectView(ew);
return R.ok("查询文章成功").put("data", wenzhangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WenzhangEntity wenzhang = wenzhangService.selectById(id);
wenzhang.setClicktime(new Date());
wenzhangService.updateById(wenzhang);
return R.ok().put("data", wenzhang);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WenzhangEntity wenzhang = wenzhangService.selectById(id);
wenzhang.setClicktime(new Date());
wenzhangService.updateById(wenzhang);
return R.ok().put("data", wenzhang);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R thumbsup(@PathVariable("id") String id,String type){
WenzhangEntity wenzhang = wenzhangService.selectById(id);
if(type.equals("1")) {
wenzhang.setThumbsupnum(wenzhang.getThumbsupnum()+1);
} else {
wenzhang.setCrazilynum(wenzhang.getCrazilynum()+1);
}
wenzhangService.updateById(wenzhang);
return R.ok();
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WenzhangEntity wenzhang, HttpServletRequest request){
wenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wenzhang);
wenzhangService.insert(wenzhang);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WenzhangEntity wenzhang, HttpServletRequest request){
wenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wenzhang);
wenzhang.setUserid((Long)request.getSession().getAttribute("userId"));
wenzhangService.insert(wenzhang);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody WenzhangEntity wenzhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(wenzhang);
wenzhangService.updateById(wenzhang);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wenzhangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<WenzhangEntity> wrapper = new EntityWrapper<WenzhangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("zuozhe")) {
wrapper.eq("zuozhezhanghao", (String)request.getSession().getAttribute("username"));
}
int count = wenzhangService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,WenzhangEntity wenzhang, HttpServletRequest request,String pre){
EntityWrapper<WenzhangEntity> ew = new EntityWrapper<WenzhangEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicktime");
params.put("order", "desc");
PageUtils page = wenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhang), params), params));
return R.ok().put("data", page);
}
}
论文参考
目 录
摘 要 I
Abstract II
目 录 III
第1章 绪论 1
1.1研究背景 1
1.2设计原则 1
1.3论文组织结构 2
第2章 关键技术简介 3
2.1 微信小程序 3
2.2 微信开发者工具 3
2.3微信小程序API接口 3
2.4 WXML 、WXS、JS小程序编写语言 3
2.5 MYSQL数据库 4
第3章 系统分析 5
3.1 可行性分析 5
3.1.1技术可行性 5
3.1.2 经济可行性 5
3.1.3 操作可行性 5
3.1.4时间可行性 5
3.2 系统性能分析 6
3.3 系统功能分析 6
3.4 系统流程分析 9
3.4.1注册登录流程 9
3.4.2添加信息流程 10
3.5系统界面分析 10
第4章 系统设计 12
4.1系统结构设计 12
4.2系统顺序图设计 12
4.2.1登录模块顺序图 12
4.2.2添加信息模块顺序图 13
4.3系统数据库设计 13
4.3.1 数据库E-R图设计 13
4.3.2 数据库表设计 15
第5章 系统的实现 18
5.1微信端功能模块的实现 18
5.1.1注册登录界面 18
5.1.2首页界面 18
5.1.3文章界面 19
5.1.4我要发帖界面 20
5.1.5添加文章界面 20
5.1.6我的收藏管理界面 21
5.2管理员功能模块的实现 21
5.2.1管理员登录界面 21
5.2.2用户管理界面 22
5.2.3作者管理界面 22
5.2.4文章管理界面 23
5.2.5文章分类管理界面 23
5.2.6论坛管理界面 24
第6章 系统测试 25
6.1 软件测试 25
6.2 测试的重要性 25
6.3 测试方法 26
6.4测试分析 26
第7章 总结 27
致 谢 28
参考文献 29