当前位置:   article > 正文

基于微信小程序的校园服务平台+ssm后端源码和论文_小程序后端服务平台

小程序后端服务平台

随着计算机技术的成熟,互联网的建立,如今,PC平台上有许多关于校园服务方面的应用程序,但由于使用时间和地点上的限制,用户在使用上存在着种种不方便,而开发一款基于微信小程序的校园服务平台,能够有效地解决这个问题。

本基于微信小程序的校园服务平台是针对校园服务方面而开发,采用微信开发者工具进行微信端开发,使用MYSQL数据库进行系统数据的储存,系统满足用户通过微信客户端进行查看校园公告、购买二手商品的需求。本小程序是以微信为入口的,可以说是在自带接近10亿的流量人口。整个系统不仅操作简单、便捷,而且节约用户的时间及资源成本等,仅需通过一部手机和微信号即可满足用户们的需求。

论文首先阐述了基于微信小程序的校园服务平台的开发背景,并对开发基于微信小程序的校园服务平台所采用的相关技术进行了详细的介绍,然后对此应用软件进行了需求分析、设计,最后对系统进行测试、维护,保证系统的正常运行。

基于微信小程序的校园服务平台+ssm后端源码和论文weixin107

关键词:微信小程序 ;微信开发者工具;校园服务平台;MYSQL数据库

演示视频:

基于微信小程序的校园服务平台+ssm后端源码和论文

Abstract

With the maturity of computer technology and the establishment of the Internet, nowadays, there are many applications on campus services on the PC platform. However, due to the limitations of the time and place of use, users have various inconveniences in use, so we developed a The campus service platform based on WeChat applet can effectively solve this problem.

This campus service platform based on WeChat applet is developed for campus services. WeChat developer tools are used for WeChat terminal development, and MYSQL database is used for system data storage. The system satisfies users to check campus announcements and purchase second-hand purchases through WeChat client. Demand for goods. This small program is based on WeChat, which can be said to have a traffic population of close to 1 billion. The entire system is not only simple and convenient to operate, but also saves users' time and resource costs. It only needs a mobile phone and WeChat ID to meet the needs of users.

The thesis first explained the development background of the campus service platform based on WeChat applet, and introduced the relevant technologies used in the development of the WeChat applet-based campus service platform. Then, the application software was analyzed and designed. Finally, test and maintain the system to ensure the normal operation of the system.

