Java项目:springboot优咪商城 您所在的位置:网站首页 优米商城是正规的吗 Java项目:springboot优咪商城

Java项目:springboot优咪商城

2024-05-30 20:15| 来源: 网络整理| 查看: 265

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

优咪网上购物体验系统

1. 该平台主要有两大功能: (1) 浏览平台官方和认证作者提供的篮球相关信息,信息类型包括:视频,新闻,评论类文章,比赛结果 (2) 篮球周边商城,商品分类球鞋、球衣、篮球、运动装备、休闲衣服 (3) 特别功能:每条信息和每一个商品都有一个特殊类型:标签(可有多个标签)。当用户在浏览某条信息(例如在看某段视频到结尾时),平台根据标签向用户推送标签相同的商品。反之,用户在浏览某件商品时,亦根据标签向用户推送与该商品标签相同的信息。 2. 该平台有三种用户:平台管理员、平台认证作者、普通用户 (1) 平台管理员: ① 可管理平台官方运营的商店,对商店的商品进行增删查改,定期上线活动 ② 管理平台的信息发布,可对信息进行增删改查 (2) 平台认证作者: ① 可发布自己攥写的文章或自己剪辑的视频 ② 可在自己发布的信息下方添加商品链接,若用户购买可获得提成 (3) 用户: ① 可无广告地浏览平台上关于篮球的资讯 ② 可浏览商品并且购买 ③ 可申请成为官方认证作者

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 

6.数据库:MySql 5.7版本;

技术栈

1. 后端:Springboot

2. 前端:html+bootstrap+jQuery+layui+ueditor

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 将项目中application.yml配置文件中的数据库配置改为自己的配置 3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 4. 运行项目 前台地址:http://localhost:8080/

后台浏览地址:http://localhost:8080/login.html

运行截图

 

 

 

 

 

 

 

 

 

 

 代码相关 活动管理控制器 /** * 活动 */ @Controller @RequestMapping("activity") public class ActivityController { @Autowired private ActivityService service; /** * 界面 * @param model * @return */ @RequestMapping("list.htm") public String list(Model model){ List list = service.selectList(new EntityWrapper()); model.addAttribute("list",list); return "activity/list"; } /** * 保存界面 * @param model * @param id * @return * @throws Exception */ @RequestMapping("save.htm") public String save(Model model,String id)throws Exception{ ActivityEntity entity = new ActivityEntity(); if(!StringUtils.isEmpty(id)){ entity = service.selectById(id); } model.addAttribute("entity",entity); return "activity/save"; } /** * 保存 * @param model * @return * @throws Exception */ @RequestMapping("saveData.htm") @ResponseBody public Result save(Model model, ActivityEntity entity)throws Exception{ if(StringUtils.isEmpty(entity.getId())){ entity.setId(IdWorker.get32UUID()); entity.setTime(new Date()); service.insert(entity); }else{ service.updateById(entity); } return Result.success("保存成功"); } /** * 删除 * @param id * @return * @throws Exception */ @PostMapping("del.htm") @ResponseBody public Result del(String id)throws Exception{ service.deleteById(id); return Result.success("保存成功"); } }  订单管理控制器 @Controller @RequestMapping("order") public class OrderController { @Autowired private OrderShopService orderShopService; @Autowired private OrderService orderService; /** * 界面 * @param model * @return * @throws Exception */ @RequestMapping("page.htm") public String page(Model model)throws Exception{ EntityWrapper entityWrapper = new EntityWrapper(); entityWrapper.orderBy(OrderTable.TIME,false); List list = orderService.selectList(entityWrapper); if(list!=null){ for (OrderEntity orderEntity : list) { entityWrapper = new EntityWrapper(); entityWrapper.eq("order_id",orderEntity.getId()); List shoppingGatEntities = orderShopService.selectList(entityWrapper); orderEntity.setOrderShops(shoppingGatEntities); } } model.addAttribute("list",list); return "order/list"; } /** * 修改 * @param orderEntity * @return * @throws Exception */ @RequestMapping("update.htm") @ResponseBody @NoAdminLogin public Result update(OrderEntity orderEntity)throws Exception{ orderService.updateById(orderEntity); return Result.success("1"); } } 商品管理控制器 /** * 商品管理 */ @Controller @RequestMapping("shop") public class ShopController { @Autowired private ShopService service; @Autowired private ShopTypeService shopTypeService; /** * 界面 * @param model * @return */ @RequestMapping("list.htm") public String list(Model model){ List list = service.selectList(new EntityWrapper()); model.addAttribute("list",list); return "shop/list"; } /** * 保存界面 * @param model * @param id * @return * @throws Exception */ @RequestMapping("save.htm") public String save(Model model,String id)throws Exception{ ShopEntity entity = new ShopEntity(); entity.setStatus(true); entity.setHot(false); if(!StringUtils.isEmpty(id)){ entity = service.selectById(id); } model.addAttribute("entity",entity); List types = shopTypeService.selectList(new EntityWrapper()); model.addAttribute("types",types); return "shop/save"; } /** * 保存 * @param model * @return * @throws Exception */ @RequestMapping("saveData.htm") @ResponseBody public Result save(Model model, ShopEntity entity)throws Exception{ if(StringUtils.isEmpty(entity.getId())){ entity.setId(IdWorkerUtil.getId()); entity.setStock(0); entity.setScore(0.0); service.insert(entity); }else{ service.updateById(entity); } return Result.success("保存成功"); } /** * 删除 * @param id * @return * @throws Exception */ @PostMapping("del.htm") @ResponseBody public Result del(String id)throws Exception{ service.deleteById(id); return Result.success("保存成功"); } /** * 保存 * @param model * @return * @throws Exception */ @RequestMapping("stock.htm") @ResponseBody public Result stock(Model model, Integer stock,String id ,Integer type)throws Exception{ ShopEntity entity = service.selectById(id); if(entity.getStock()==null){ entity.setStock(0); } if(type==1){ //添加库存 entity.setStock(entity.getStock()+stock); }else{ //减少库存 if(entity.getStock()-stock


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有