最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

基于Springboot開發(fā)實(shí)現(xiàn)二手交易商城

2022-07-31 13:18 作者:指南針畢業(yè)設(shè)計(jì)  | 我要投稿

項(xiàng)目編號(hào):BS-XX-126

一,項(xiàng)目簡介

??? 本項(xiàng)目基于Springboot開發(fā)實(shí)現(xiàn),主要實(shí)現(xiàn)了一個(gè)二手交易的商城系統(tǒng),用戶注冊后可以實(shí)現(xiàn)在線售賣二手物品的功能,管理員主要實(shí)現(xiàn)對(duì)一些基本數(shù)據(jù)的管理功能。普通用戶的主要功能有:注冊登陸、發(fā)布商品信息、商品收藏管理、售出記錄管理、個(gè)人資料管理、前端信息查看展示、全文檢索、公告新聞查看等。管理員主要實(shí)現(xiàn)的功能有:用戶管理、公告管理、商品管理、銷售分析等功能。

二,環(huán)境介紹

語言環(huán)境:Java:? jdk1.8

數(shù)據(jù)庫:Mysql: mysql5.7

應(yīng)用服務(wù)器:Tomcat:? tomcat8.5.31

開發(fā)工具:IDEA或eclipse

前端開發(fā)技術(shù):Layui+Vuejs

后臺(tái)開發(fā)技術(shù):Springboot+Mybatis+Shiro


亮點(diǎn):使用Shiro進(jìn)行權(quán)限控制、使用Websocket實(shí)現(xiàn)信息發(fā)送、使用阿里云短信發(fā)送(SmsUtil中修改阿里云賬號(hào))、文件上傳(目錄為D:\campusshops\file)


三,系統(tǒng)展示


前端展示:


編輯


登陸注冊

編輯


商品詳情

編輯



個(gè)人中心

編輯


收藏管理

編輯


商品管理:可上傳圖片和展示視頻

編輯


消息通知:使用Websocktet

編輯


售出記錄

編輯


個(gè)人資料修改

編輯


管理員管理功能

用戶管理

編輯


商品清單

編輯

公告管理

編輯


銷售分析

編輯


編輯


四,核心代碼展示


