一、项目技术
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven
二、项目内容和功能介绍
🎈1.项目内容
手办模玩交易平台是一个集购物、交流于一体的在线社区,专为手办模玩爱好者打造。该平台汇聚了丰富的商品资源,涵盖动漫、游戏、电影等多个领域的热门手办模玩,为买家提供多样化的选择。同时,平台通过严格的卖家审核机制,确保商品质量,保障交易安全。
在功能上,手办模玩交易平台不仅提供商品浏览、搜索和购买等基础服务,平台还支持多种支付方式,提供物流跟踪服务,方便买家随时了解订单状态。
随着动漫、游戏等产业的蓬勃发展,手办模玩市场持续扩大,手办模玩交易平台也迎来了广阔的发展前景。未来,平台将继续优化服务,拓展商品种类,提升用户体验,成为手办模玩市场的领军企业。
总的来说,手办模玩交易平台是一个便捷、安全的交易环境,为手办模玩爱好者提供了丰富的商品资源和交流空间,推动了整个手办模玩市场的繁荣与发展。
🎈2.功能介绍
根据现实需要,此系统本文设计出以下功能,主要有以下功能模板。
(1)用户功能:首页、商品信息、购物车、个人中心等。
(2)管理员功能:首页、轮播图管理、管理员管理、用户管理、商品信息管理、商品订单等。
三、核心代码
部分代码:
package com.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 根据name获取信息
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
数据库参考
--
-- Current Database: `cl56588107`
--
/*!40000 DROP DATABASE IF EXISTS `cl56588107`*/;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `cl56588107` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `cl56588107`;
--
-- Table structure for table `address`
--
DROP TABLE IF EXISTS `address`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `address` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`address` varchar(200) NOT NULL COMMENT '地址',
`name` varchar(200) DEFAULT NULL COMMENT '收货人',
`phone` varchar(200) DEFAULT NULL COMMENT '电话',
`isdefault` varchar(200) DEFAULT NULL COMMENT '是否默认地址',
`userid` bigint(20) NOT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='地址';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `address`
--
LOCK TABLES `address` WRITE;
/*!40000 ALTER TABLE `address` DISABLE KEYS */;
INSERT INTO `address` VALUES (1,'2024-03-25 13:02:42','地址1','张三','19819881111','是',11),(2,'2024-03-25 13:02:42','地址2','李四','19819882222','是',12),(3,'2024-03-25 13:02:42','地址3','王五','19819883333','是',13),(4,'2024-03-25 13:02:42','地址4','赵六','19819884444','是',14),(5,'2024-03-25 13:02:42','地址5','孙七','19819885555','是',15),(6,'2024-03-25 13:02:42','地址6','周八','19819886666','是',16);
/*!40000 ALTER TABLE `address` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `cart`
--
DROP TABLE IF EXISTS `cart`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cart` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`tablename` varchar(200) DEFAULT NULL COMMENT '商品表名',
`goodid` bigint(20) NOT NULL COMMENT '商品id',
`goodname` varchar(200) DEFAULT NULL COMMENT '商品名称',
`picture` longtext NOT NULL COMMENT '图片',
`buynumber` int(11) DEFAULT NULL COMMENT '购买数量',
`price` double DEFAULT NULL COMMENT '单价',
`discountprice` double DEFAULT NULL COMMENT '折扣价',
`userid` bigint(20) NOT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='购物车';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cart`
--
LOCK TABLES `cart` WRITE;
/*!40000 ALTER TABLE `cart` DISABLE KEYS */;
/*!40000 ALTER TABLE `cart` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `config`
--
DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '配置参数名称',
`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
/*!40101 SET character_set_client = @saved_cs_client */;
四、效果图