Skip to content

Commit ec93f73

Browse files
author
zhh
committed
广告接口修改
1 parent 0653278 commit ec93f73

3 files changed

Lines changed: 58 additions & 33 deletions

File tree

document/sql/mall.sql

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
1010
Target Server Version : 50719
1111
File Encoding : 65001
1212
13-
Date: 2018-11-12 14:45:12
13+
Date: 2018-11-13 17:07:38
1414
*/
1515

1616
SET FOREIGN_KEY_CHECKS=0;
@@ -137,18 +137,19 @@ CREATE TABLE `cms_subject` (
137137
`show_status` int(1) DEFAULT NULL COMMENT '显示状态:0->不显示;1->显示',
138138
`content` text,
139139
`forward_count` int(11) DEFAULT NULL COMMENT '转发数',
140+
`category_name` varchar(200) DEFAULT NULL COMMENT '专题分类名称',
140141
PRIMARY KEY (`id`)
141142
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='专题表';
142143

143144
-- ----------------------------
144145
-- Records of cms_subject
145146
-- ----------------------------
146-
INSERT INTO `cms_subject` VALUES ('1', '1', 'polo衬衫的也时尚', null, null, null, null, null, null, null, null, null, null, null, null);
147-
INSERT INTO `cms_subject` VALUES ('2', '2', '大牌手机低价秒', null, null, null, null, null, null, null, null, null, null, null, null);
148-
INSERT INTO `cms_subject` VALUES ('3', '2', '晓龙845新品上市', null, null, null, null, null, null, null, null, null, null, null, null);
149-
INSERT INTO `cms_subject` VALUES ('4', '1', '夏天应该穿什么', null, null, null, null, null, null, null, null, null, null, null, null);
150-
INSERT INTO `cms_subject` VALUES ('5', '1', '夏季精选', null, null, null, null, null, null, null, null, null, null, null, null);
151-
INSERT INTO `cms_subject` VALUES ('6', '2', '品牌手机降价', null, null, null, null, null, null, null, null, null, null, null, null);
147+
INSERT INTO `cms_subject` VALUES ('1', '1', 'polo衬衫的也时尚', null, null, null, '2018-11-11 13:26:55', null, null, null, null, null, null, null, null, '服装专题');
148+
INSERT INTO `cms_subject` VALUES ('2', '2', '大牌手机低价秒', null, null, null, '2018-11-12 13:27:00', null, null, null, null, null, null, null, null, '手机专题');
149+
INSERT INTO `cms_subject` VALUES ('3', '2', '晓龙845新品上市', null, null, null, '2018-11-13 13:27:05', null, null, null, null, null, null, null, null, '手机专题');
150+
INSERT INTO `cms_subject` VALUES ('4', '1', '夏天应该穿什么', null, null, null, '2018-11-01 13:27:09', null, null, null, null, null, null, null, null, '服装专题');
151+
INSERT INTO `cms_subject` VALUES ('5', '1', '夏季精选', null, null, null, '2018-11-06 13:27:18', null, null, null, null, null, null, null, null, '服装专题');
152+
INSERT INTO `cms_subject` VALUES ('6', '2', '品牌手机降价', null, null, null, '2018-11-07 13:27:21', null, null, null, null, null, null, null, null, '手机专题');
152153

153154
-- ----------------------------
154155
-- Table structure for cms_subject_category
@@ -675,11 +676,11 @@ INSERT INTO `pms_brand` VALUES ('3', '华为', 'H', '100', '1', '0', '100', '100
675676
INSERT INTO `pms_brand` VALUES ('4', '格力', 'G', '30', '1', '0', '100', '100', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg (3).jpg', null, 'Victoria\'s Secret的故事');
676677
INSERT INTO `pms_brand` VALUES ('5', '方太', 'F', '20', '1', '0', '100', '100', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg (4).jpg', null, 'Victoria\'s Secret的故事');
677678
INSERT INTO `pms_brand` VALUES ('6', '小米', 'M', '500', '1', '1', '100', '100', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180518/5a912944N474afb7a.png', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180518/5afd7778Nf7800b75.jpg', '小米手机的故事');
678-
INSERT INTO `pms_brand` VALUES ('21', 'OPPO', 'O', '0', '1', '1', null, null, 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg(6).jpg', '', 'string');
679-
INSERT INTO `pms_brand` VALUES ('49', '七匹狼', 'S', '200', '1', '0', null, null, 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180518/1522738681.jpg', null, 'BOOB的故事');
680-
INSERT INTO `pms_brand` VALUES ('50', '海澜之家', 'H', '200', '1', '1', null, null, 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/LOGO1024.png', '', '海澜之家的故事');
681-
INSERT INTO `pms_brand` VALUES ('51', '苹果', 'A', '200', '1', '1', null, null, 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', null, '苹果的故事');
682-
INSERT INTO `pms_brand` VALUES ('58', 'NIKE', 'N', '0', '1', '1', null, null, 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180615/timg (51).jpg', '', 'NIKE的故事');
679+
INSERT INTO `pms_brand` VALUES ('21', 'OPPO', 'O', '0', '1', '1', '88', '500', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg(6).jpg', '', 'string');
680+
INSERT INTO `pms_brand` VALUES ('49', '七匹狼', 'S', '200', '1', '0', '77', '400', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180518/1522738681.jpg', null, 'BOOB的故事');
681+
INSERT INTO `pms_brand` VALUES ('50', '海澜之家', 'H', '200', '1', '1', '66', '300', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/LOGO1024.png', '', '海澜之家的故事');
682+
INSERT INTO `pms_brand` VALUES ('51', '苹果', 'A', '200', '1', '1', '55', '200', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', null, '苹果的故事');
683+
INSERT INTO `pms_brand` VALUES ('58', 'NIKE', 'N', '0', '1', '1', '33', '100', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180615/timg (51).jpg', '', 'NIKE的故事');
683684

684685
-- ----------------------------
685686
-- Table structure for pms_comment
@@ -1515,11 +1516,17 @@ CREATE TABLE `sms_home_advertise` (
15151516
`note` varchar(500) DEFAULT NULL COMMENT '备注',
15161517
`sort` int(11) DEFAULT '0' COMMENT '排序',
15171518
PRIMARY KEY (`id`)
1518-
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='首页轮播广告表';
1519+
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='首页轮播广告表';
15191520

15201521
-- ----------------------------
15211522
-- Records of sms_home_advertise
15221523
-- ----------------------------
1524+
INSERT INTO `sms_home_advertise` VALUES ('2', '夏季大热促销', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180615/xiaomi.jpg', '2018-11-01 14:01:37', '2018-11-15 14:01:37', '0', '0', '0', null, '夏季大热促销', '0');
1525+
INSERT INTO `sms_home_advertise` VALUES ('3', '夏季大热促销1', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/5ac1bf58Ndefaac16.jpg', '2018-11-13 14:01:37', '2018-11-13 14:01:37', '0', '0', '0', null, '夏季大热促销1', '0');
1526+
INSERT INTO `sms_home_advertise` VALUES ('4', '夏季大热促销2', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180615/5a9d248cN071f4959.jpg', '2018-11-13 14:01:37', '2018-11-13 14:01:37', '1', '0', '0', null, '夏季大热促销2', '0');
1527+
INSERT INTO `sms_home_advertise` VALUES ('9', '电影推荐广告', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20181113/movie_ad.jpg', '2018-11-01 00:00:00', '2018-11-24 00:00:00', '1', '0', '0', 'www.baidu.com', '电影推荐广告', '100');
1528+
INSERT INTO `sms_home_advertise` VALUES ('10', '汽车促销广告', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20181113/car_ad.jpg', '2018-11-13 00:00:00', '2018-11-24 00:00:00', '1', '0', '0', 'xxx', null, '99');
1529+
INSERT INTO `sms_home_advertise` VALUES ('11', '汽车推荐广告', '1', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20181113/car_ad2.jpg', '2018-11-13 00:00:00', '2018-11-30 00:00:00', '1', '0', '0', 'xxx', null, '98');
15231530

15241531
-- ----------------------------
15251532
-- Table structure for sms_home_brand
@@ -1532,19 +1539,24 @@ CREATE TABLE `sms_home_brand` (
15321539
`recommend_status` int(1) DEFAULT NULL,
15331540
`sort` int(11) DEFAULT NULL,
15341541
PRIMARY KEY (`id`)
1535-
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='首页推荐品牌表';
1542+
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='首页推荐品牌表';
15361543

15371544
-- ----------------------------
15381545
-- Records of sms_home_brand
15391546
-- ----------------------------
1540-
INSERT INTO `sms_home_brand` VALUES ('1', '1', '万和', '1', '0');
1547+
INSERT INTO `sms_home_brand` VALUES ('1', '1', '万和', '1', '200');
15411548
INSERT INTO `sms_home_brand` VALUES ('2', '2', '三星', '1', '0');
1542-
INSERT INTO `sms_home_brand` VALUES ('3', '3', '华为', '1', '0');
1543-
INSERT INTO `sms_home_brand` VALUES ('4', '4', '格力', '1', '0');
1544-
INSERT INTO `sms_home_brand` VALUES ('5', '5', '方太', '1', '0');
1545-
INSERT INTO `sms_home_brand` VALUES ('6', '6', '小米', '1', '0');
1546-
INSERT INTO `sms_home_brand` VALUES ('8', '5', '方太', '0', '100');
1547-
INSERT INTO `sms_home_brand` VALUES ('9', '6', '小米', '0', '0');
1549+
INSERT INTO `sms_home_brand` VALUES ('6', '6', '小米', '1', '300');
1550+
INSERT INTO `sms_home_brand` VALUES ('8', '5', '方太', '1', '100');
1551+
INSERT INTO `sms_home_brand` VALUES ('31', '49', '七匹狼', '0', '0');
1552+
INSERT INTO `sms_home_brand` VALUES ('32', '50', '海澜之家', '1', '0');
1553+
INSERT INTO `sms_home_brand` VALUES ('33', '51', '苹果', '1', '0');
1554+
INSERT INTO `sms_home_brand` VALUES ('34', '2', '三星', '0', '0');
1555+
INSERT INTO `sms_home_brand` VALUES ('35', '3', '华为', '1', '0');
1556+
INSERT INTO `sms_home_brand` VALUES ('36', '4', '格力', '1', '0');
1557+
INSERT INTO `sms_home_brand` VALUES ('37', '5', '方太', '1', '0');
1558+
INSERT INTO `sms_home_brand` VALUES ('38', '1', '万和', '1', '0');
1559+
INSERT INTO `sms_home_brand` VALUES ('39', '21', 'OPPO', '1', '0');
15481560

15491561
-- ----------------------------
15501562
-- Table structure for sms_home_new_product
@@ -1557,13 +1569,17 @@ CREATE TABLE `sms_home_new_product` (
15571569
`recommend_status` int(1) DEFAULT NULL,
15581570
`sort` int(1) DEFAULT NULL,
15591571
PRIMARY KEY (`id`)
1560-
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='新鲜好物表';
1572+
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='新鲜好物表';
15611573

15621574
-- ----------------------------
15631575
-- Records of sms_home_new_product
15641576
-- ----------------------------
1565-
INSERT INTO `sms_home_new_product` VALUES ('2', '27', '小米8 全面屏游戏智能手机 6GB+64GB 黑色 全网通4G 双卡双待', '0', '0');
1566-
INSERT INTO `sms_home_new_product` VALUES ('3', '28', '小米 红米5A 全网通版 3GB+32GB 香槟金 移动联通电信4G手机 双卡双待', '1', '100');
1577+
INSERT INTO `sms_home_new_product` VALUES ('2', '27', '小米8 全面屏游戏智能手机 6GB+64GB 黑色 全网通4G 双卡双待', '1', '200');
1578+
INSERT INTO `sms_home_new_product` VALUES ('8', '26', '华为 HUAWEI P20 ', '0', '0');
1579+
INSERT INTO `sms_home_new_product` VALUES ('9', '27', '小米8 全面屏游戏智能手机 6GB+64GB 黑色 全网通4G 双卡双待', '1', '0');
1580+
INSERT INTO `sms_home_new_product` VALUES ('10', '28', '小米 红米5A 全网通版 3GB+32GB 香槟金 移动联通电信4G手机 双卡双待', '1', '0');
1581+
INSERT INTO `sms_home_new_product` VALUES ('11', '29', 'Apple iPhone 8 Plus 64GB 红色特别版 移动联通电信4G手机', '1', '0');
1582+
INSERT INTO `sms_home_new_product` VALUES ('12', '30', 'HLA海澜之家简约动物印花短袖T恤', '1', '0');
15671583

15681584
-- ----------------------------
15691585
-- Table structure for sms_home_recommend_product
@@ -1576,12 +1592,16 @@ CREATE TABLE `sms_home_recommend_product` (
15761592
`recommend_status` int(1) DEFAULT NULL,
15771593
`sort` int(1) DEFAULT NULL,
15781594
PRIMARY KEY (`id`)
1579-
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='人气推荐商品表';
1595+
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='人气推荐商品表';
15801596

15811597
-- ----------------------------
15821598
-- Records of sms_home_recommend_product
15831599
-- ----------------------------
1584-
INSERT INTO `sms_home_recommend_product` VALUES ('2', '28', '小米 红米5A 全网通版 3GB+32GB 香槟金 移动联通电信4G手机 双卡双待', '0', '0');
1600+
INSERT INTO `sms_home_recommend_product` VALUES ('3', '26', '华为 HUAWEI P20 ', '1', '0');
1601+
INSERT INTO `sms_home_recommend_product` VALUES ('4', '27', '小米8 全面屏游戏智能手机 6GB+64GB 黑色 全网通4G 双卡双待', '1', '0');
1602+
INSERT INTO `sms_home_recommend_product` VALUES ('5', '28', '小米 红米5A 全网通版 3GB+32GB 香槟金 移动联通电信4G手机 双卡双待', '1', '0');
1603+
INSERT INTO `sms_home_recommend_product` VALUES ('6', '29', 'Apple iPhone 8 Plus 64GB 红色特别版 移动联通电信4G手机', '1', '0');
1604+
INSERT INTO `sms_home_recommend_product` VALUES ('7', '30', 'HLA海澜之家简约动物印花短袖T恤', '1', '100');
15851605

15861606
-- ----------------------------
15871607
-- Table structure for sms_home_recommend_subject
@@ -1594,14 +1614,17 @@ CREATE TABLE `sms_home_recommend_subject` (
15941614
`recommend_status` int(1) DEFAULT NULL,
15951615
`sort` int(11) DEFAULT NULL,
15961616
PRIMARY KEY (`id`)
1597-
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='首页推荐专题表';
1617+
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='首页推荐专题表';
15981618

15991619
-- ----------------------------
16001620
-- Records of sms_home_recommend_subject
16011621
-- ----------------------------
1602-
INSERT INTO `sms_home_recommend_subject` VALUES ('1', '1', 'polo衬衫的也时尚', '0', '100');
1603-
INSERT INTO `sms_home_recommend_subject` VALUES ('2', '2', '大牌手机低价秒', '0', '0');
1604-
INSERT INTO `sms_home_recommend_subject` VALUES ('3', '3', '晓龙845新品上市', '1', '0');
1622+
INSERT INTO `sms_home_recommend_subject` VALUES ('14', '1', 'polo衬衫的也时尚', '1', '0');
1623+
INSERT INTO `sms_home_recommend_subject` VALUES ('15', '2', '大牌手机低价秒', '1', '0');
1624+
INSERT INTO `sms_home_recommend_subject` VALUES ('16', '3', '晓龙845新品上市', '1', '0');
1625+
INSERT INTO `sms_home_recommend_subject` VALUES ('17', '4', '夏天应该穿什么', '1', '0');
1626+
INSERT INTO `sms_home_recommend_subject` VALUES ('18', '5', '夏季精选', '1', '100');
1627+
INSERT INTO `sms_home_recommend_subject` VALUES ('19', '6', '品牌手机降价', '1', '0');
16051628

16061629
-- ----------------------------
16071630
-- Table structure for ums_admin
@@ -1625,7 +1648,7 @@ CREATE TABLE `ums_admin` (
16251648
-- Records of ums_admin
16261649
-- ----------------------------
16271650
INSERT INTO `ums_admin` VALUES ('1', 'test', '202cb962ac59075b964b07152d234b70', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', null, '测试账号', null, '2018-09-29 13:55:30', '2018-09-29 13:55:39', '1');
1628-
INSERT INTO `ums_admin` VALUES ('3', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', 'admin@163.com', '系统管理员', '系统管理员', '2018-10-08 13:32:47', '2018-11-12 13:59:11', '1');
1651+
INSERT INTO `ums_admin` VALUES ('3', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', 'admin@163.com', '系统管理员', '系统管理员', '2018-10-08 13:32:47', '2018-11-13 09:49:27', '1');
16291652

16301653
-- ----------------------------
16311654
-- Table structure for ums_admin_login_log

mall-admin/src/main/java/com/macro/mall/controller/SmsHomeAdvertiseController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public Object updateStatus(@PathVariable Long id, Integer status) {
5353
}
5454

5555
@ApiOperation("获取广告详情")
56-
@RequestMapping(value = "/{id}", method = RequestMethod.POST)
56+
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
5757
@ResponseBody
5858
public Object getItem(@PathVariable Long id) {
5959
SmsHomeAdvertise advertise = advertiseService.getItem(id);

mall-admin/src/main/java/com/macro/mall/service/impl/SmsHomeAdvertiseServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class SmsHomeAdvertiseServiceImpl implements SmsHomeAdvertiseService {
2525

2626
@Override
2727
public int create(SmsHomeAdvertise advertise) {
28+
advertise.setClickCount(0);
29+
advertise.setOrderCount(0);
2830
return advertiseMapper.insert(advertise);
2931
}
3032

@@ -51,7 +53,7 @@ public SmsHomeAdvertise getItem(Long id) {
5153
@Override
5254
public int update(Long id, SmsHomeAdvertise advertise) {
5355
advertise.setId(id);
54-
return advertiseMapper.updateByPrimaryKey(advertise);
56+
return advertiseMapper.updateByPrimaryKeySelective(advertise);
5557
}
5658

5759
@Override

0 commit comments

Comments
 (0)