——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot校园二手商品交易系统小程序(java+springboot+maven+微信小程序)
后台管理员: admin 123456
小程序用户(自行注册): user1 123456 user2 123456 user3 123456 user4 123456 user5 123456 user6 123456
运行环境 开发语言:Java 框架:springboot JDK版本:JDK1.8 数据库:mysql 8.0 数据库工具:Navicat11 开发软件:idea,微信开发者工具 浏览器:谷歌浏览器
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 @Controller @RequestMapping("/cus/likes") public class LikesController { @Autowired private LikesService likesService; @RequestMapping("/list") @ResponseBody public R list (@RequestParam Map<String, Object> params) { Query query = new Query(params); List<LikesEntity> likesList = likesService.queryList(query); int total = likesService.queryTotal(query); return R.ok().put("total" , total).put("rows" , likesList); } @RequestMapping("/info/{id}") @ResponseBody public R info (@PathVariable("id") Integer id) { LikesEntity likes = likesService.queryObject(id); return R.ok().put("likes" , likes);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 @RequestMapping("/save") @ResponseBody public R save (@RequestBody ShopcarEntity shopcar) { shopcarService.save(shopcar); return R.ok(); } @RequestMapping("/update") @ResponseBody public R update (@RequestBody ShopcarEntity shopcar) { shopcarService.update(shopcar); return R.ok(); } @RequestMapping("/delete") @ResponseBody public R delete (@RequestBody Integer[] ids) { shopcarService.deleteBatch(ids); return R.ok(); } @RequestMapping("/shopcaradd.html") public String shopcaradd (HttpServletRequest req) { return "modules/cus/shopcaradd" ; } @RequestMapping("/shopcaredit.html") public String shopcaredit (@RequestParam("id") Integer id, HttpServletRequest req) { ShopcarEntity shopcar = shopcarService.queryObject(id); req.setAttribute("shopcar" , shopcar); return "modules/cus/shopcaredit" ; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 return R.ok().put("total" , total).put("rows" , goodsList); } @RequestMapping("/alllist") @ResponseBody public R alllist (@RequestParam Map<String, Object> params) throws IOException { Query query = new Query(params); if (params.get("price" ).toString().length()>0 ){ query.put("price1" , params.get("price" ).toString().split("-" )[0 ]); query.put("price2" , params.get("price" ).toString().split("-" )[1 ]); } List<GoodsEntity> goodsList =null ; goodsList=goodsService.queryList(query); int total = goodsService.queryTotal(query); return R.ok().put("total" , total).put("rows" , goodsList); } @RequestMapping("/recommendlist") @ResponseBody public R recommendlist (@RequestParam Map<String, Object> params) throws IOException { List<GoodsEntity> goodsList =null ; goodsList=goodsService.recommendList(Integer.parseInt(params.get("userId" ).toString())) ; return R.ok().put("total" , goodsList.size()).put("rows" , goodsList); } @RequestMapping("/info/{id}") @ResponseBody public R info (@PathVariable("id") Integer id,@RequestParam("userId") Integer userId) { GoodsEntity goods = goodsService.queryObject(id); HashMap<String, Object> map=new HashMap<String, Object>(); map.put("goodsId" , id); map.put("comment" , "ss" ); orderService.queryList(map);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 @Controller @RequestMapping("/cus/record") public class RecordController { @Autowired private RecordService recordService; @Autowired private UserService userService; @RequestMapping("/list") @ResponseBody public R list (@RequestParam Map<String, Object> params) { Query query = new Query(params); List<RecordEntity> recordList = recordService.queryList(query); int total = recordService.queryTotal(query); return R.ok().put("total" , total).put("rows" , recordList); } @RequestMapping("/info/{id}") @ResponseBody public R info (@PathVariable("id") Integer id) { RecordEntity record = recordService.queryObject(id); return R.ok().put("record" , record); } @RequestMapping("/save") @ResponseBody public R save (@RequestBody RecordEntity record) { record.setCreateTime(new Date()); recordService.save(record); UserEntity u=userService.queryObject(record.getUserId()); UserEntity user=new UserEntity(); user.setId(u.getId()); user.setYu(u.getYu()+record.getPrice()); if (record.getPrice()>=288 ){
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 return R.ok() .put(OBJ_TAG, list) .put("value" , goodsService.queryObject(Integer.parseInt(params.get( "goodsId" ).toString()))); } @RequestMapping("/orderlist") @ResponseBody public R orderlist (@RequestParam Map<String, Object> params) { Query query = new Query(params); List<OrderEntity> list = orderService.queryList(query); return R.ok().put(OBJ_TAG, list); } @RequestMapping("/shibie") public R shibie (@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception { if (file.isEmpty()) { throw new RRException("上传文件不能为空" ); } String suffix = file.getOriginalFilename().substring( file.getOriginalFilename().lastIndexOf("." )); System.out.println(suffix); String realPath = request.getSession().getServletContext()
——————————PayStart——————————
项目链接: https://javayms.github.io?id=222325490902201ps https://javayms.pages.dev?id=222325490902201ps