基于推荐算法的商城系统开发
Copyright ©2024 www.javaclimb.com 版权所有 5/26/2023
图书购物网站相对传统图书购物信息管理方式具备很多优点:首先可以大幅提高图书购物信息检索 (opens new window),只需输入图书购物相关信息就能在数秒内反馈想要的结果;其次可存储大量的图书购物信息,同时图书购物信息安全性有更高的保障;相比纸质文件来管理图书购物信息,图书购物管理系统更节省空间人力资源。这些优点大大提高运营效率并节省运营成本。因此,开发图书购物网站对图书购物信息进行有效的管理是很必要的,不仅提高了图书购物管理效率,增加了用户信息安全性,方便及时反馈信息给管理员,增加了与管理员之间的互动交流,更能提高图书购物的体验强度。
本系统为了数据库结构的灵活性所以打算采用MySQL来设计数据库,而java技术,B/S架构则保证了较高的平台适应性。本文主要介绍了本系统的开发背景,所要完成的功能和开发的过程,主要说明了系统设计的重点、设计思想。 本系统的推荐模块用到了推荐算法 (opens new window)。
# 一,系统的介绍
# 二,系统的核心代码演示
/**
* 地址
* 后端接口
* @author 小孟v:jishulearn
* @email
*/
@RestController
@RequestMapping("/address")
public class AddressController {
@Autowired
private AddressService addressService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,AddressEntity address,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,AddressEntity address,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( AddressEntity address){
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
return R.ok().put("data", addressService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(AddressEntity address){
EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
AddressView addressView = addressService.selectView(ew);
return R.ok("查询地址成功").put("data", addressView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody AddressEntity address, HttpServletRequest request){
//ValidatorUtils.validateEntity(address);
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
}
addressService.updateById(address);//全部更新
return R.ok();
}
/**
* 获取默认地址
*/
@RequestMapping("/default")
public R defaultAddress(HttpServletRequest request){
Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
AddressEntity address = addressService.selectOne(wrapper);
return R.ok().put("data", address);
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
addressService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
}
int count = addressService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
/**
* 通用接口
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
private static AipFace client = null;
@Autowired
private ConfigService configService;
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@RequestMapping("/option/{tableName}/{columnName}")
@IgnoreAuth
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* 根据table中的column获取单条记录
* @param table
* @param column
* @return
*/
@RequestMapping("/follow/{tableName}/{columnName}")
@IgnoreAuth
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* 修改table表的sfsh状态
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
@IgnoreAuth
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 单列求和
*/
@RequestMapping("/cal/{tableName}/{columnName}")
@IgnoreAuth
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
* 分组统计
*/
@RequestMapping("/group/{tableName}/{columnName}")
@IgnoreAuth
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)
*/
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
@IgnoreAuth
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)时间统计类型
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")
public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
params.put("timeStatType", timeStatType);
List<Map<String, Object>> result = commonService.selectTimeStatValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* 人脸比对
*
* @param face1 人脸1
* @param face2 人脸2
* @return
*/
@RequestMapping("/matchFace")
@IgnoreAuth
public R matchFace(String face1, String face2,HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
}
# 三,系统的数据库演示
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 '创建时间',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`address` varchar(200) NOT NULL COMMENT '地址',
`name` varchar(200) NOT NULL COMMENT '收货人',
`phone` varchar(200) NOT NULL COMMENT '电话',
`isdefault` varchar(200) NOT NULL COMMENT '是否默认地址[是/否]',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1647441497416 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,'2022-03-16 14:34:24',11,'宇宙银河系金星1号','金某','13823888881','是'),(2,'2022-03-16 14:34:24',12,'宇宙银河系木星1号','木某','13823888882','是'),(3,'2022-03-16 14:34:24',13,'宇宙银河系水星1号','水某','13823888883','是'),(4,'2022-03-16 14:34:24',14,'宇宙银河系火星1号','火某','13823888884','是'),(5,'2022-03-16 14:34:24',15,'宇宙银河系土星1号','土某','13823888885','是'),(6,'2022-03-16 14:34:24',16,'宇宙银河系月球1号','月某','13823888886','是'),(1647441497415,'2022-03-16 14:38:16',1647441418337,'xxx地址','一个朋友','13899999999','是');
/*!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 'tushuzhanshi' COMMENT '商品表名',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`goodid` bigint(20) NOT NULL COMMENT '商品id',
`goodname` varchar(200) DEFAULT NULL COMMENT '商品名称',
`picture` varchar(200) DEFAULT NULL COMMENT '图片',
`buynumber` int(11) NOT NULL COMMENT '购买数量',
`price` float DEFAULT NULL COMMENT '单价',
`discountprice` float DEFAULT NULL COMMENT '会员价',
`goodtype` varchar(200) DEFAULT NULL COMMENT '商品类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1647441460544 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 */;
--
-- Dumping data for table `config`
--
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'picture1','upload/picture1.jpg'),(2,'picture2','upload/picture2.jpg'),(3,'picture3','upload/picture3.jpg');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `discussrementushu`
--
DROP TABLE IF EXISTS `discussrementushu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discussrementushu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`refid` bigint(20) NOT NULL COMMENT '关联表id',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
`content` longtext NOT NULL COMMENT '评论内容',
`reply` longtext COMMENT '回复内容',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8 COMMENT='热门图书评论表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `discussrementushu`
--
LOCK TABLES `discussrementushu` WRITE;
/*!40000 ALTER TABLE `discussrementushu` DISABLE KEYS */;
INSERT INTO `discussrementushu` VALUES (111,'2022-03-16 14:34:24',1,1,'用户名1','评论内容1','回复内容1'),(112,'2022-03-16 14:34:24',2,2,'用户名2','评论内容2','回复内容2'),(113,'2022-03-16 14:34:24',3,3,'用户名3','评论内容3','回复内容3'),(114,'2022-03-16 14:34:24',4,4,'用户名4','评论内容4','回复内容4'),(115,'2022-03-16 14:34:24',5,5,'用户名5','评论内容5','回复内容5'),(116,'2022-03-16 14:34:24',6,6,'用户名6','评论内容6','回复内容6');
/*!40000 ALTER TABLE `discussrementushu` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `discusstushuzhanshi`
--
DROP TABLE IF EXISTS `discusstushuzhanshi`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discusstushuzhanshi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`refid` bigint(20) NOT NULL COMMENT '关联表id',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
`content` longtext NOT NULL COMMENT '评论内容',
`reply` longtext COMMENT '回复内容',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8 COMMENT='图书展示评论表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `discusstushuzhanshi`
--
LOCK TABLES `discusstushuzhanshi` WRITE;
/*!40000 ALTER TABLE `discusstushuzhanshi` DISABLE KEYS */;
INSERT INTO `discusstushuzhanshi` VALUES (131,'2022-03-16 14:34:24',1,1,'用户名1','评论内容1','回复内容1'),(132,'2022-03-16 14:34:24',2,2,'用户名2','评论内容2','回复内容2'),(133,'2022-03-16 14:34:24',3,3,'用户名3','评论内容3','回复内容3'),(134,'2022-03-16 14:34:24',4,4,'用户名4','评论内容4','回复内容4'),(135,'2022-03-16 14:34:24',5,5,'用户名5','评论内容5','回复内容5'),(136,'2022-03-16 14:34:24',6,6,'用户名6','评论内容6','回复内容6');
/*!40000 ALTER TABLE `discusstushuzhanshi` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `discusszuixintushu`
--
DROP TABLE IF EXISTS `discusszuixintushu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discusszuixintushu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`refid` bigint(20) NOT NULL COMMENT '关联表id',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
`content` longtext NOT NULL COMMENT '评论内容',
`reply` longtext COMMENT '回复内容',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1647441682045 DEFAULT CHARSET=utf8 COMMENT='最新图书评论表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `discusszuixintushu`
--
LOCK TABLES `discusszuixintushu` WRITE;
/*!40000 ALTER TABLE `discusszuixintushu` DISABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `news`
--
DROP TABLE IF EXISTS `news`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `news` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`title` varchar(200) NOT NULL COMMENT '标题',
`introduction` longtext COMMENT '简介',
`picture` varchar(200) NOT NULL COMMENT '图片',
`content` longtext NOT NULL COMMENT '内容',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8 COMMENT='图书资讯';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `news`
--
LOCK TABLES `news` WRITE;
/*!40000 ALTER TABLE `news` DISABLE KEYS */;
/*!40000 ALTER TABLE `news` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`orderid` varchar(200) NOT NULL COMMENT '订单编号',
`tablename` varchar(200) DEFAULT 'tushuzhanshi' COMMENT '商品表名',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`goodid` bigint(20) NOT NULL COMMENT '商品id',
`goodname` varchar(200) DEFAULT NULL COMMENT '商品名称',
`picture` varchar(200) DEFAULT NULL COMMENT '商品图片',
`buynumber` int(11) NOT NULL COMMENT '购买数量',
`price` float NOT NULL DEFAULT '0' COMMENT '价格/积分',
`discountprice` float DEFAULT '0' COMMENT '折扣价格',
`total` float NOT NULL DEFAULT '0' COMMENT '总价格/总积分',
`discounttotal` float DEFAULT '0' COMMENT '折扣总价格',
`type` int(11) DEFAULT '1' COMMENT '支付类型',
`status` varchar(200) DEFAULT NULL COMMENT '状态',
`address` varchar(200) DEFAULT NULL COMMENT '地址',
`tel` varchar(200) DEFAULT NULL COMMENT '电话',
`consignee` varchar(200) DEFAULT NULL COMMENT '收货人',
`logistics` longtext COMMENT '物流',
`goodtype` varchar(200) DEFAULT NULL COMMENT '商品类型',
PRIMARY KEY (`id`),
UNIQUE KEY `orderid` (`orderid`)
) ENGINE=InnoDB AUTO_INCREMENT=1647441539813 DEFAULT CHARSET=utf8 COMMENT='订单';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orders`
--
--
-- Table structure for table `rementushu`
--
DROP TABLE IF EXISTS `rementushu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rementushu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`tushubianhao` varchar(200) DEFAULT NULL COMMENT '图书编号',
`tushumingcheng` varchar(200) DEFAULT NULL COMMENT '图书名称',
`chubanshe` varchar(200) DEFAULT NULL COMMENT '出版社',
`tushufenlei` varchar(200) DEFAULT NULL COMMENT '图书分类',
`tushuzuozhe` varchar(200) DEFAULT NULL COMMENT '图书作者',
`tushufengmian` varchar(200) DEFAULT NULL COMMENT '图书封面',
`tushugaiyao` longtext COMMENT '图书概要',
`clicktime` datetime DEFAULT NULL COMMENT '最近点击时间',
`clicknum` int(11) DEFAULT '0' COMMENT '点击次数',
`price` float DEFAULT NULL COMMENT '价格',
PRIMARY KEY (`id`),
UNIQUE KEY `tushubianhao` (`tushubianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='热门图书';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `rementushu`
--
LOCK TABLES `rementushu` WRITE;
/*!40000 ALTER TABLE `rementushu` DISABLE KEYS */;
--
-- Table structure for table `storeup`
--
DROP TABLE IF EXISTS `storeup`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `storeup` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`refid` bigint(20) DEFAULT NULL COMMENT '收藏id',
`tablename` varchar(200) DEFAULT NULL COMMENT '表名',
`name` varchar(200) NOT NULL COMMENT '收藏名称',
`picture` varchar(200) NOT NULL COMMENT '收藏图片',
`type` varchar(200) DEFAULT '1' COMMENT '类型(1:收藏,21:赞,22:踩)',
`inteltype` varchar(200) DEFAULT NULL COMMENT '推荐类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1647441450314 DEFAULT CHARSET=utf8 COMMENT='收藏表';
/*!40101 SET character_set_client = @saved_cs_client */;
为了帮助更多的小伙伴学习,我录制了很多项目,也开源了很多的项目教程。
关注下方公众号,回复:项目大全 即可不断学习。