Keywords: WeChat Mini Program; WeChat Developer Tools; Campus Service Platform; MYSQL Database

 

  1. package com.controller;
  2. import java.text.SimpleDateFormat;
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5. import java.util.Calendar;
  6. import java.util.Map;
  7. import java.util.HashMap;
  8. import java.util.Iterator;
  9. import java.util.Date;
  10. import java.util.List;
  11. import javax.servlet.http.HttpServletRequest;
  12. import com.utils.ValidatorUtils;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.format.annotation.DateTimeFormat;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestParam;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  22. import com.baomidou.mybatisplus.mapper.Wrapper;
  23. import com.annotation.IgnoreAuth;
  24. import com.entity.MaijiaEntity;
  25. import com.entity.view.MaijiaView;
  26. import com.service.MaijiaService;
  27. import com.service.TokenService;
  28. import com.utils.PageUtils;
  29. import com.utils.R;
  30. import com.utils.MD5Util;
  31. import com.utils.MPUtil;
  32. import com.utils.CommonUtil;
  33. /**
  34. * 卖家
  35. * 后端接口
  36. * @author
  37. * @email
  38. * @date 2021-04-06 19:35:42
  39. */
  40. @RestController
  41. @RequestMapping("/maijia")
  42. public class MaijiaController {
  43. @Autowired
  44. private MaijiaService maijiaService;
  45. @Autowired
  46. private TokenService tokenService;
  47. /**
  48. * 登录
  49. */
  50. @IgnoreAuth
  51. @RequestMapping(value = "/login")
  52. public R login(String username, String password, String captcha, HttpServletRequest request) {
  53. MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiazhanghao", username));
  54. if(user==null || !user.getMima().equals(password)) {
  55. return R.error("账号或密码不正确");
  56. }
  57. String token = tokenService.generateToken(user.getId(), username,"maijia", "卖家" );
  58. return R.ok().put("token", token);
  59. }
  60. /**
  61. * 注册
  62. */
  63. @IgnoreAuth
  64. @RequestMapping("/register")
  65. public R register(@RequestBody MaijiaEntity maijia){
  66. //ValidatorUtils.validateEntity(maijia);
  67. MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiazhanghao", maijia.getMaijiazhanghao()));
  68. if(user!=null) {
  69. return R.error("注册用户已存在");
  70. }
  71. Long uId = new Date().getTime();
  72. maijia.setId(uId);
  73. maijiaService.insert(maijia);
  74. return R.ok();
  75. }
  76. /**
  77. * 退出
  78. */
  79. @RequestMapping("/logout")
  80. public R logout(HttpServletRequest request) {
  81. request.getSession().invalidate();
  82. return R.ok("退出成功");
  83. }
  84. /**
  85. * 获取用户的session用户信息
  86. */
  87. @RequestMapping("/session")
  88. public R getCurrUser(HttpServletRequest request){
  89. Long id = (Long)request.getSession().getAttribute("userId");
  90. MaijiaEntity user = maijiaService.selectById(id);
  91. return R.ok().put("data", user);
  92. }
  93. /**
  94. * 密码重置
  95. */
  96. @IgnoreAuth
  97. @RequestMapping(value = "/resetPass")
  98. public R resetPass(String username, HttpServletRequest request){
  99. MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiazhanghao", username));
  100. if(user==null) {
  101. return R.error("账号不存在");
  102. }
  103. user.setMima("123456");
  104. maijiaService.updateById(user);
  105. return R.ok("密码已重置为:123456");
  106. }
  107. /**
  108. * 后端列表
  109. */
  110. @RequestMapping("/page")
  111. public R page(@RequestParam Map<String, Object> params,MaijiaEntity maijia,
  112. HttpServletRequest request){
  113. EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();
  114. PageUtils page = maijiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, maijia), params), params));
  115. return R.ok().put("data", page);
  116. }
  117. /**
  118. * 前端列表
  119. */
  120. @RequestMapping("/list")
  121. public R list(@RequestParam Map<String, Object> params,MaijiaEntity maijia, HttpServletRequest request){
  122. EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();
  123. PageUtils page = maijiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, maijia), params), params));
  124. return R.ok().put("data", page);
  125. }
  126. /**
  127. * 列表
  128. */
  129. @RequestMapping("/lists")
  130. public R list( MaijiaEntity maijia){
  131. EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();
  132. ew.allEq(MPUtil.allEQMapPre( maijia, "maijia"));
  133. return R.ok().put("data", maijiaService.selectListView(ew));
  134. }
  135. /**
  136. * 查询
  137. */
  138. @RequestMapping("/query")
  139. public R query(MaijiaEntity maijia){
  140. EntityWrapper< MaijiaEntity> ew = new EntityWrapper< MaijiaEntity>();
  141. ew.allEq(MPUtil.allEQMapPre( maijia, "maijia"));
  142. MaijiaView maijiaView = maijiaService.selectView(ew);
  143. return R.ok("查询卖家成功").put("data", maijiaView);
  144. }
  145. /**
  146. * 后端详情
  147. */
  148. @RequestMapping("/info/{id}")
  149. public R info(@PathVariable("id") Long id){
  150. MaijiaEntity maijia = maijiaService.selectById(id);
  151. return R.ok().put("data", maijia);
  152. }
  153. /**
  154. * 前端详情
  155. */
  156. @RequestMapping("/detail/{id}")
  157. public R detail(@PathVariable("id") Long id){
  158. MaijiaEntity maijia = maijiaService.selectById(id);
  159. return R.ok().put("data", maijia);
  160. }
  161. /**
  162. * 后端保存
  163. */
  164. @RequestMapping("/save")
  165. public R save(@RequestBody MaijiaEntity maijia, HttpServletRequest request){
  166. maijia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  167. //ValidatorUtils.validateEntity(maijia);
  168. MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiazhanghao", maijia.getMaijiazhanghao()));
  169. if(user!=null) {
  170. return R.error("用户已存在");
  171. }
  172. maijia.setId(new Date().getTime());
  173. maijiaService.insert(maijia);
  174. return R.ok();
  175. }
  176. /**
  177. * 前端保存
  178. */
  179. @RequestMapping("/add")
  180. public R add(@RequestBody MaijiaEntity maijia, HttpServletRequest request){
  181. maijia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  182. //ValidatorUtils.validateEntity(maijia);
  183. MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiazhanghao", maijia.getMaijiazhanghao()));
  184. if(user!=null) {
  185. return R.error("用户已存在");
  186. }
  187. maijia.setId(new Date().getTime());
  188. maijiaService.insert(maijia);
  189. return R.ok();
  190. }
  191. /**
  192. * 修改
  193. */
  194. @RequestMapping("/update")
  195. public R update(@RequestBody MaijiaEntity maijia, HttpServletRequest request){
  196. //ValidatorUtils.validateEntity(maijia);
  197. maijiaService.updateById(maijia);//全部更新
  198. return R.ok();
  199. }
  200. /**
  201. * 删除
  202. */
  203. @RequestMapping("/delete")
  204. public R delete(@RequestBody Long[] ids){
  205. maijiaService.deleteBatchIds(Arrays.asList(ids));
  206. return R.ok();
  207. }
  208. /**
  209. * 提醒接口
  210. */
  211. @RequestMapping("/remind/{columnName}/{type}")
  212. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
  213. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
  214. map.put("column", columnName);
  215. map.put("type", type);
  216. if(type.equals("2")) {
  217. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  218. Calendar c = Calendar.getInstance();
  219. Date remindStartDate = null;
  220. Date remindEndDate = null;
  221. if(map.get("remindstart")!=null) {
  222. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
  223. c.setTime(new Date());
  224. c.add(Calendar.DAY_OF_MONTH,remindStart);
  225. remindStartDate = c.getTime();
  226. map.put("remindstart", sdf.format(remindStartDate));
  227. }
  228. if(map.get("remindend")!=null) {
  229. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
  230. c.setTime(new Date());
  231. c.add(Calendar.DAY_OF_MONTH,remindEnd);
  232. remindEndDate = c.getTime();
  233. map.put("remindend", sdf.format(remindEndDate));
  234. }
  235. }
  236. Wrapper<MaijiaEntity> wrapper = new EntityWrapper<MaijiaEntity>();
  237. if(map.get("remindstart")!=null) {
  238. wrapper.ge(columnName, map.get("remindstart"));
  239. }
  240. if(map.get("remindend")!=null) {
  241. wrapper.le(columnName, map.get("remindend"));
  242. }
  243. int count = maijiaService.selectCount(wrapper);
  244. return R.ok().put("count", count);
  245. }
  246. }
  1. package com.controller;
  2. import java.text.SimpleDateFormat;
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5. import java.util.Calendar;
  6. import java.util.Map;
  7. import java.util.HashMap;
  8. import java.util.Iterator;
  9. import java.util.Date;
  10. import java.util.List;
  11. import javax.servlet.http.HttpServletRequest;
  12. import com.utils.ValidatorUtils;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.format.annotation.DateTimeFormat;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestParam;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  22. import com.baomidou.mybatisplus.mapper.Wrapper;
  23. import com.annotation.IgnoreAuth;
  24. import com.entity.ErshoushangpinEntity;
  25. import com.entity.view.ErshoushangpinView;
  26. import com.service.ErshoushangpinService;
  27. import com.service.TokenService;
  28. import com.utils.PageUtils;
  29. import com.utils.R;
  30. import com.utils.MD5Util;
  31. import com.utils.MPUtil;
  32. import com.utils.CommonUtil;
  33. /**
  34. * 二手商品
  35. * 后端接口
  36. * @author
  37. * @email
  38. * @date 2021-04-06 19:35:43
  39. */
  40. @RestController
  41. @RequestMapping("/ershoushangpin")
  42. public class ErshoushangpinController {
  43. @Autowired
  44. private ErshoushangpinService ershoushangpinService;
  45. /**
  46. * 后端列表
  47. */
  48. @RequestMapping("/page")
  49. public R page(@RequestParam Map<String, Object> params,ErshoushangpinEntity ershoushangpin,
  50. HttpServletRequest request){
  51. String tableName = request.getSession().getAttribute("tableName").toString();
  52. if(tableName.equals("maijia")) {
  53. ershoushangpin.setMaijiazhanghao((String)request.getSession().getAttribute("username"));
  54. }
  55. EntityWrapper<ErshoushangpinEntity> ew = new EntityWrapper<ErshoushangpinEntity>();
  56. PageUtils page = ershoushangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ershoushangpin), params), params));
  57. return R.ok().put("data", page);
  58. }
  59. /**
  60. * 前端列表
  61. */
  62. @IgnoreAuth
  63. @RequestMapping("/list")
  64. public R list(@RequestParam Map<String, Object> params,ErshoushangpinEntity ershoushangpin, HttpServletRequest request){
  65. EntityWrapper<ErshoushangpinEntity> ew = new EntityWrapper<ErshoushangpinEntity>();
  66. PageUtils page = ershoushangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, ershoushangpin), params), params));
  67. return R.ok().put("data", page);
  68. }
  69. /**
  70. * 列表
  71. */
  72. @RequestMapping("/lists")
  73. public R list( ErshoushangpinEntity ershoushangpin){
  74. EntityWrapper<ErshoushangpinEntity> ew = new EntityWrapper<ErshoushangpinEntity>();
  75. ew.allEq(MPUtil.allEQMapPre( ershoushangpin, "ershoushangpin"));
  76. return R.ok().put("data", ershoushangpinService.selectListView(ew));
  77. }
  78. /**
  79. * 查询
  80. */
  81. @RequestMapping("/query")
  82. public R query(ErshoushangpinEntity ershoushangpin){
  83. EntityWrapper< ErshoushangpinEntity> ew = new EntityWrapper< ErshoushangpinEntity>();
  84. ew.allEq(MPUtil.allEQMapPre( ershoushangpin, "ershoushangpin"));
  85. ErshoushangpinView ershoushangpinView = ershoushangpinService.selectView(ew);
  86. return R.ok("查询二手商品成功").put("data", ershoushangpinView);
  87. }
  88. /**
  89. * 后端详情
  90. */
  91. @RequestMapping("/info/{id}")
  92. public R info(@PathVariable("id") Long id){
  93. ErshoushangpinEntity ershoushangpin = ershoushangpinService.selectById(id);
  94. return R.ok().put("data", ershoushangpin);
  95. }
  96. /**
  97. * 前端详情
  98. */
  99. @IgnoreAuth
  100. @RequestMapping("/detail/{id}")
  101. public R detail(@PathVariable("id") Long id){
  102. ErshoushangpinEntity ershoushangpin = ershoushangpinService.selectById(id);
  103. return R.ok().put("data", ershoushangpin);
  104. }
  105. /**
  106. * 后端保存
  107. */
  108. @RequestMapping("/save")
  109. public R save(@RequestBody ErshoushangpinEntity ershoushangpin, HttpServletRequest request){
  110. ershoushangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  111. //ValidatorUtils.validateEntity(ershoushangpin);
  112. ershoushangpinService.insert(ershoushangpin);
  113. return R.ok();
  114. }
  115. /**
  116. * 前端保存
  117. */
  118. @RequestMapping("/add")
  119. public R add(@RequestBody ErshoushangpinEntity ershoushangpin, HttpServletRequest request){
  120. ershoushangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  121. //ValidatorUtils.validateEntity(ershoushangpin);
  122. ershoushangpinService.insert(ershoushangpin);
  123. return R.ok();
  124. }
  125. /**
  126. * 修改
  127. */
  128. @RequestMapping("/update")
  129. public R update(@RequestBody ErshoushangpinEntity ershoushangpin, HttpServletRequest request){
  130. //ValidatorUtils.validateEntity(ershoushangpin);
  131. ershoushangpinService.updateById(ershoushangpin);//全部更新
  132. return R.ok();
  133. }
  134. /**
  135. * 删除
  136. */
  137. @RequestMapping("/delete")
  138. public R delete(@RequestBody Long[] ids){
  139. ershoushangpinService.deleteBatchIds(Arrays.asList(ids));
  140. return R.ok();
  141. }
  142. /**
  143. * 提醒接口
  144. */
  145. @RequestMapping("/remind/{columnName}/{type}")
  146. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
  147. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
  148. map.put("column", columnName);
  149. map.put("type", type);
  150. if(type.equals("2")) {
  151. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  152. Calendar c = Calendar.getInstance();
  153. Date remindStartDate = null;
  154. Date remindEndDate = null;
  155. if(map.get("remindstart")!=null) {
  156. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
  157. c.setTime(new Date());
  158. c.add(Calendar.DAY_OF_MONTH,remindStart);
  159. remindStartDate = c.getTime();
  160. map.put("remindstart", sdf.format(remindStartDate));
  161. }
  162. if(map.get("remindend")!=null) {
  163. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
  164. c.setTime(new Date());
  165. c.add(Calendar.DAY_OF_MONTH,remindEnd);
  166. remindEndDate = c.getTime();
  167. map.put("remindend", sdf.format(remindEndDate));
  168. }
  169. }
  170. Wrapper<ErshoushangpinEntity> wrapper = new EntityWrapper<ErshoushangpinEntity>();
  171. if(map.get("remindstart")!=null) {
  172. wrapper.ge(columnName, map.get("remindstart"));
  173. }
  174. if(map.get("remindend")!=null) {
  175. wrapper.le(columnName, map.get("remindend"));
  176. }
  177. String tableName = request.getSession().getAttribute("tableName").toString();
  178. if(tableName.equals("maijia")) {
  179. wrapper.eq("maijiazhanghao", (String)request.getSession().getAttribute("username"));
  180. }
  181. int count = ershoushangpinService.selectCount(wrapper);
  182. return R.ok().put("count", count);
  183. }
  184. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/849382
推荐阅读
相关标签
  

闽ICP备14008679号