package com.controller;import com.entity.Collect;import com.service.CollectService;import com.util.GetDate;import com.util.KeyUtil;import com.util.StatusCode;import com.vo.LayuiPageVo;import com.vo.ResultVo;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.util.StringUtils;import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpSession;import java.util.List;/** * <p> * ?收藏控制器 * </p> * * @author znz * @since 2022-12-21 */@Controllerpublic class CollectController { ? ?@Autowired ? ?private CollectService collectService; ? ?/** ? ? * 商品詳情界面:收藏商品or取消收藏 ? ? * 前端傳入收藏操作(colloperate:1收藏,2取消收藏),獲取session中用戶id信息,判斷是否登錄 ? ? * (1). 收藏商品 ? ? * 1.前端傳入商品id(commid)、商品名(commname)、商品描述(commdesc)、商品用戶id(cmuserid) ? ? * ? 商品用戶名(username)、商品所在學(xué)校(school) ? ? * 2.session中獲取收藏用戶id(couserid) ? ? * 3.進(jìn)行收藏操作 ? ? * (2). 取消收藏 ? ? * 1.前端傳入商品id(commid) ? ? * 2.判斷是否本人取消收藏 ? ? * 3.進(jìn)行取消收藏操作 ? ? */ ? ?@ResponseBody ? ?@PostMapping("/collect/operate") ? ?public ResultVo insertcollect(@RequestBody Collect collect, HttpSession session){ ? ? ? ?String couserid = (String) session.getAttribute("userid"); ? ? ? ?Integer colloperate = collect.getColloperate(); ? ? ? ?collect.setCouserid(couserid); ? ? ? ?if (StringUtils.isEmpty(couserid)){ ? ? ? ? ? ?return new ResultVo(false, StatusCode.ACCESSERROR,"請(qǐng)先登錄"); ? ? ? ?} ? ? ? ?if (colloperate == 1){ ? ? ? ? ? ?Collect collect1 = collectService.queryCollectStatus(collect); ? ? ? ? ? ?if(!StringUtils.isEmpty(collect1)){ ? ? ? ? ? ? ? ?/**更改原來的收藏信息和狀態(tài)*/ ? ? ? ? ? ? ? ?collect1.setCommname(collect.getCommname()).setCommdesc(collect.getCommdesc()).setSchool(collect.getSchool()) ? ? ? ? ? ? ? ? ? ? ? ?.setSoldtime(GetDate.strToDate()); ? ? ? ? ? ? ? ?Integer i = collectService.updateCollect(collect); ? ? ? ? ? ? ? ?if (i == 1){ ? ? ? ? ? ? ? ? ? ?return new ResultVo(true, StatusCode.OK,"收藏成功"); ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?return new ResultVo(false,StatusCode.ERROR,"收藏失敗"); ? ? ? ? ? ?}else{ ? ? ? ? ? ? ? ?collect.setId(KeyUtil.genUniqueKey()); ? ? ? ? ? ? ? ?Integer i = collectService.insertCollect(collect); ? ? ? ? ? ? ? ?if (i == 1){ ? ? ? ? ? ? ? ? ? ?return new ResultVo(true, StatusCode.OK,"收藏成功"); ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?return new ResultVo(false,StatusCode.ERROR,"收藏失敗"); ? ? ? ? ? ?} ? ? ? ?}else { ? ? ? ? ? ?Collect collect1 = collectService.queryCollectStatus(collect); ? ? ? ? ? ?/**判斷是否為本人操作*/ ? ? ? ? ? ?if (collect1.getCouserid().equals(couserid)){ ? ? ? ? ? ? ? ?Integer i = collectService.updateCollect(collect); ? ? ? ? ? ? ? ?if (i == 1){ ? ? ? ? ? ? ? ? ? ?return new ResultVo(true, StatusCode.OK,"取消成功"); ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?return new ResultVo(false,StatusCode.ERROR,"取消失敗"); ? ? ? ? ? ?} ? ? ? ? ? ?return new ResultVo(false,StatusCode.ACCESSERROR,"禁止操作"); ? ? ? ?} ? ?} ? ?/** ? ? * 收藏列表界面取消收藏 ? ? * 1.前端傳入收藏id(id) ? ? * 2.判斷是否本人取消收藏 ? ? * 3.進(jìn)行取消收藏操作 ? ? */ ? ?@ResponseBody ? ?@PutMapping("/collect/delete/{id}") ? ?public ResultVo deletecollect(@PathVariable("id") String id,HttpSession session){ ? ? ? ?String couserid = (String) session.getAttribute("userid"); ? ? ? ?Collect collect = new Collect().setId(id).setCouserid(couserid); ? ? ? ?Collect collect1 = collectService.queryCollectStatus(collect); ? ? ? ?/**判斷是否為本人操作*/ ? ? ? ?if (collect1.getCouserid().equals(couserid)){ ? ? ? ? ? ?collect.setColloperate(2); ? ? ? ? ? ?Integer i = collectService.updateCollect(collect); ? ? ? ? ? ?if (i == 1){ ? ? ? ? ? ? ? ?return new ResultVo(true, StatusCode.OK,"取消成功"); ? ? ? ? ? ?} ? ? ? ? ? ?return new ResultVo(false,StatusCode.ERROR,"取消失敗"); ? ? ? ?} ? ? ? ?return new ResultVo(false,StatusCode.ACCESSERROR,"禁止操作"); ? ?} ? ?/** ? ? * 分頁查看用戶所有收藏內(nèi)容 ? ? * 前端傳入頁碼、分頁數(shù)量 ? ? * 查詢分頁數(shù)據(jù) ? ? */ ? ?@ResponseBody ? ?@GetMapping("/user/collect/queryall") ? ?public LayuiPageVo usercollect(int limit, int page, HttpSession session) { ? ? ? ?String couserid = (String) session.getAttribute("userid"); ? ? ? ?List<Collect> collectList = collectService.queryAllCollect((page - 1) * limit, limit, couserid); ? ? ? ?Integer dataNumber = collectService.queryCollectCount(couserid); ? ? ? ?return new LayuiPageVo("",0,dataNumber,collectList); ? ?} }


package com.controller;import org.apache.shiro.authz.annotation.RequiresPermissions;import org.springframework.stereotype.Controller;import org.springframework.ui.ModelMap;import org.springframework.util.StringUtils;import org.springframework.web.bind.annotation.GetMapping;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;import java.io.IOException;@Controllerpublic class IndexController { ? ?/** ? ? * 網(wǎng)站首頁 ? ? * */ ? ?@GetMapping("/") ? ?public String index(){ ? ? ? ?return "/index"; ? ?} ? ?/** ? ? * 聯(lián)系我們 ? ? * */ ? ?@GetMapping("/contacts") ? ?public String contacts(){ ? ? ? ?return "/common/contacts"; ? ?} ? ?/** ? ? * 關(guān)于我們 ? ? * */ ? ?@GetMapping("/about") ? ?public String about(){ ? ? ? ?return "/common/about"; ? ?} ? ?/** ? ? * 后臺(tái)管理首頁 ? ? * */ ? ?@GetMapping("/admin/index") ? ?public String adminindex(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws IOException { ? ? ? ?String admin = (String) session.getAttribute("admin"); ? ? ? ?/**攔截器:如果不是管理員,則進(jìn)行重定向*/ ? ? ? ?if (StringUtils.isEmpty(admin)){ ? ? ? ? ? ?response.sendRedirect(request.getContextPath() + "/");//重定向 ? ? ? ?} ? ? ? ?return "/admin/index"; ? ?} ? ?/** ? ? * 用戶登錄注冊 ? ? * */ ? ?@GetMapping("/login") ? ?public String login(){ ? ? ? ?return "/user/logreg"; ? ?} ? ?/** ? ? * 用戶忘記密碼 ? ? * */ ? ?@GetMapping("/forget") ? ?public String forget(){ ? ? ? ?return "user/forget"; ? ?} ? ?/** ? ? * 個(gè)人中心 ? ? * */ ? ?@GetMapping("/user/center") ? ?public String usercenter(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws IOException { ? ? ? ?String userid = (String) session.getAttribute("userid"); ? ? ? ?/**攔截器:如果不是用戶角色登錄,則進(jìn)行重定向*/ ? ? ? ?if (StringUtils.isEmpty(userid)){ ? ? ? ? ? ?response.sendRedirect(request.getContextPath() + "/");//重定向 ? ? ? ?} ? ? ? ?return "/user/user-center"; ? ?} ? ?/** ? ? * 用戶修改密碼 ? ? * */ ? ?@RequiresPermissions("user:userinfo") ? ?@GetMapping("/user/pass") ? ?public String userinfo(){ ? ? ? ?return "/user/updatepass"; ? ?} ? ?/** ? ? * 用戶更換手機(jī)號(hào) ? ? * */ ? ?@RequiresPermissions("user:userinfo") ? ?@GetMapping("/user/phone") ? ?public String userphone(){ ? ? ? ?return "/user/updatephone"; ? ?} ? ?/** ? ? * 用戶商品列表 ? ? * */ ? ?@GetMapping("/user/product") ? ?public String userproduct(){ ? ? ? ?return "/user/product/productlist"; ? ?} ? ?/** ? ? * 通知消息 ? ? * */ ? ?@GetMapping("/user/message") ? ?public String commonmessage(){ ? ? ? ?return "/user/message/message"; ? ?} ? ?/** ? ? * 彈出式通知消息 ? ? * */ ? ?@GetMapping("/user/alertmessage") ? ?public String alertmessage(){ ? ? ? ?return "/user/message/alertmessage"; ? ?} ? ?/** ? ? * 跳轉(zhuǎn)到產(chǎn)品清單界面 ? ? * */ ? ?@GetMapping("/product-listing") ? ?public String toproductlisting() { ? ? ? ?return "/common/product-listing"; ? ?} ? ?/** ? ? * 跳轉(zhuǎn)到產(chǎn)品清單搜索界面 ? ? * */ ? ?@GetMapping("/product-search") ? ?public String toProductSearchs(String keys, ModelMap modelMap) { ? ? ? ?if(keys==null){ ? ? ? ? ? ?return "/error/404"; ? ? ? ?} ? ? ? ?modelMap.put("keys",keys); ? ? ? ?return "/common/product-search"; ? ?} ? ?/**用戶個(gè)人中心默認(rèn)展示圖*/ ? ?@GetMapping("/home/console") ? ?public String homeconsole(){ ? ? ? ?return "/admin/home/console"; ? ?} ? ?/** ? ? * 管理員首頁默認(rèn)展示圖 ? ? * */ ? ?@GetMapping("/echars/console") ? ?public String echars(){ ? ? ? ?return "/admin/echars/console"; ? ?} ? ?@GetMapping("/app/message/index") ? ?public String appmessageindex(){ ? ? ? ?return "/admin/app/message/index"; ? ?} ? ?/** ? ? * 用戶收藏列表 ? ? * */ ? ?@GetMapping("/user/collect") ? ?public String usercollect(){ ? ? ? ?return "/user/collect/collectlist"; ? ?} ? ?/** ? ? * 用戶售出記錄 ? ? * */ ? ?@GetMapping("/user/sold") ? ?public String sold(){ ? ? ? ?return "/user/sold/soldrecord"; ? ?} ? ?/** ? ? * 銷量列表 ? ? * */ ? ?@GetMapping("/admin/sold") ? ?public String adminSold(){ ? ? ? ?return "/admin/sold/soldrecord"; ? ?} ? ?/** ? ? * 首頁公告清單 ? ? * */ ? ?@GetMapping("/user/newslist") ? ?public String userNews(){ ? ? ? ?return "/common/listnews"; ? ?} ? ?/** ? ? * 管理員公告列表 ? ? * */ ? ?@GetMapping("/admin/newslist") ? ?public String adminNews(){ ? ? ? ?return "/admin/news/newslist"; ? ?} }


package com.controller;import com.entity.Notices;import com.service.NoticesService;import com.util.StatusCode;import com.vo.LayuiPageVo;import com.vo.ResultVo;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.PathVariable;import org.springframework.web.bind.annotation.PutMapping;import org.springframework.web.bind.annotation.ResponseBody;import javax.servlet.http.HttpSession;import java.util.List;/** * <p> * ?消息通知控制器 * </p> * * @author znz * @since 2022-12-25 */@Controllerpublic class NoticesController { ? ?@Autowired ? ?private NoticesService noticesService; ? ?/** ? ? * 用戶查看通知消息后 ? ? * 1.前端傳入通知id(id) ? ? * 2.將其設(shè)置為已讀 ? ? * */ ? ?@ResponseBody ? ?@PutMapping("/notices/look/{id}") ? ?public ResultVo LookNoticesById (@PathVariable("id") String id) { ? ? ? ?Integer i = noticesService.updateNoticesById(id); ? ? ? ?if (i == 1){ ? ? ? ? ? ?return new ResultVo(true, StatusCode.OK,"設(shè)置成功"); ? ? ? ?} ? ? ? ?return new ResultVo(true, StatusCode.ERROR,"設(shè)置失敗"); ? ?} ? ?/** ? ? *查詢前10條公告 ? ? * **/ ? ?@ResponseBody ? ?@GetMapping("/notices/queryNotices") ? ?public ResultVo queryNotices (HttpSession session){ ? ? ? ?String userid = (String) session.getAttribute("userid"); ? ? ? ?List<Notices> noticesList = noticesService.queryNotices(userid); ? ? ? ?return new ResultVo(true,StatusCode.OK,"查詢成功",noticesList); ? ?} ? ?/** ? ? * 取消新通知標(biāo)志 ? ? * 用戶點(diǎn)擊查看最新通知后會(huì)將所有通知設(shè)置為非最新通知 ? ? * */ ? ?@ResponseBody ? ?@GetMapping("/notices/cancelLatest") ? ?public ResultVo CancelLatest (HttpSession session){ ? ? ? ?String userid = (String) session.getAttribute("userid"); ? ? ? ?Integer i = noticesService.CancelLatest(userid); ? ? ? ?if (i == 1){ ? ? ? ? ? ?return new ResultVo(true,StatusCode.OK,"設(shè)置成功"); ? ? ? ?} ? ? ? ?return new ResultVo(true,StatusCode.ERROR,"設(shè)置失敗"); ? ?} ? ?/** ? ? * 分類分頁查詢用戶所有通知消息 ? ? * 1.前端傳入消息通知類型(tpname) ? ? * 2.session中獲取用戶id(userid) ? ? * 3.返回分頁數(shù)據(jù) ? ? * */ ? ?@ResponseBody ? ?@GetMapping("/notices/queryall") ? ?public LayuiPageVo queryallSold(int limit, int page, HttpSession session) { ? ? ? ?String userid = (String) session.getAttribute("userid"); ? ? ? ?List<Notices> noticesList = noticesService.queryAllNotices((page - 1) * limit, limit, userid); ? ? ? ?Integer dataNumber = noticesService.queryNoticesCount(userid); ? ? ? ?return new LayuiPageVo("", 0,dataNumber,noticesList); ? ?} }


五,項(xiàng)目總結(jié)


? ? ? ?項(xiàng)目前后端功能都有,比較完整,未實(shí)現(xiàn)在線支付功能,可以在此基礎(chǔ)上來進(jìn)行修改完善,項(xiàng)目結(jié)構(gòu)簡單清晰,修改方便,比較適合做畢業(yè)設(shè)計(jì)或課程設(shè)計(jì)使用。


基于Springboot開發(fā)實(shí)現(xiàn)二手交易商城的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
仁怀市| 靖远县| 澄迈县| 临泽县| 东港市| 佛学| 彰武县| 新宁县| 康平县| 永顺县| 富宁县| 邢台县| 鸡西市| 庆城县| 沙田区| 克山县| 昌邑市| 蒙阴县| 栖霞市| 咸丰县| 武鸣县| 安阳市| 即墨市| 寿光市| 湘潭市| 松溪县| 合肥市| 穆棱市| 大兴区| 天气| 哈巴河县| 嘉义市| 九寨沟县| 罗定市| 陆丰市| 永春县| 西城区| 普安县| 临海市| 板桥市| 新田县|