├── .gitignore ├── LICENSE ├── README.md ├── db ├── cats.json ├── goods.json ├── sql_clean.sql └── sql_init.sql ├── pom.xml └── src └── main ├── java └── com │ └── mall │ ├── Interceptor │ ├── authInterceptor.java │ └── postInterceptor.java │ ├── admin │ ├── action │ │ ├── AdminBaseAction.java │ │ ├── AdminGroupAction.java │ │ ├── AdminUserAction.java │ │ ├── GoodsAction.java │ │ ├── GoodsCatAction.java │ │ ├── HomeExtendAction.java │ │ ├── MerchantAction.java │ │ └── SecondKillAction.java │ ├── dao │ │ ├── AdminGroupDao.java │ │ ├── AdminUserDao.java │ │ ├── GoodsCatDao.java │ │ ├── GoodsDao.java │ │ ├── HomeExtendDao.java │ │ ├── MerchantDao.java │ │ ├── SecondKillDao.java │ │ └── impl │ │ │ ├── AdminGroupDaoImpl.java │ │ │ ├── AdminUserDaoImpl.java │ │ │ ├── GoodsCatDaoImpl.java │ │ │ ├── GoodsDaoImpl.java │ │ │ ├── HomeExtendDaoImpl.java │ │ │ ├── MerchantDaoImpl.java │ │ │ └── SecondKillDaoImpl.java │ └── service │ │ ├── AdminGroupService.java │ │ ├── AdminUserService.java │ │ ├── GoodsCatService.java │ │ ├── GoodsService.java │ │ ├── HomeExtendService.java │ │ ├── MerchantService.java │ │ ├── SecondKillService.java │ │ └── impl │ │ ├── AdminGroupServiceImpl.java │ │ ├── AdminUserServiceImpl.java │ │ ├── GoodsCatServiceImpl.java │ │ ├── GoodsServiceImpl.java │ │ ├── HomeExtendServiceImpl.java │ │ ├── MerchantServiceImpl.java │ │ └── SecondKillServiceImpl.java │ ├── common │ └── UploadAction.java │ ├── frontend │ ├── action │ │ ├── AddressAction.java │ │ ├── BaseAction.java │ │ ├── CartAction.java │ │ ├── GoodsAction.java │ │ ├── GoodsCommentAction.java │ │ ├── OrderAction.java │ │ └── UserAction.java │ ├── dao │ │ ├── AddressDao.java │ │ ├── GoodsCommentDao.java │ │ ├── OrderDao.java │ │ ├── ShoppingCartDao.java │ │ ├── UserDao.java │ │ └── impl │ │ │ ├── AddressDaoImpl.java │ │ │ ├── GoodsCommentDaoImpl.java │ │ │ ├── OrderDaoImpl.java │ │ │ ├── ShoppingCartDaoImpl.java │ │ │ └── UserDaoImpl.java │ └── service │ │ ├── AddressService.java │ │ ├── GoodsCommentService.java │ │ ├── OrderService.java │ │ ├── ShoppingCartService.java │ │ ├── UserService.java │ │ └── impl │ │ ├── AddressServiceImpl.java │ │ ├── GoodsCommentServiceImpl.java │ │ ├── OrderServiceImpl.java │ │ ├── ShoppingCartServiceImpl.java │ │ └── UserServiceImpl.java │ ├── model │ ├── Address.java │ ├── AdminGroup.java │ ├── AdminUser.java │ ├── Goods.java │ ├── GoodsAttr.java │ ├── GoodsCat.java │ ├── GoodsComment.java │ ├── GoodsDetail.java │ ├── GoodsGroup.java │ ├── HomeExtend.java │ ├── Merchant.java │ ├── Order.java │ ├── OrderDetail.java │ ├── SecondKill.java │ ├── ShoppingCart.java │ └── User.java │ └── utils │ ├── ResponseTemplate.java │ ├── Token.java │ └── sign.java ├── resources ├── admin.struts.xml ├── applicationContext.xml ├── frontend.struts.xml ├── log4j.properties ├── log4j2.xml ├── messageResource.properties └── struts.xml └── webapp ├── WEB-INF └── web.xml ├── index.jsp └── static └── img ├── attr └── 1.jpg ├── footer └── ico_service.png ├── freeback.png ├── goodDesc └── 1.jpg ├── goodsDetail ├── hot │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ └── 6.jpg ├── intro │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ └── 8.jpg ├── item-detail-1.jpg ├── item-detail-2.jpg ├── item-detail-3.jpg ├── item-detail-4.jpg └── pack │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ ├── 8.jpg │ └── 9.jpg ├── goodsImgs └── 1.jpg ├── goodsList ├── item-as-img-1.jpg ├── item-as-img-2.jpg ├── item-show-1.jpg ├── item-show-2.jpg ├── item-show-3.jpg ├── item-show-4.jpg ├── item-show-5.jpg ├── item-show-6.jpg ├── item-show-7.jpg └── item-show-8.jpg ├── index ├── clock.png ├── computer │ ├── item-computer-1-3.jpg │ ├── item-computer-1-4.jpg │ ├── item-computer-1-5.jpg │ ├── item-computer-1-6.jpg │ ├── item-computer-1-7.jpg │ ├── item-computer-1-8.jpg │ ├── item-computer-1.jpg │ ├── item-computer-2-1.jpg │ ├── item-computer-2-2.jpg │ ├── item-computer-2-3.jpg │ ├── item-computer-2-4.jpg │ ├── item-computer-2-5.jpg │ ├── item-computer-2-6.jpg │ ├── item-computer-2-7.jpg │ ├── item-computer-2-8.jpg │ └── item-computer-2.jpg ├── eat │ ├── item-eat-1-1.jpg │ ├── item-eat-1-2.jpg │ ├── item-eat-1-3.jpg │ ├── item-eat-1-4.jpg │ ├── item-eat-1-5.jpg │ ├── item-eat-1-6.jpg │ ├── item-eat-1-7.jpg │ ├── item-eat-1-8.jpg │ ├── item-eat-2-1.jpg │ ├── item-eat-2-2.jpg │ ├── item-eat-2-6.jpg │ ├── item-eat-2-7.jpg │ └── item-eat-2-8.jpg └── seckill │ ├── seckill-item1.jpg │ ├── seckill-item2.jpg │ ├── seckill-item3.jpg │ ├── seckill-item4.jpg │ └── seckill-item5.jpg ├── nav ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── nav_showimg1.jpg └── nav_showimg2.jpg ├── otherBuy ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg └── 8.jpg ├── pay-success.png ├── pay ├── pay-demo.png └── pay-qrscan.png ├── sale.jpg └── signup-sale.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Idea config 2 | /.idea/ 3 | 4 | 5 | # Vim 6 | tags 7 | *.swp 8 | 9 | # Build file 10 | /target/ 11 | /out/ 12 | 13 | jdbc.propert* 14 | /.settings/ 15 | /bin 16 | .classpath 17 | .project 18 | *.iml 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Gavin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mall-Server 2 | > 基于SSH的商城后台API应用 3 | 4 | ## 技术栈 5 | - Struts 2.5.16 6 | - Hibernate 5.0.7 7 | - Spring 5.1.7 8 | 9 | ## 开发环境 10 | > IDEA 2017 11 | 12 | ## 数据库 13 | > Mysql 14 | 15 | 16 | ## Maven 17 | 18 | 使用 Maven 来整合 SSH,详细配置见配置文件 `pom.xml` 19 | 20 | 使用 Spring 整合了 Struts2 和 Hibernate ,免去了冗余的 Hibernate 配置文件 `hibernate.cfg.xml` 。 21 | 22 | 23 | ## Build 24 | 25 | 使用 Idea 打开项目后,打开项目工程配置,标注 Spring 和 Struts2 的配置文件,然后配置 Tomcat 便可运行(记得配置 Deployment ) 26 | 27 | -------------------------------------------------------------------------------- /db/cats.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "catName": "食品", 5 | "childrenCats": [ 6 | "进口食品", 7 | "营养保健", 8 | "粮油干货", 9 | "冲饮乳品", 10 | "酒类", 11 | "茶叶", 12 | "生鲜水果" 13 | ] 14 | }, 15 | { 16 | "catName": "美妆护肤", 17 | "childrenCats": [ 18 | "美容护肤", 19 | "彩妆/香水/美妆工具", 20 | "美发/护发/假发", 21 | "沐浴/个人清洁", 22 | "美体/精油", 23 | "男士护肤", 24 | "口腔护理" 25 | ] 26 | }, 27 | { 28 | "catName": "服饰", 29 | "childrenCats": [ 30 | "服饰配件/皮带/帽子/围巾", 31 | "女装", 32 | "男装", 33 | "女士内衣/男士内衣/家居服", 34 | "运动户外" 35 | ] 36 | }, 37 | { 38 | "catName": "鞋类箱包", 39 | "childrenCats": [ 40 | "男鞋", 41 | "女鞋", 42 | "潮流女包", 43 | "精品男包", 44 | "功能箱包" 45 | ] 46 | }, 47 | { 48 | "catName": "母婴", 49 | "childrenCats": [ 50 | "奶粉", 51 | "辅食/营养品", 52 | "纸尿裤/湿巾", 53 | "哺育喂养", 54 | "清洁洗护", 55 | "玩具/早教/益智/积木/模型", 56 | "车床/出行/安全/家纺", 57 | "童装童鞋", 58 | "孕妈专区" 59 | ] 60 | }, 61 | { 62 | "catName": "居家日用", 63 | "childrenCats": [ 64 | "居家日用", 65 | "餐具水具", 66 | "厨具锅具", 67 | "床上用品", 68 | "家纺布艺", 69 | "宠物园艺", 70 | "收纳洗晒", 71 | "家装建材", 72 | "家具", 73 | "家饰", 74 | "成人用品", 75 | "卫生用品", 76 | "汽车用品" 77 | ] 78 | }, 79 | { 80 | "catName": "珠宝配饰", 81 | "childrenCats": [ 82 | "珠宝/钻石/翡翠/黄金", 83 | "腕表", 84 | "时尚饰品", 85 | "眼镜", 86 | "打火机/瑞士军刀" 87 | ] 88 | }, 89 | { 90 | "catName": "3C数码", 91 | "childrenCats": [ 92 | "手机", 93 | "手机配件", 94 | "电脑整机", 95 | "智能数码", 96 | "摄影摄像", 97 | "影音娱乐", 98 | "硬件存储", 99 | "数码配件", 100 | "办公设备", 101 | "文具耗材" 102 | ] 103 | }, 104 | { 105 | "catName": "家用电器", 106 | "childrenCats": [ 107 | "电视空调", 108 | "冰箱", 109 | "洗衣机", 110 | "厨房小电", 111 | "生活电器", 112 | "个护健康", 113 | "厨卫大电" 114 | ] 115 | }, 116 | { 117 | "catName": "图书音像", 118 | "childrenCats": [ 119 | "儿童读物", 120 | "畅销小说", 121 | "文学文艺", 122 | "电子书", 123 | "社科/经管", 124 | "育儿百科", 125 | "教育", 126 | "音像", 127 | "大牌乐器" 128 | ] 129 | }, 130 | { 131 | "catName": "医疗保健", 132 | "childrenCats": [ 133 | "中西医药品", 134 | "保健品", 135 | "滋补品", 136 | "医疗器械", 137 | "隐形眼镜", 138 | "健康服务", 139 | "体检", 140 | "整容整形", 141 | "按摩用品" 142 | ] 143 | }, 144 | { 145 | "catName": "古董收藏", 146 | "childrenCats": [ 147 | "玉器", 148 | "古董", 149 | "收藏", 150 | "字画" 151 | ] 152 | }, 153 | { 154 | "catName": "休闲娱乐", 155 | "childrenCats": [ 156 | "酒吧夜店", 157 | "KTV", 158 | "桑拿足浴", 159 | "洗浴汗蒸", 160 | "按摩", 161 | "电影院", 162 | "会馆会所", 163 | "文艺演出", 164 | "私人影院", 165 | "户外拓展", 166 | "室内游戏", 167 | "网吧网咖", 168 | "模玩/动漫/周边/cos", 169 | "休闲娱乐-其他" 170 | ] 171 | }, 172 | { 173 | "catName": "餐饮美食", 174 | "childrenCats": [ 175 | "火锅", 176 | "自助餐", 177 | "日韩料理", 178 | "小吃快餐", 179 | "西餐", 180 | "中式料理", 181 | "烧烤", 182 | "咖啡酒吧茶馆", 183 | "甜点饮品", 184 | "餐饮美食-其他" 185 | ] 186 | }, 187 | { 188 | "catName": "丽人", 189 | "childrenCats": [ 190 | "美发", 191 | "美容/SPA", 192 | "美甲美睫", 193 | "瘦身纤体", 194 | "瑜伽舞蹈", 195 | "纹绣", 196 | "产后塑性", 197 | "整形", 198 | "丽人-其他" 199 | ] 200 | }, 201 | { 202 | "catName": "旅游酒店", 203 | "childrenCats": [ 204 | "酒店", 205 | "度假村/农家乐/客栈", 206 | "旅馆旅社", 207 | "票务服务", 208 | "签证服务", 209 | "周边游", 210 | "其他游玩" 211 | ] 212 | }, 213 | { 214 | "catName": "汽车/交通", 215 | "childrenCats": [ 216 | "新车/二手车(品牌商)", 217 | "汽车(经销商)", 218 | "汽车租赁", 219 | "汽车美容/保养/用品", 220 | "汽车改装", 221 | "汽车陪练", 222 | "各类配件", 223 | "停车场", 224 | "航空公司", 225 | "汽车/交通-其他" 226 | ] 227 | }, 228 | { 229 | "catName": "商务办公", 230 | "childrenCats": [ 231 | "法律咨询", 232 | "财务会计评估", 233 | "广告策划公关", 234 | "人力资源", 235 | "网站建站", 236 | "翻译速记", 237 | "咨询顾问", 238 | "办公耗材", 239 | "办公设备", 240 | "印刷喷绘", 241 | "招商加盟", 242 | "商务办公-其他" 243 | ] 244 | }, 245 | { 246 | "catName": "便民生活", 247 | "childrenCats": [ 248 | "家政服务", 249 | "婚庆婚纱摄影", 250 | "搬家搬运", 251 | "维修疏通", 252 | "鲜花速递", 253 | "交友征婚", 254 | "摄影摄像", 255 | "物流快递", 256 | "洗衣店", 257 | "便民生活-其他" 258 | ] 259 | }, 260 | { 261 | "catName": "文化体育", 262 | "childrenCats": [ 263 | "比赛/文化活动/展览", 264 | "体育户外活动", 265 | "文化出版", 266 | "体育场馆", 267 | "图书馆", 268 | "文化体育-其他" 269 | ] 270 | }, 271 | { 272 | "catName": "学习培训", 273 | "childrenCats": [ 274 | "职业培训", 275 | "考试升学", 276 | "留学出国", 277 | "婴幼儿教育", 278 | "外语培训", 279 | "远程教育", 280 | "家教", 281 | "IT培训", 282 | "MBA管理培训", 283 | "教育出国-其他" 284 | ] 285 | }, 286 | { 287 | "catName": "房地产", 288 | "childrenCats": [ 289 | "商务租赁", 290 | "房产中介", 291 | "装潢设计", 292 | "楼盘销售", 293 | "建材施工", 294 | "房地产-其他" 295 | ] 296 | }, 297 | { 298 | "catName": "金融理财", 299 | "childrenCats": [ 300 | "基金证券", 301 | "银行服务", 302 | "保险产品", 303 | "金融投资", 304 | "理财产品", 305 | "金融理财-其他" 306 | ] 307 | }, 308 | { 309 | "catName": "网络游戏", 310 | "childrenCats": [ 311 | "网络游戏点卡", 312 | "网游装备/游戏币/帐号/代练", 313 | "网络游戏-其他" 314 | ] 315 | }, 316 | { 317 | "catName": "话费通信", 318 | "childrenCats": [ 319 | "移动/联通/电信充值", 320 | "手机号码/套餐/增值业务", 321 | "话费通信-其他" 322 | ] 323 | }, 324 | { 325 | "catName": "工农用品", 326 | "childrenCats": [ 327 | "工业用品", 328 | "新能源", 329 | "化工用品", 330 | "农具", 331 | "大型器械", 332 | "其他" 333 | ] 334 | }, 335 | { 336 | "catName": "其他", 337 | "childrenCats": [ 338 | "其他" 339 | ] 340 | } 341 | ] 342 | } 343 | -------------------------------------------------------------------------------- /db/sql_clean.sql: -------------------------------------------------------------------------------- 1 | -- 生成删除表的 sql 语句 2 | -- SELECT CONCAT('drop table ',table_name,';') FROM information_schema.`TABLES` WHERE table_schema='ssh_mall'; 3 | 4 | drop table admin_group; 5 | drop table admin_user; 6 | drop table admin_user_admin_group; 7 | drop table admin_users_groups; 8 | drop table goods; 9 | drop table goods_attr; 10 | drop table goods_cat; 11 | drop table goods_comment; 12 | drop table goods_detail; 13 | drop table goods_goods_attr; 14 | drop table goods_goods_comment; 15 | drop table goods_goods_detail; 16 | drop table goods_goods_group; 17 | drop table goods_group; 18 | drop table goods_groups; 19 | drop table merchant; 20 | drop table goods; 21 | drop table goods_attr; 22 | drop table goods_cat; 23 | drop table home_extend; 24 | drop table merchant; 25 | drop table second_kill; -------------------------------------------------------------------------------- /src/main/java/com/mall/Interceptor/authInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.mall.Interceptor; 2 | 3 | import com.mall.model.User; 4 | import com.mall.utils.ResponseTemplate; 5 | import com.mall.utils.Token; 6 | import com.opensymphony.xwork2.ActionContext; 7 | import com.opensymphony.xwork2.ActionInvocation; 8 | import com.opensymphony.xwork2.interceptor.AbstractInterceptor; 9 | import com.opensymphony.xwork2.util.ValueStack; 10 | import org.apache.struts2.ServletActionContext; 11 | 12 | public class authInterceptor extends AbstractInterceptor { 13 | 14 | @Override 15 | public String intercept(ActionInvocation actionInvocation) throws Exception { 16 | String token = ServletActionContext.getRequest().getHeader("x-access-token"); 17 | 18 | if (token != null) { 19 | User user = Token.validToken(token, User.class); 20 | if (user != null) { 21 | ServletActionContext.getRequest().setAttribute("tokenData", user); 22 | actionInvocation.invoke(); 23 | return null; 24 | } 25 | } 26 | ActionContext context = ActionContext.getContext(); 27 | ValueStack stack = context.getValueStack(); 28 | stack.set("jsonResult", ResponseTemplate.error(1, "请传输正确token")); 29 | return "success"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mall/Interceptor/postInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.mall.Interceptor; 2 | 3 | import com.opensymphony.xwork2.ActionContext; 4 | import com.opensymphony.xwork2.ActionInvocation; 5 | import com.opensymphony.xwork2.interceptor.AbstractInterceptor; 6 | import com.opensymphony.xwork2.util.ValueStack; 7 | import org.apache.struts2.ServletActionContext; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | public class postInterceptor extends AbstractInterceptor { 14 | /** 15 | * 只允许POST访问拦截器 16 | * @param actionInvocation 17 | * @return 18 | * @throws Exception 19 | */ 20 | @Override 21 | public String intercept(ActionInvocation actionInvocation) throws Exception { 22 | // 解决跨域 23 | HttpServletResponse res = ServletActionContext.getResponse(); 24 | res.setHeader("Access-Control-Allow-Origin", "*"); 25 | res.setHeader("Access-Control-Allow-Credentials", "true"); 26 | res.setHeader("Access-Control-Allow-Methods", "*"); 27 | res.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token"); 28 | res.setHeader("Access-Control-Expose-Headers", "*"); 29 | 30 | String method = ServletActionContext.getRequest().getMethod(); 31 | if (method.equals("POST")) { 32 | actionInvocation.invoke(); 33 | return null; 34 | } else { 35 | ActionContext context = ActionContext.getContext(); 36 | Map jsonResult = new HashMap(); 37 | jsonResult.put("rcode", 1); 38 | jsonResult.put("message", "just allow post method"); 39 | jsonResult.put("result", ""); 40 | ValueStack stack = context.getValueStack(); 41 | stack.set("jsonResult", jsonResult); 42 | return "success"; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/AdminBaseAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | 4 | import com.opensymphony.xwork2.ActionSupport; 5 | import org.apache.struts2.ServletActionContext; 6 | import org.springframework.context.annotation.Scope; 7 | import org.springframework.stereotype.Controller; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import java.util.Map; 11 | 12 | @Controller 13 | @Scope("prototype") 14 | public class AdminBaseAction extends ActionSupport { 15 | 16 | public int DEFAULT_PAGE = 1; 17 | public int DEFAULT_PAGE_SIZE = 15; 18 | 19 | public Map jsonResult; 20 | 21 | // 检查是否有 Page 相关参数 22 | protected boolean hasParam(String paramName) { 23 | HttpServletRequest req = ServletActionContext.getRequest(); 24 | String paramValue = req.getParameter(paramName); 25 | 26 | return !(paramValue == null); 27 | } 28 | 29 | // 检查是否有 Page 相关参数 30 | protected boolean hasPageSetting() { 31 | return hasParam("page") || hasParam("pageSize"); 32 | } 33 | 34 | // 获取排序设置,默认为 ID 35 | protected String getOrderSetting() { 36 | if (!hasParam("order")) { 37 | return "id"; 38 | } 39 | return getParam("order"); 40 | } 41 | 42 | // 获取参数 43 | protected String getParam(String paramName) { 44 | HttpServletRequest req = ServletActionContext.getRequest(); 45 | String paramValue = req.getParameter(paramName); 46 | return paramValue; 47 | } 48 | 49 | // 获取 Page 配置 50 | protected int getPageSetting() { 51 | HttpServletRequest req = ServletActionContext.getRequest(); 52 | String paramPage= req.getParameter("page"); 53 | 54 | if (paramPage == null) { 55 | return DEFAULT_PAGE; 56 | } 57 | return Integer.parseInt(paramPage); 58 | } 59 | 60 | // 获取 PageSize 配置 61 | protected int getPageSizeSetting() { 62 | HttpServletRequest req = ServletActionContext.getRequest(); 63 | String paramPageSize= req.getParameter("pageSize"); 64 | 65 | if (paramPageSize == null) { 66 | return DEFAULT_PAGE_SIZE; 67 | } 68 | return Integer.parseInt(paramPageSize); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/AdminGroupAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.AdminGroupService; 4 | import com.mall.model.AdminGroup; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class AdminGroupAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private AdminGroupService adminGroupService; 18 | 19 | private AdminGroup adminGroup; 20 | private List adminGroups; 21 | 22 | public Map jsonResult; 23 | 24 | // 列出所有 25 | public String list() { 26 | // 分页设置 27 | if (hasPageSetting()) { 28 | int page = getPageSetting(); 29 | int pageSize = getPageSizeSetting(); 30 | 31 | adminGroups = adminGroupService.findByPage(page, pageSize); 32 | } else { 33 | adminGroups = adminGroupService.findAll(); 34 | } 35 | 36 | Map map = new HashMap<>(); 37 | map.put("data", adminGroups); 38 | jsonResult = ResponseTemplate.success(map); 39 | return SUCCESS; 40 | } 41 | 42 | // 列出一个 43 | public String get() { 44 | if (this.adminGroup == null) { 45 | jsonResult = ResponseTemplate.error(-1, "Param adminGroup is required!"); 46 | return SUCCESS; 47 | } 48 | 49 | Map map = new HashMap<>(); 50 | adminGroup = adminGroupService.findById(this.adminGroup.getId()); 51 | map.put("data", adminGroup); 52 | jsonResult = ResponseTemplate.success(map); 53 | return SUCCESS; 54 | } 55 | 56 | // 添加 57 | public String add() { 58 | if (this.adminGroup == null) { 59 | jsonResult = ResponseTemplate.error(-1, "Param adminGroup is required!"); 60 | return SUCCESS; 61 | } 62 | 63 | int status = adminGroupService.save(this.adminGroup); 64 | System.out.println(status); 65 | 66 | if (status > 0) { 67 | Map map = new HashMap<>(); 68 | map.put("data", adminGroup); 69 | jsonResult = ResponseTemplate.success(map); 70 | } else { 71 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 72 | } 73 | return SUCCESS; 74 | } 75 | 76 | // 更新 77 | public String update() { 78 | if (this.adminGroup == null) { 79 | jsonResult = ResponseTemplate.error(-1, "Param adminGroup is required!"); 80 | return SUCCESS; 81 | } 82 | 83 | adminGroupService.update(adminGroup); 84 | 85 | Map map = new HashMap<>(); 86 | map.put("data", adminGroup); 87 | jsonResult = ResponseTemplate.success(map); 88 | return SUCCESS; 89 | } 90 | 91 | // 删除 92 | public String delete() { 93 | if (this.adminGroup == null) { 94 | jsonResult = ResponseTemplate.error(-1, "Param adminGroup is required!"); 95 | return SUCCESS; 96 | } 97 | 98 | adminGroupService.delete(this.adminGroup); 99 | 100 | // Set status code 101 | HttpServletResponse res = ServletActionContext.getResponse(); 102 | res.setStatus(400); 103 | 104 | Map map = new HashMap<>(); 105 | jsonResult = ResponseTemplate.success(map); 106 | return SUCCESS; 107 | } 108 | 109 | public void setAdminGroup(AdminGroup adminGroup) { 110 | this.adminGroup = adminGroup; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/AdminUserAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.AdminUserService; 4 | import com.mall.model.AdminUser; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class AdminUserAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private AdminUserService adminUserService; 18 | 19 | private AdminUser adminUser; 20 | private List adminUsers; 21 | 22 | public Map jsonResult; 23 | 24 | // 列出所有 25 | public String list() { 26 | // 分页设置 27 | if (hasPageSetting()) { 28 | int page = getPageSetting(); 29 | int pageSize = getPageSizeSetting(); 30 | 31 | adminUsers = adminUserService.findByPage(page, pageSize); 32 | } else { 33 | adminUsers = adminUserService.findAll(); 34 | } 35 | 36 | Map map = new HashMap<>(); 37 | map.put("data", adminUsers); 38 | jsonResult = ResponseTemplate.success(map); 39 | return SUCCESS; 40 | } 41 | 42 | // 列出一个 43 | public String get() { 44 | if (this.adminUser == null) { 45 | jsonResult = ResponseTemplate.error(-1, "Param adminUser is required!"); 46 | return SUCCESS; 47 | } 48 | 49 | Map map = new HashMap<>(); 50 | adminUser = adminUserService.findById(this.adminUser.getId()); 51 | map.put("data", adminUser); 52 | jsonResult = ResponseTemplate.success(map); 53 | return SUCCESS; 54 | } 55 | 56 | // 添加 57 | public String add() { 58 | if (this.adminUser == null) { 59 | jsonResult = ResponseTemplate.error(-1, "Param adminUser is required!"); 60 | return SUCCESS; 61 | } 62 | 63 | int status = adminUserService.save(this.adminUser); 64 | System.out.println(status); 65 | 66 | if (status > 0) { 67 | Map map = new HashMap<>(); 68 | map.put("data", adminUser); 69 | jsonResult = ResponseTemplate.success(map); 70 | } else { 71 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 72 | } 73 | return SUCCESS; 74 | } 75 | 76 | // 更新 77 | public String update() { 78 | if (this.adminUser == null) { 79 | jsonResult = ResponseTemplate.error(-1, "Param adminUser is required!"); 80 | return SUCCESS; 81 | } 82 | 83 | adminUserService.update(adminUser); 84 | 85 | Map map = new HashMap<>(); 86 | map.put("data", adminUser); 87 | jsonResult = ResponseTemplate.success(map); 88 | return SUCCESS; 89 | } 90 | 91 | // 删除 92 | public String delete() { 93 | if (this.adminUser == null) { 94 | jsonResult = ResponseTemplate.error(-1, "Param adminUser is required!"); 95 | return SUCCESS; 96 | } 97 | 98 | adminUserService.delete(this.adminUser); 99 | 100 | // Set status code 101 | HttpServletResponse res = ServletActionContext.getResponse(); 102 | res.setStatus(400); 103 | 104 | Map map = new HashMap<>(); 105 | jsonResult = ResponseTemplate.success(map); 106 | return SUCCESS; 107 | } 108 | 109 | public void setAdminUser(AdminUser adminUser) { 110 | this.adminUser = adminUser; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/GoodsAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.GoodsService; 4 | import com.mall.model.Goods; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class GoodsAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private GoodsService goodsService; 18 | 19 | private Goods goods; 20 | private List goodses; 21 | 22 | public Map jsonResult; 23 | 24 | public String list() { 25 | String orderKeys; 26 | 27 | // 默认按照销售总数排序 28 | if (hasParam("order")) { 29 | orderKeys = getParam("order"); 30 | } else { 31 | orderKeys = "salesNum"; 32 | } 33 | 34 | int count; 35 | 36 | if (hasPageSetting()) { 37 | int page = getPageSetting(); 38 | int pageSize = getPageSizeSetting(); 39 | 40 | // 根据参数判断用户是否要根据指定值查找 41 | if (hasParam("goodsName")) { 42 | String goodsName = getParam("goodsName"); 43 | goodses = goodsService.findByGoodsNameAndPage(goodsName, page, pageSize, orderKeys); 44 | count = goodsService.getCountByGoodsName(goodsName); 45 | } else if (hasParam("catId")) { 46 | int catId = Integer.parseInt(getParam("catId")); 47 | goodses = goodsService.findByCatIdAndPage(catId, page, pageSize, orderKeys); 48 | count = goodsService.getCountByCatId(catId); 49 | } else if (hasParam("merchantId")) { 50 | int merchantId = Integer.parseInt(getParam("merchantId")); 51 | goodses = goodsService.findByMerchantIdAndPage(merchantId, page, pageSize, orderKeys); 52 | count = goodsService.getCountByMerchantId(merchantId); 53 | } else { 54 | goodses = goodsService.findByPage(page, pageSize, orderKeys); 55 | count = goodsService.getCount(); 56 | } 57 | } else { 58 | if (hasParam("goodsName")) { 59 | String goodsName = getParam("goodsName"); 60 | goodses = goodsService.findByGoodsName(getParam("goodsName"), orderKeys); 61 | count = goodsService.getCountByGoodsName(goodsName); 62 | } else if (hasParam("catId")) { 63 | int catId = Integer.parseInt(getParam("catId")); 64 | goodses = goodsService.findByCatId(Integer.parseInt(getParam("catId")), orderKeys); 65 | count = goodsService.getCountByCatId(catId); 66 | } else if (hasParam("merchantId")) { 67 | int merchantId = Integer.parseInt("merchantId"); 68 | goodses = goodsService.findByMerchantId(Integer.parseInt(getParam("merchantId")), orderKeys); 69 | count = goodsService.getCountByMerchantId(merchantId); 70 | } else { 71 | goodses = goodsService.findAll(orderKeys); 72 | count = goodsService.getCount(); 73 | } 74 | } 75 | 76 | Map map = new HashMap<>(); 77 | map.put("data", goodses); 78 | 79 | // 加上商品总数 80 | map.put("goodsSum", count); 81 | jsonResult = ResponseTemplate.success(map); 82 | return SUCCESS; 83 | } 84 | 85 | // 列出一个 86 | public String get() { 87 | if (this.goods == null) { 88 | jsonResult = ResponseTemplate.error(-1, "Param goods is required!"); 89 | return SUCCESS; 90 | } 91 | 92 | Map map = new HashMap<>(); 93 | goods = goodsService.findById(this.goods.getId()); 94 | map.put("data", goods); 95 | jsonResult = ResponseTemplate.success(map); 96 | return SUCCESS; 97 | } 98 | 99 | // 添加 100 | public String add() { 101 | if (this.goods == null) { 102 | jsonResult = ResponseTemplate.error(-1, "Param goods is required!"); 103 | return SUCCESS; 104 | } 105 | 106 | int status = goodsService.save(this.goods); 107 | if (status > 0) { 108 | Map map = new HashMap<>(); 109 | map.put("data", goods); 110 | jsonResult = ResponseTemplate.success(map); 111 | } else { 112 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 113 | } 114 | return SUCCESS; 115 | } 116 | 117 | // 更新 118 | public String update() { 119 | if (this.goods == null) { 120 | jsonResult = ResponseTemplate.error(-1, "Param goods is required!"); 121 | return SUCCESS; 122 | } 123 | System.out.println(goods.getGoodsAttrs().size()); 124 | System.out.println(goods.getGoodsName()); 125 | System.out.println(goods.getGoodsImgs()); 126 | System.out.println(goods.getGoodsDesc()); 127 | 128 | goodsService.update(goods); 129 | 130 | Map map = new HashMap<>(); 131 | map.put("data", goods); 132 | jsonResult = ResponseTemplate.success(map); 133 | return SUCCESS; 134 | } 135 | 136 | // 删除 137 | public String delete() { 138 | if (this.goods == null) { 139 | jsonResult = ResponseTemplate.error(-1, "Param goods is required!"); 140 | return SUCCESS; 141 | } 142 | 143 | goodsService.delete(this.goods); 144 | 145 | // Set status code 146 | HttpServletResponse res = ServletActionContext.getResponse(); 147 | res.setStatus(400); 148 | 149 | Map map = new HashMap<>(); 150 | jsonResult = ResponseTemplate.success(map); 151 | return SUCCESS; 152 | } 153 | 154 | public void setGoods(Goods goods) { 155 | this.goods = goods; 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/GoodsCatAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.GoodsCatService; 4 | import com.mall.model.GoodsCat; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class GoodsCatAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private GoodsCatService goodsCatService; 18 | 19 | private GoodsCat goodsCat; 20 | private List goodsCats; 21 | 22 | public Map jsonResult; 23 | 24 | // 列出所有 25 | public String list() { 26 | goodsCats = goodsCatService.findAll(); 27 | 28 | Map map = new HashMap<>(); 29 | map.put("data", goodsCats); 30 | jsonResult = ResponseTemplate.success(map); 31 | return SUCCESS; 32 | } 33 | 34 | // 列出一个 35 | public String get() { 36 | if (this.goodsCat == null) { 37 | jsonResult = ResponseTemplate.error(-1, "Param goodsCat is required!"); 38 | return SUCCESS; 39 | } 40 | 41 | Map map = new HashMap<>(); 42 | goodsCat = goodsCatService.findById(this.goodsCat.getId()); 43 | map.put("data", goodsCat); 44 | jsonResult = ResponseTemplate.success(map); 45 | return SUCCESS; 46 | } 47 | 48 | // 添加 49 | public String add() { 50 | if (this.goodsCat == null) { 51 | jsonResult = ResponseTemplate.error(-1, "Param goodsCat is required!"); 52 | return SUCCESS; 53 | } 54 | 55 | int status = goodsCatService.save(this.goodsCat); 56 | System.out.println(status); 57 | 58 | if (status > 0) { 59 | Map map = new HashMap<>(); 60 | map.put("data", goodsCat); 61 | jsonResult = ResponseTemplate.success(map); 62 | } else { 63 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 64 | } 65 | return SUCCESS; 66 | } 67 | 68 | // 更新 69 | public String update() { 70 | if (this.goodsCat == null) { 71 | jsonResult = ResponseTemplate.error(-1, "Param goodsCat is required!"); 72 | return SUCCESS; 73 | } 74 | 75 | goodsCatService.update(goodsCat); 76 | 77 | Map map = new HashMap<>(); 78 | map.put("data", goodsCat); 79 | jsonResult = ResponseTemplate.success(map); 80 | return SUCCESS; 81 | } 82 | 83 | // 删除 84 | public String delete() { 85 | if (this.goodsCat == null) { 86 | jsonResult = ResponseTemplate.error(-1, "Param goodsCat is required!"); 87 | return SUCCESS; 88 | } 89 | 90 | goodsCatService.delete(this.goodsCat); 91 | 92 | // Set status code 93 | HttpServletResponse res = ServletActionContext.getResponse(); 94 | res.setStatus(400); 95 | 96 | Map map = new HashMap<>(); 97 | jsonResult = ResponseTemplate.success(map); 98 | return SUCCESS; 99 | } 100 | 101 | public void setGoodsCat(GoodsCat goodsCat) { 102 | this.goodsCat = goodsCat; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/HomeExtendAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.HomeExtendService; 4 | import com.mall.model.HomeExtend; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class HomeExtendAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private HomeExtendService homeExtendService; 18 | 19 | private HomeExtend homeExtend; 20 | private List homeExtends; 21 | 22 | public Map jsonResult; 23 | 24 | // 列出所有 25 | public String list() { 26 | // 分页设置 27 | if (hasPageSetting()) { 28 | int page = getPageSetting(); 29 | int pageSize = getPageSizeSetting(); 30 | 31 | homeExtends = homeExtendService.findByPage(page, pageSize); 32 | } else { 33 | homeExtends = homeExtendService.findAll(); 34 | } 35 | 36 | Map map = new HashMap<>(); 37 | map.put("data", homeExtends); 38 | jsonResult = ResponseTemplate.success(map); 39 | return SUCCESS; 40 | } 41 | 42 | // 列出一个 43 | public String get() { 44 | if (this.homeExtend == null) { 45 | jsonResult = ResponseTemplate.error(-1, "Param homeExtend is required!"); 46 | return SUCCESS; 47 | } 48 | 49 | Map map = new HashMap<>(); 50 | homeExtend = homeExtendService.findById(this.homeExtend.getId()); 51 | map.put("data", homeExtend); 52 | jsonResult = ResponseTemplate.success(map); 53 | return SUCCESS; 54 | } 55 | 56 | // 添加 57 | public String add() { 58 | if (this.homeExtend == null) { 59 | jsonResult = ResponseTemplate.error(-1, "Param homeExtend is required!"); 60 | return SUCCESS; 61 | } 62 | 63 | int status = homeExtendService.save(this.homeExtend); 64 | System.out.println(status); 65 | 66 | if (status > 0) { 67 | Map map = new HashMap<>(); 68 | map.put("data", homeExtend); 69 | jsonResult = ResponseTemplate.success(map); 70 | } else { 71 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 72 | } 73 | return SUCCESS; 74 | } 75 | 76 | // 更新 77 | public String update() { 78 | if (this.homeExtend == null) { 79 | jsonResult = ResponseTemplate.error(-1, "Param homeExtend is required!"); 80 | return SUCCESS; 81 | } 82 | 83 | homeExtendService.update(homeExtend); 84 | 85 | Map map = new HashMap<>(); 86 | map.put("data", homeExtend); 87 | jsonResult = ResponseTemplate.success(map); 88 | return SUCCESS; 89 | } 90 | 91 | // 删除 92 | public String delete() { 93 | if (this.homeExtend == null) { 94 | jsonResult = ResponseTemplate.error(-1, "Param homeExtend is required!"); 95 | return SUCCESS; 96 | } 97 | 98 | homeExtendService.delete(this.homeExtend); 99 | 100 | // Set status code 101 | HttpServletResponse res = ServletActionContext.getResponse(); 102 | res.setStatus(400); 103 | 104 | Map map = new HashMap<>(); 105 | jsonResult = ResponseTemplate.success(map); 106 | return SUCCESS; 107 | } 108 | 109 | public void setHomeExtend(HomeExtend homeExtend) { 110 | this.homeExtend = homeExtend; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/MerchantAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.MerchantService; 4 | import com.mall.model.Merchant; 5 | import com.mall.utils.ResponseTemplate; 6 | import com.mall.utils.Token; 7 | import com.mall.utils.sign; 8 | import org.apache.struts2.ServletActionContext; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.util.HashMap; 13 | import java.util.LinkedHashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | public class MerchantAction extends AdminBaseAction { 18 | 19 | @Autowired 20 | private MerchantService merchantService; 21 | 22 | private Merchant merchant = new Merchant(); 23 | private List merchants; 24 | 25 | public Map jsonResult; 26 | 27 | // 列出所有 28 | public String list() { 29 | // 分页设置 30 | if (hasPageSetting()) { 31 | int page = getPageSetting(); 32 | int pageSize = getPageSizeSetting(); 33 | 34 | merchants = merchantService.findByPage(page, pageSize); 35 | } else { 36 | merchants = merchantService.findAll(); 37 | } 38 | 39 | Map map = new HashMap<>(); 40 | 41 | map.put("data", merchants); 42 | jsonResult = ResponseTemplate.success(map); 43 | return SUCCESS; 44 | } 45 | 46 | // 列出一个 47 | public String get() { 48 | if (this.merchant == null) { 49 | jsonResult = ResponseTemplate.error(-1, "Param merchant is required!"); 50 | return SUCCESS; 51 | } 52 | 53 | Map map = new HashMap<>(); 54 | merchant = merchantService.findById(this.merchant.getId()); 55 | map.put("data", merchant); 56 | jsonResult = ResponseTemplate.success(map); 57 | return SUCCESS; 58 | } 59 | 60 | // 添加 61 | public String add() { 62 | if (this.merchant == null) { 63 | jsonResult = ResponseTemplate.error(-1, "Param merchant is required!"); 64 | return SUCCESS; 65 | } 66 | 67 | int status = merchantService.save(this.merchant); 68 | System.out.println(status); 69 | 70 | if (status > 0) { 71 | Map map = new HashMap<>(); 72 | map.put("data", merchant); 73 | jsonResult = ResponseTemplate.success(map); 74 | } else { 75 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 76 | } 77 | return SUCCESS; 78 | } 79 | 80 | // 更新 81 | public String update() { 82 | if (this.merchant == null) { 83 | jsonResult = ResponseTemplate.error(-1, "Param merchant is required!"); 84 | return SUCCESS; 85 | } 86 | 87 | merchantService.update(merchant); 88 | 89 | Map map = new HashMap<>(); 90 | map.put("data", merchant); 91 | jsonResult = ResponseTemplate.success(map); 92 | return SUCCESS; 93 | } 94 | 95 | // 删除 96 | public String delete() { 97 | if (this.merchant == null) { 98 | jsonResult = ResponseTemplate.error(-1, "Param merchant is required!"); 99 | return SUCCESS; 100 | } 101 | 102 | merchantService.delete(this.merchant); 103 | 104 | // Set status code 105 | HttpServletResponse res = ServletActionContext.getResponse(); 106 | res.setStatus(400); 107 | 108 | Map map = new HashMap<>(); 109 | jsonResult = ResponseTemplate.success(map); 110 | return SUCCESS; 111 | } 112 | 113 | /** 114 | * 注册 115 | * @return 116 | */ 117 | public String signUp() { 118 | String encodePwd = sign.md5(merchant.getAdminPass()); 119 | merchant.setAdminPass(encodePwd); 120 | int result = merchantService.save(merchant); 121 | if (result > 0) { 122 | jsonResult = ResponseTemplate.success( null); 123 | } else { 124 | jsonResult = ResponseTemplate.error(101, "注册错误"); 125 | } 126 | return SUCCESS; 127 | } 128 | 129 | /** 130 | * 登陆 131 | * @return 132 | */ 133 | public String login() { 134 | Merchant merchant = merchantService.isAllowLogin(this.merchant.getMerchantName(), this.merchant.getAdminPass()); 135 | if (merchant != null) { 136 | String str = Token.createToken(merchant, 3600 * 60); 137 | Map data = new LinkedHashMap<>(); 138 | data.put("username", merchant.getMerchantName()); 139 | data.put("desc", merchant.getMerchantName()); 140 | data.put("token", str); 141 | jsonResult = ResponseTemplate.success(data); 142 | } else { 143 | jsonResult = ResponseTemplate.error(102, "登陆失败"); 144 | } 145 | return SUCCESS; 146 | } 147 | 148 | public void setMerchant(Merchant merchant) { 149 | this.merchant = merchant; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/action/SecondKillAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.action; 2 | 3 | import com.mall.admin.service.SecondKillService; 4 | import com.mall.model.SecondKill; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.apache.struts2.ServletActionContext; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class SecondKillAction extends AdminBaseAction { 15 | 16 | @Autowired 17 | private SecondKillService secondKillService; 18 | 19 | private SecondKill secondKill; 20 | private List secondKills; 21 | 22 | public Map jsonResult; 23 | 24 | // 列出所有 25 | public String list() { 26 | // 分页设置 27 | if (hasPageSetting()) { 28 | int page = getPageSetting(); 29 | int pageSize = getPageSizeSetting(); 30 | 31 | secondKills = secondKillService.findByPage(page, pageSize); 32 | } else { 33 | secondKills = secondKillService.findAll(); 34 | } 35 | 36 | Map map = new HashMap<>(); 37 | map.put("data", secondKills); 38 | jsonResult = ResponseTemplate.success(map); 39 | return SUCCESS; 40 | } 41 | 42 | // 列出一个 43 | public String get() { 44 | if (this.secondKill == null) { 45 | jsonResult = ResponseTemplate.error(-1, "Param secondKill is required!"); 46 | return SUCCESS; 47 | } 48 | 49 | Map map = new HashMap<>(); 50 | secondKill = secondKillService.findById(this.secondKill.getId()); 51 | map.put("data", secondKill); 52 | jsonResult = ResponseTemplate.success(map); 53 | return SUCCESS; 54 | } 55 | 56 | // 添加 57 | public String add() { 58 | if (this.secondKill == null) { 59 | jsonResult = ResponseTemplate.error(-1, "Param secondKill is required!"); 60 | return SUCCESS; 61 | } 62 | 63 | int status = secondKillService.save(this.secondKill); 64 | System.out.println(status); 65 | 66 | if (status > 0) { 67 | Map map = new HashMap<>(); 68 | map.put("data", secondKill); 69 | jsonResult = ResponseTemplate.success(map); 70 | } else { 71 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 72 | } 73 | return SUCCESS; 74 | } 75 | 76 | // 更新 77 | public String update() { 78 | if (this.secondKill == null) { 79 | jsonResult = ResponseTemplate.error(-1, "Param secondKill is required!"); 80 | return SUCCESS; 81 | } 82 | 83 | secondKillService.update(secondKill); 84 | 85 | Map map = new HashMap<>(); 86 | map.put("data", secondKill); 87 | jsonResult = ResponseTemplate.success(map); 88 | return SUCCESS; 89 | } 90 | 91 | // 删除 92 | public String delete() { 93 | if (this.secondKill == null) { 94 | jsonResult = ResponseTemplate.error(-1, "Param secondKill is required!"); 95 | return SUCCESS; 96 | } 97 | 98 | secondKillService.delete(this.secondKill); 99 | 100 | // Set status code 101 | HttpServletResponse res = ServletActionContext.getResponse(); 102 | res.setStatus(400); 103 | 104 | Map map = new HashMap<>(); 105 | jsonResult = ResponseTemplate.success(map); 106 | return SUCCESS; 107 | } 108 | 109 | public void setSecondKill(SecondKill secondKill) { 110 | this.secondKill = secondKill; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/AdminGroupDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | import com.mall.model.AdminGroup; 4 | 5 | import java.util.List; 6 | 7 | public interface AdminGroupDao { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int page, int pageSize); 12 | 13 | AdminGroup findById(int id); 14 | 15 | int save(AdminGroup adminGroup); 16 | 17 | void update(AdminGroup adminGroup); 18 | 19 | void delete(AdminGroup adminGroup); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/AdminUserDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | import com.mall.model.AdminUser; 4 | 5 | import java.util.List; 6 | 7 | public interface AdminUserDao { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int page, int pageSize); 12 | 13 | AdminUser findById(int id); 14 | 15 | int save(AdminUser adminUser); 16 | 17 | void update(AdminUser adminUser); 18 | 19 | void delete(AdminUser adminUser); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/GoodsCatDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | 4 | import com.mall.model.GoodsCat; 5 | 6 | import java.util.List; 7 | 8 | public interface GoodsCatDao { 9 | 10 | List findAll(); 11 | 12 | List findByParentId(int catId); 13 | 14 | GoodsCat findById(int id); 15 | 16 | int save(GoodsCat goodsCat); 17 | 18 | void update(GoodsCat goodsCat); 19 | 20 | void delete(GoodsCat goodsCat); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/GoodsDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | 4 | import com.mall.model.Goods; 5 | 6 | import java.util.List; 7 | 8 | public interface GoodsDao { 9 | 10 | List findAll(String orderKeys); 11 | 12 | List findByGoodsName(String goodsName, String orderKeys); 13 | 14 | List findByGoodsNameAndPage(String goodsName, int page, int pageSize, String oderKeys); 15 | 16 | List findByMerchantId(int merchantId, String orderKeys); 17 | 18 | List findByMerchantIdAndPage(int merchantId, int page, int pageSize, String orderKeys); 19 | 20 | List findByCatId(int catId, String orderKeys); 21 | 22 | List findByCatIdAndPage(int catId, int page, int pageSize, String orderKeys); 23 | 24 | List findByPage(int page, int pageSize, String orderKeys); 25 | 26 | int getCount(); 27 | 28 | int getCountByGoodsName(String goodsName); 29 | 30 | int getCountByMerchantId(int merchantId); 31 | 32 | int getCountByCatId(int catId); 33 | 34 | Goods findById(int id); 35 | 36 | int save(Goods goods); 37 | 38 | void update(Goods goods); 39 | 40 | void delete(Goods goods); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/HomeExtendDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | 4 | import com.mall.model.HomeExtend; 5 | 6 | import java.util.List; 7 | 8 | public interface HomeExtendDao { 9 | 10 | List findAll(); 11 | 12 | List findByPage(int page, int pageSize); 13 | 14 | HomeExtend findById(int id); 15 | 16 | int save(HomeExtend homeExtend); 17 | 18 | void update(HomeExtend homeExtend); 19 | 20 | void delete(HomeExtend homeExtend); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/MerchantDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | 4 | import com.mall.model.Merchant; 5 | 6 | import java.util.List; 7 | 8 | public interface MerchantDao { 9 | 10 | List findAll(); 11 | 12 | List findByPage(int page, int pageSize); 13 | 14 | List getMerchantByMerchantName(String merchantName); 15 | 16 | Merchant findById(int id); 17 | 18 | int save(Merchant merchant); 19 | 20 | void update(Merchant merchant); 21 | 22 | void delete(Merchant merchant); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/SecondKillDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao; 2 | 3 | 4 | import com.mall.model.SecondKill; 5 | 6 | import java.util.List; 7 | 8 | public interface SecondKillDao { 9 | 10 | List findAll(); 11 | 12 | List findByPage(int page, int pageSize); 13 | 14 | SecondKill findById(int id); 15 | 16 | int save(SecondKill secondKill); 17 | 18 | void update(SecondKill secondKill); 19 | 20 | void delete(SecondKill secondKill); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/AdminGroupDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.AdminGroupDao; 4 | import com.mall.model.AdminGroup; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class AdminGroupDaoImpl implements AdminGroupDao { 18 | 19 | private HibernateTemplate template; 20 | 21 | @Autowired 22 | public AdminGroupDaoImpl(SessionFactory sessionFactory) { 23 | template = new HibernateTemplate(sessionFactory); 24 | } 25 | 26 | @Override 27 | public List findAll() { 28 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminGroup.class); 29 | return (List) template.findByCriteria(criteria); 30 | } 31 | 32 | @Override 33 | public AdminGroup findById(int id) { 34 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminGroup.class); 35 | criteria.add(Restrictions.eq("id", id)); 36 | List resultList = (List) template.findByCriteria(criteria); 37 | 38 | if (resultList.size() == 0) { 39 | return null; 40 | } 41 | return resultList.get(0); 42 | } 43 | 44 | public List findByPage(int page, int pageSize) { 45 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminGroup.class); 46 | int offset = (page - 1) * pageSize; 47 | List resultList = (List) template.findByCriteria(criteria, offset, pageSize); 48 | return resultList; 49 | } 50 | 51 | @Override 52 | @Transactional() 53 | public int save(AdminGroup adminGroup) { 54 | Serializable result = template.save(adminGroup); 55 | return (Integer)result; 56 | } 57 | 58 | @Override 59 | @Transactional() 60 | public void update(AdminGroup adminGroup) { 61 | template.update(adminGroup); 62 | } 63 | 64 | @Override 65 | @Transactional() 66 | public void delete(AdminGroup adminGroup) { 67 | template.delete(adminGroup); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/AdminUserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.AdminUserDao; 4 | import com.mall.model.AdminUser; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class AdminUserDaoImpl implements AdminUserDao { 18 | 19 | private HibernateTemplate template; 20 | 21 | @Autowired 22 | public AdminUserDaoImpl(SessionFactory sessionFactory) { 23 | template = new HibernateTemplate(sessionFactory); 24 | } 25 | 26 | @Override 27 | public List findAll() { 28 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminUser.class); 29 | return (List) template.findByCriteria(criteria); 30 | } 31 | 32 | @Override 33 | public AdminUser findById(int id) { 34 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminUser.class); 35 | criteria.add(Restrictions.eq("id", id)); 36 | List resultList = (List) template.findByCriteria(criteria); 37 | 38 | if (resultList.size() == 0) { 39 | return null; 40 | } 41 | return resultList.get(0); 42 | } 43 | 44 | public List findByPage(int page, int pageSize) { 45 | DetachedCriteria criteria = DetachedCriteria.forClass(AdminUser.class); 46 | int offset = (page - 1) * pageSize; 47 | List resultList = (List) template.findByCriteria(criteria, offset, pageSize); 48 | return resultList; 49 | } 50 | 51 | @Override 52 | @Transactional() 53 | public int save(AdminUser adminUser) { 54 | Serializable result = template.save(adminUser); 55 | return (Integer)result; 56 | } 57 | 58 | @Override 59 | @Transactional() 60 | public void update(AdminUser adminUser) { 61 | template.update(adminUser); 62 | } 63 | 64 | @Override 65 | @Transactional() 66 | public void delete(AdminUser adminUser) { 67 | template.delete(adminUser); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/GoodsCatDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.GoodsCatDao; 4 | import com.mall.model.GoodsCat; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class GoodsCatDaoImpl implements GoodsCatDao { 18 | private HibernateTemplate template; 19 | 20 | @Autowired 21 | public GoodsCatDaoImpl(SessionFactory sessionFactory) { 22 | template = new HibernateTemplate(sessionFactory); 23 | } 24 | 25 | @Override 26 | public List findAll() { 27 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsCat.class); 28 | return (List) template.findByCriteria(criteria); 29 | } 30 | 31 | @Override 32 | public List findByParentId(int parentId) { 33 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsCat.class); 34 | criteria.add(Restrictions.eq("parentId", parentId)); 35 | List resultList = (List) template.findByCriteria(criteria); 36 | if (resultList.size() == 0) { 37 | return null; 38 | } 39 | return resultList; 40 | } 41 | 42 | @Override 43 | public GoodsCat findById(int id) { 44 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsCat.class); 45 | criteria.add(Restrictions.eq("id", id)); 46 | List resultList = (List) template.findByCriteria(criteria); 47 | if (resultList.size() == 0) { 48 | return null; 49 | } 50 | return resultList.get(0); 51 | } 52 | 53 | @Override 54 | @Transactional() 55 | public int save(GoodsCat goodsCat) { 56 | Serializable result = template.save(goodsCat); 57 | return (Integer) result; 58 | } 59 | 60 | @Override 61 | @Transactional() 62 | public void update(GoodsCat goodsCat) { 63 | template.update(goodsCat); 64 | } 65 | 66 | @Override 67 | @Transactional() 68 | public void delete(GoodsCat goodsCat) { 69 | template.delete(goodsCat); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/HomeExtendDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.HomeExtendDao; 4 | import com.mall.model.HomeExtend; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class HomeExtendDaoImpl implements HomeExtendDao { 18 | private HibernateTemplate template; 19 | 20 | @Autowired 21 | public HomeExtendDaoImpl(SessionFactory sessionFactory) { 22 | template = new HibernateTemplate(sessionFactory); 23 | } 24 | 25 | @Override 26 | public List findAll() { 27 | DetachedCriteria criteria = DetachedCriteria.forClass(HomeExtend.class); 28 | return (List) template.findByCriteria(criteria); 29 | } 30 | 31 | @Override 32 | public HomeExtend findById(int id) { 33 | DetachedCriteria criteria = DetachedCriteria.forClass(HomeExtend.class); 34 | criteria.add(Restrictions.eq("id", id)); 35 | List resultList = (List) template.findByCriteria(criteria); 36 | if (resultList.size() == 0) { 37 | return null; 38 | } 39 | return resultList.get(0); 40 | } 41 | 42 | public List findByPage(int page, int pageSize) { 43 | DetachedCriteria criteria = DetachedCriteria.forClass(HomeExtend.class); 44 | int offset = (page - 1) * pageSize; 45 | List resultList = (List) this.template.findByCriteria(criteria, offset, pageSize); 46 | return resultList; 47 | } 48 | 49 | @Override 50 | @Transactional() 51 | public int save(HomeExtend homeExtend) { 52 | Serializable result = template.save(homeExtend); 53 | return (Integer) result; 54 | } 55 | 56 | @Override 57 | @Transactional() 58 | public void update(HomeExtend homeExtend) { 59 | template.update(homeExtend); 60 | } 61 | 62 | @Override 63 | @Transactional() 64 | public void delete(HomeExtend homeExtend) { 65 | template.delete(homeExtend); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/MerchantDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.MerchantDao; 4 | import com.mall.model.Merchant; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class MerchantDaoImpl implements MerchantDao { 18 | private HibernateTemplate template; 19 | 20 | @Autowired 21 | public MerchantDaoImpl(SessionFactory sessionFactory) { 22 | template = new HibernateTemplate(sessionFactory); 23 | } 24 | 25 | @Override 26 | public List findAll() { 27 | DetachedCriteria criteria = DetachedCriteria.forClass(Merchant.class); 28 | return (List) template.findByCriteria(criteria); 29 | } 30 | 31 | @Override 32 | public Merchant findById(int id) { 33 | DetachedCriteria criteria = DetachedCriteria.forClass(Merchant.class); 34 | criteria.add(Restrictions.eq("id", id)); 35 | List resultList = (List) template.findByCriteria(criteria); 36 | if (resultList.size() == 0) { 37 | return null; 38 | } 39 | return resultList.get(0); 40 | } 41 | 42 | public List findByPage(int page, int pageSize) { 43 | DetachedCriteria criteria = DetachedCriteria.forClass(Merchant.class); 44 | int offset = (page - 1) * pageSize; 45 | List resultList = (List) this.template.findByCriteria(criteria, offset, pageSize); 46 | return resultList; 47 | } 48 | 49 | @Override 50 | public List getMerchantByMerchantName(String merchantName) { 51 | DetachedCriteria criteria=DetachedCriteria.forClass(Merchant.class); 52 | criteria.add(Restrictions.eq("merchantName", merchantName)); 53 | List list = (List) template.findByCriteria(criteria, 0, 1); 54 | return list; 55 | } 56 | 57 | @Override 58 | @Transactional() 59 | public int save(Merchant merchant) { 60 | Serializable result = template.save(merchant); 61 | return (Integer) result; 62 | } 63 | 64 | @Override 65 | @Transactional() 66 | public void update(Merchant merchant) { 67 | template.update(merchant); 68 | } 69 | 70 | @Override 71 | @Transactional() 72 | public void delete(Merchant merchant) { 73 | template.delete(merchant); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/dao/impl/SecondKillDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.dao.impl; 2 | 3 | import com.mall.admin.dao.SecondKillDao; 4 | import com.mall.model.SecondKill; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class SecondKillDaoImpl implements SecondKillDao { 18 | private HibernateTemplate template; 19 | 20 | @Autowired 21 | public SecondKillDaoImpl(SessionFactory sessionFactory) { 22 | template = new HibernateTemplate(sessionFactory); 23 | } 24 | 25 | @Override 26 | public List findAll() { 27 | DetachedCriteria criteria = DetachedCriteria.forClass(SecondKill.class); 28 | return (List) template.findByCriteria(criteria); 29 | } 30 | 31 | @Override 32 | public SecondKill findById(int id) { 33 | DetachedCriteria criteria = DetachedCriteria.forClass(SecondKill.class); 34 | criteria.add(Restrictions.eq("id", id)); 35 | List resultList = (List) template.findByCriteria(criteria); 36 | if (resultList.size() == 0) { 37 | return null; 38 | } 39 | return resultList.get(0); 40 | } 41 | 42 | public List findByPage(int page, int pageSize) { 43 | DetachedCriteria criteria = DetachedCriteria.forClass(SecondKill.class); 44 | int offset = (page - 1) * pageSize; 45 | List resultList = (List) this.template.findByCriteria(criteria, offset, pageSize); 46 | return resultList; 47 | } 48 | 49 | @Override 50 | @Transactional() 51 | public int save(SecondKill secondKill) { 52 | Serializable result = template.save(secondKill); 53 | return (Integer) result; 54 | } 55 | 56 | @Override 57 | @Transactional() 58 | public void update(SecondKill secondKill) { 59 | template.update(secondKill); 60 | } 61 | 62 | @Override 63 | @Transactional() 64 | public void delete(SecondKill secondKill) { 65 | template.delete(secondKill); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/AdminGroupService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.AdminGroup; 4 | 5 | import java.util.List; 6 | 7 | public interface AdminGroupService { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int offset, int pageSize); 12 | 13 | AdminGroup findById(int id); 14 | 15 | int save(AdminGroup adminGroup); 16 | 17 | void update(AdminGroup adminGroup); 18 | 19 | void delete(AdminGroup adminGroup); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/AdminUserService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.AdminUser; 4 | 5 | import java.util.List; 6 | 7 | public interface AdminUserService { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int offset, int pageSize); 12 | 13 | AdminUser findById(int id); 14 | 15 | int save(AdminUser adminUser); 16 | 17 | void update(AdminUser adminUser); 18 | 19 | void delete(AdminUser adminUser); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/GoodsCatService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.GoodsCat; 4 | 5 | import java.util.List; 6 | 7 | public interface GoodsCatService { 8 | 9 | List findAll(); 10 | 11 | GoodsCat findById(int id); 12 | 13 | int save(GoodsCat goodsCat); 14 | 15 | void update(GoodsCat goodsCat); 16 | 17 | void delete(GoodsCat goodsCat); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.Goods; 4 | 5 | import java.util.List; 6 | 7 | public interface GoodsService { 8 | 9 | List findAll(String orderKeys); 10 | 11 | List findByGoodsName(String goodsName, String orderKeys); 12 | 13 | List findByGoodsNameAndPage(String goodsName, int page, int pageSize, String orderKeys); 14 | 15 | List findByMerchantId(int merchantId, String orderKeys); 16 | 17 | List findByMerchantIdAndPage(int merchantId, int page, int pageSize, String orderKeys); 18 | 19 | List findByCatId(int catId, String orderKeys); 20 | 21 | List findByCatIdAndPage(int catId, int page, int pageSize, String orderKeys); 22 | 23 | List findByPage(int offset, int pageSize, String orderKeys); 24 | 25 | int getCount(); 26 | 27 | int getCountByGoodsName(String goodsName); 28 | 29 | int getCountByMerchantId(int merchantId); 30 | 31 | int getCountByCatId(int catId); 32 | 33 | Goods findById(int id); 34 | 35 | int save(Goods goods); 36 | 37 | void update(Goods goods); 38 | 39 | void delete(Goods goods); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/HomeExtendService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.HomeExtend; 4 | 5 | import java.util.List; 6 | 7 | public interface HomeExtendService { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int offset, int pageSize); 12 | 13 | HomeExtend findById(int id); 14 | 15 | int save(HomeExtend homeExtend); 16 | 17 | void update(HomeExtend homeExtend); 18 | 19 | void delete(HomeExtend homeExtend); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/MerchantService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.Merchant; 4 | 5 | import java.util.List; 6 | 7 | public interface MerchantService { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int offset, int pageSize); 12 | 13 | Merchant isAllowLogin(String merchantName, String password); 14 | 15 | Merchant findById(int id); 16 | 17 | int save(Merchant merchant); 18 | 19 | void update(Merchant merchant); 20 | 21 | void delete(Merchant merchant); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/SecondKillService.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service; 2 | 3 | import com.mall.model.SecondKill; 4 | 5 | import java.util.List; 6 | 7 | public interface SecondKillService { 8 | 9 | List findAll(); 10 | 11 | List findByPage(int offset, int pageSize); 12 | 13 | SecondKill findById(int id); 14 | 15 | int save(SecondKill secondKill); 16 | 17 | void update(SecondKill secondKill); 18 | 19 | void delete(SecondKill secondKill); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/AdminGroupServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.AdminGroupDao; 4 | import com.mall.admin.service.AdminGroupService; 5 | import com.mall.model.AdminGroup; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class AdminGroupServiceImpl implements AdminGroupService { 13 | 14 | @Autowired 15 | private AdminGroupDao adminGroupDao; 16 | 17 | @Override 18 | public List findAll() { 19 | List adminGroups = adminGroupDao.findAll(); 20 | return adminGroups; 21 | } 22 | 23 | @Override 24 | public List findByPage(int offset, int pageSize) { 25 | List adminGroups = adminGroupDao.findByPage(offset, pageSize); 26 | return adminGroups; 27 | } 28 | 29 | @Override 30 | public AdminGroup findById(int id) { 31 | AdminGroup adminGroup = adminGroupDao.findById(id); 32 | return adminGroup; 33 | } 34 | 35 | @Override 36 | public int save(AdminGroup adminGroup) { 37 | int status = adminGroupDao.save(adminGroup); 38 | return status; 39 | } 40 | 41 | @Override 42 | public void update(AdminGroup adminGroup) { 43 | adminGroupDao.update(adminGroup); 44 | } 45 | 46 | @Override 47 | public void delete(AdminGroup adminGroup) { 48 | adminGroupDao.delete(adminGroup); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/AdminUserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.AdminUserDao; 4 | import com.mall.admin.service.AdminUserService; 5 | import com.mall.model.AdminUser; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class AdminUserServiceImpl implements AdminUserService { 13 | 14 | @Autowired 15 | private AdminUserDao adminUserDao; 16 | 17 | @Override 18 | public List findAll() { 19 | List adminUsers = adminUserDao.findAll(); 20 | return adminUsers; 21 | } 22 | 23 | @Override 24 | public List findByPage(int offset, int pageSize) { 25 | List adminUsers = adminUserDao.findByPage(offset, pageSize); 26 | return adminUsers; 27 | } 28 | 29 | @Override 30 | public AdminUser findById(int id) { 31 | AdminUser adminUser = adminUserDao.findById(id); 32 | return adminUser; 33 | } 34 | 35 | @Override 36 | public int save(AdminUser adminUser) { 37 | int status = adminUserDao.save(adminUser); 38 | return status; 39 | } 40 | 41 | @Override 42 | public void update(AdminUser adminUser) { 43 | adminUserDao.update(adminUser); 44 | } 45 | 46 | @Override 47 | public void delete(AdminUser adminUser) { 48 | adminUserDao.delete(adminUser); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/GoodsCatServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.GoodsCatDao; 4 | import com.mall.admin.service.GoodsCatService; 5 | import com.mall.model.GoodsCat; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class GoodsCatServiceImpl implements GoodsCatService { 13 | 14 | @Autowired 15 | private GoodsCatDao goodsCatDao; 16 | 17 | @Override 18 | public List findAll() { 19 | List goodsCats = goodsCatDao.findByParentId(0); 20 | if (goodsCats == null) { 21 | return null; 22 | } 23 | 24 | setChildrenCats(goodsCats); 25 | return goodsCats; 26 | } 27 | 28 | @Override 29 | public GoodsCat findById(int id) { 30 | GoodsCat goodsCat = goodsCatDao.findById(id); 31 | return goodsCat; 32 | } 33 | 34 | @Override 35 | public int save(GoodsCat goodsCat) { 36 | int status = goodsCatDao.save(goodsCat); 37 | return status; 38 | } 39 | 40 | @Override 41 | public void update(GoodsCat goodsCat) { 42 | goodsCatDao.update(goodsCat); 43 | } 44 | 45 | @Override 46 | public void delete(GoodsCat goodsCat) { 47 | goodsCatDao.delete(goodsCat); 48 | } 49 | 50 | // 格式化结果,将所有子分类拼接到父分类中 51 | private void setChildrenCats(List goodsCats) { 52 | System.out.println(goodsCats); 53 | for (int i = 0; i < goodsCats.size(); i++) { 54 | GoodsCat goodsCat = goodsCats.get(i); 55 | 56 | List childrenCats = goodsCatDao.findByParentId( 57 | goodsCat.getId()); 58 | goodsCat.setChildrenCats(childrenCats); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/GoodsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.GoodsDao; 4 | import com.mall.admin.service.GoodsService; 5 | import com.mall.model.Goods; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class GoodsServiceImpl implements GoodsService { 13 | 14 | @Autowired 15 | private GoodsDao goodsDao; 16 | 17 | @Override 18 | public List findAll(String orderKeys) { 19 | List goodses = goodsDao.findAll(orderKeys); 20 | return goodses; 21 | } 22 | 23 | @Override 24 | public List findByGoodsName(String goodsName, String orderKeys) { 25 | List goodses = goodsDao.findByGoodsName(goodsName, orderKeys); 26 | return goodses; 27 | } 28 | 29 | @Override 30 | public List findByGoodsNameAndPage(String goodsName, int page, int pageSize, String orderKeys) { 31 | List goodses = goodsDao.findByGoodsNameAndPage(goodsName, page, pageSize, orderKeys); 32 | return goodses; 33 | } 34 | 35 | @Override 36 | public List findByMerchantId(int merchantId, String orderKeys) { 37 | List goodses = goodsDao.findByMerchantId(merchantId, orderKeys); 38 | return goodses; 39 | } 40 | 41 | @Override 42 | public List findByMerchantIdAndPage(int merchantId, int page, int pageSize, String orderKeys) { 43 | List goodses = goodsDao.findByMerchantIdAndPage(merchantId, page, pageSize, orderKeys); 44 | return goodses; 45 | } 46 | 47 | @Override 48 | public List findByCatId(int catId, String orderKeys) { 49 | List goodses = goodsDao.findByCatId(catId, orderKeys); 50 | return goodses; 51 | } 52 | 53 | @Override 54 | public List findByCatIdAndPage(int catId, int page, int pageSize, String orderKeys) { 55 | List goodses = goodsDao.findByCatIdAndPage(catId, page, pageSize, orderKeys); 56 | return goodses; 57 | } 58 | 59 | @Override 60 | public List findByPage(int offset, int pageSize, String orderKeys) { 61 | List goodss = goodsDao.findByPage(offset, pageSize, orderKeys); 62 | return goodss; 63 | } 64 | 65 | @Override 66 | public int getCount() { 67 | return goodsDao.getCount(); 68 | } 69 | 70 | @Override 71 | public int getCountByGoodsName(String goodsName) { 72 | return goodsDao.getCountByGoodsName(goodsName); 73 | } 74 | 75 | @Override 76 | public int getCountByMerchantId(int merchantId) { 77 | return goodsDao.getCountByMerchantId(merchantId); 78 | } 79 | 80 | @Override 81 | public int getCountByCatId(int catId) { 82 | return goodsDao.getCountByCatId(catId); 83 | } 84 | 85 | @Override 86 | public Goods findById(int id) { 87 | Goods goods = goodsDao.findById(id); 88 | return goods; 89 | } 90 | 91 | @Override 92 | public int save(Goods goods) { 93 | int status = goodsDao.save(goods); 94 | return status; 95 | } 96 | 97 | @Override 98 | public void update(Goods goods) { 99 | goodsDao.update(goods); 100 | } 101 | 102 | @Override 103 | public void delete(Goods goods) { 104 | goodsDao.delete(goods); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/HomeExtendServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.HomeExtendDao; 4 | import com.mall.admin.service.HomeExtendService; 5 | import com.mall.admin.service.HomeExtendService; 6 | import com.mall.model.HomeExtend; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | public class HomeExtendServiceImpl implements HomeExtendService { 14 | 15 | @Autowired 16 | private HomeExtendDao homeExtendDao; 17 | 18 | @Override 19 | public List findAll() { 20 | List homeExtends = homeExtendDao.findAll(); 21 | return homeExtends; 22 | } 23 | 24 | @Override 25 | public List findByPage(int offset, int pageSize) { 26 | List homeExtends = homeExtendDao.findByPage(offset, pageSize); 27 | return homeExtends; 28 | } 29 | 30 | @Override 31 | public HomeExtend findById(int id) { 32 | HomeExtend homeExtend = homeExtendDao.findById(id); 33 | return homeExtend; 34 | } 35 | 36 | @Override 37 | public int save(HomeExtend homeExtend) { 38 | int status = homeExtendDao.save(homeExtend); 39 | return status; 40 | } 41 | 42 | @Override 43 | public void update(HomeExtend homeExtend) { 44 | homeExtendDao.update(homeExtend); 45 | } 46 | 47 | @Override 48 | public void delete(HomeExtend homeExtend) { 49 | homeExtendDao.delete(homeExtend); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/MerchantServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.MerchantDao; 4 | import com.mall.admin.service.MerchantService; 5 | import com.mall.model.Merchant; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MerchantServiceImpl implements MerchantService { 13 | 14 | @Autowired 15 | private MerchantDao merchantDao; 16 | 17 | @Override 18 | public List findAll() { 19 | List merchants = merchantDao.findAll(); 20 | return merchants; 21 | } 22 | 23 | @Override 24 | public List findByPage(int offset, int pageSize) { 25 | List merchants = merchantDao.findByPage(offset, pageSize); 26 | return merchants; 27 | } 28 | 29 | @Override 30 | public Merchant findById(int id) { 31 | Merchant merchant = merchantDao.findById(id); 32 | return merchant; 33 | } 34 | 35 | @Override 36 | public int save(Merchant merchant) { 37 | int status = merchantDao.save(merchant); 38 | return status; 39 | } 40 | 41 | @Override 42 | public Merchant isAllowLogin(String merchantName, String password) { 43 | List merchants = merchantDao.getMerchantByMerchantName(merchantName); 44 | String pwd = merchants.size() > 0 ? merchants.get(0).getAdminPass() : "xasda"; 45 | if (pwd.equals(password)) { 46 | return merchants.get(0); 47 | } 48 | return null; 49 | } 50 | 51 | @Override 52 | public void update(Merchant merchant) { 53 | merchantDao.update(merchant); 54 | } 55 | 56 | @Override 57 | public void delete(Merchant merchant) { 58 | merchantDao.delete(merchant); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/mall/admin/service/impl/SecondKillServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.admin.service.impl; 2 | 3 | import com.mall.admin.dao.SecondKillDao; 4 | import com.mall.admin.service.SecondKillService; 5 | import com.mall.model.SecondKill; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class SecondKillServiceImpl implements SecondKillService { 13 | 14 | @Autowired 15 | private SecondKillDao secondKillDao; 16 | 17 | @Override 18 | public List findAll() { 19 | List secondKills = secondKillDao.findAll(); 20 | return secondKills; 21 | } 22 | 23 | @Override 24 | public List findByPage(int offset, int pageSize) { 25 | List secondKills = secondKillDao.findByPage(offset, pageSize); 26 | return secondKills; 27 | } 28 | 29 | @Override 30 | public SecondKill findById(int id) { 31 | SecondKill secondKill = secondKillDao.findById(id); 32 | return secondKill; 33 | } 34 | 35 | @Override 36 | public int save(SecondKill secondKill) { 37 | int status = secondKillDao.save(secondKill); 38 | return status; 39 | } 40 | 41 | @Override 42 | public void update(SecondKill secondKill) { 43 | secondKillDao.update(secondKill); 44 | } 45 | 46 | @Override 47 | public void delete(SecondKill secondKill) { 48 | secondKillDao.delete(secondKill); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mall/common/UploadAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.common; 2 | 3 | import com.mall.utils.ResponseTemplate; 4 | import com.opensymphony.xwork2.ActionSupport; 5 | import org.apache.struts2.ServletActionContext; 6 | import org.apache.struts2.util.TokenHelper; 7 | 8 | import java.io.File; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | public class UploadAction extends ActionSupport { 13 | 14 | private File uploadFile; 15 | private String uploadFileContentType; 16 | private String uploadFileFileName; 17 | 18 | public Map jsonResult; 19 | 20 | public String upload() { 21 | if (uploadFile == null) { 22 | jsonResult = ResponseTemplate.error(-1, "No file!"); 23 | return SUCCESS; 24 | } 25 | 26 | // 1.获取文件的保存路径 27 | String basePath = ServletActionContext.getServletContext().getRealPath("/uploads"); 28 | File basePathFile = new File(basePath); 29 | if (!basePathFile.exists()) { 30 | basePathFile.mkdirs(); 31 | } 32 | 33 | // 2.把文件名UUID 34 | String GUIDFileName = TokenHelper.generateGUID(); 35 | if ("image/png".equals(uploadFileContentType)) { 36 | GUIDFileName = GUIDFileName + ".png"; 37 | } else { 38 | GUIDFileName = GUIDFileName + ".jpg"; 39 | } 40 | 41 | // 3.保存文件 42 | // 复制:临时文件还在,浪费服务器磁盘空间 43 | //FileUtils.copyFile(visitFile, new File(file,GUIDFileName)); 44 | // 剪切:把临时文件重命名到指定位置(比较好) 45 | uploadFile.renameTo(new File(basePathFile, GUIDFileName)); 46 | 47 | // 4. 返回结果,将文件的保存路径返回 48 | Map map = new HashMap<>(); 49 | map.put("filePath", "uploads/" + GUIDFileName); 50 | jsonResult = ResponseTemplate.success(map); 51 | return SUCCESS; 52 | } 53 | 54 | public void setUploadFile(File uploadFile) { 55 | this.uploadFile = uploadFile; 56 | } 57 | 58 | public void setUploadFileContentType(String uploadFileContentType) { 59 | this.uploadFileContentType = uploadFileContentType; 60 | } 61 | 62 | public void setUploadFileFileName(String uploadFileFileName) { 63 | this.uploadFileFileName = uploadFileFileName; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/AddressAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.frontend.service.AddressService; 4 | import com.mall.model.Address; 5 | import com.mall.model.User; 6 | import com.mall.utils.ResponseTemplate; 7 | import org.apache.struts2.ServletActionContext; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | 11 | import java.util.LinkedHashMap; 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | @Controller(value = "addressAction") 16 | public class AddressAction extends BaseAction { 17 | private Address address; 18 | 19 | @Autowired 20 | private AddressService addressService; 21 | 22 | public void setAddress(Address address) { 23 | this.address = address; 24 | } 25 | 26 | public String list() { 27 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 28 | List
list = addressService.getAddress(tokenData.getUserid()); 29 | Map data = new LinkedHashMap(); 30 | data.put("data", list); 31 | this.jsonResult = ResponseTemplate.success(data); 32 | return SUCCESS; 33 | } 34 | 35 | public String add() { 36 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 37 | System.out.println(this.address.getAddress()); 38 | this.address.setUserid(tokenData.getUserid()); 39 | int result = addressService.saveAddress(this.address); 40 | if (result > 0) { 41 | this.jsonResult = ResponseTemplate.success(null); 42 | } else { 43 | this.jsonResult = ResponseTemplate.error(201, "增加地址失败"); 44 | } 45 | return SUCCESS; 46 | } 47 | 48 | public String edit() { 49 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 50 | this.address.setUserid(tokenData.getUserid()); 51 | System.out.println(this.address.getAddress()); 52 | try { 53 | addressService.editAddress(this.address); 54 | this.jsonResult = ResponseTemplate.success(null); 55 | } catch (Exception e) { 56 | System.out.println(e); 57 | this.jsonResult = ResponseTemplate.error(202, "删除失败"); 58 | } 59 | return SUCCESS; 60 | } 61 | 62 | public String del() { 63 | System.out.println(this.address.getAddress()); 64 | try { 65 | addressService.delAddress(this.address); 66 | this.jsonResult = ResponseTemplate.success(null); 67 | } catch (Exception e) { 68 | System.out.println(e); 69 | this.jsonResult = ResponseTemplate.error(202, "删除失败"); 70 | } 71 | return SUCCESS; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/BaseAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.opensymphony.xwork2.ActionSupport; 4 | import org.apache.struts2.ServletActionContext; 5 | import org.springframework.context.annotation.Scope; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import java.util.Map; 9 | 10 | @Scope("prototype") 11 | public class BaseAction extends ActionSupport { 12 | public Map jsonResult; 13 | public int DEFAULT_PAGE = 1; 14 | public int DEFAULT_PAGE_SIZE = 15; 15 | 16 | // 检查是否有 Page 相关参数 17 | protected boolean hasParam(String paramName) { 18 | HttpServletRequest req = ServletActionContext.getRequest(); 19 | String paramValue = req.getParameter(paramName); 20 | 21 | return !(paramValue == null); 22 | } 23 | 24 | // 检查是否有 Page 相关参数 25 | protected boolean hasPageSetting() { 26 | return hasParam("page") || hasParam("pageSize"); 27 | } 28 | 29 | // 获取参数 30 | protected String getParam(String paramName) { 31 | HttpServletRequest req = ServletActionContext.getRequest(); 32 | String paramValue = req.getParameter(paramName); 33 | return paramValue; 34 | } 35 | 36 | // 获取 Page 配置 37 | protected int getPageSetting() { 38 | HttpServletRequest req = ServletActionContext.getRequest(); 39 | String paramPage= req.getParameter("page"); 40 | 41 | if (paramPage == null) { 42 | return DEFAULT_PAGE; 43 | } 44 | return Integer.parseInt(paramPage); 45 | } 46 | 47 | // 获取 PageSize 配置 48 | protected int getPageSizeSetting() { 49 | HttpServletRequest req = ServletActionContext.getRequest(); 50 | String paramPageSize= req.getParameter("pageSize"); 51 | 52 | if (paramPageSize == null) { 53 | return DEFAULT_PAGE_SIZE; 54 | } 55 | return Integer.parseInt(paramPageSize); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/CartAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.frontend.service.ShoppingCartService; 4 | import com.mall.model.ShoppingCart; 5 | import com.mall.model.User; 6 | import com.mall.utils.ResponseTemplate; 7 | import org.apache.struts2.ServletActionContext; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | 11 | import java.util.HashMap; 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | @Controller(value = "cartAction") 16 | public class CartAction extends BaseAction { 17 | @Autowired 18 | private ShoppingCartService shoppingCartService; 19 | private ShoppingCart shoppingCart; 20 | 21 | public void setShoppingCart(ShoppingCart shoppingCart) { 22 | this.shoppingCart = shoppingCart; 23 | } 24 | 25 | public String add() { 26 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 27 | shoppingCart.setUserId(tokenData.getUserid()); 28 | int result = shoppingCartService.saveCart(shoppingCart); 29 | if (result > 0) { 30 | jsonResult = ResponseTemplate.success( null); 31 | } else { 32 | jsonResult = ResponseTemplate.error(301, "添加购物车失败"); 33 | } 34 | return SUCCESS; 35 | } 36 | 37 | public String list() { 38 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 39 | List list = shoppingCartService.getCartList(tokenData.getUserid()); 40 | Map map = new HashMap<>(); 41 | map.put("data", list); 42 | jsonResult = ResponseTemplate.success(map); 43 | return SUCCESS; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/GoodsAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.admin.service.GoodsService; 4 | import com.mall.model.Goods; 5 | import com.mall.utils.ResponseTemplate; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | 9 | import java.util.HashMap; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | @Controller(value = "uGoodsAction") 14 | public class GoodsAction extends BaseAction { 15 | @Autowired 16 | private GoodsService goodsService; 17 | 18 | private Goods goods; 19 | private List goodses; 20 | 21 | private int goodsId; 22 | public void setGoodsId(int goodsId) { 23 | this.goodsId = goodsId; 24 | } 25 | public String list() { 26 | String orderKeys; 27 | 28 | // 默认按照销售总数排序 29 | if (hasParam("order")) { 30 | orderKeys = getParam("order"); 31 | } else { 32 | orderKeys = "-salesNum"; 33 | } 34 | 35 | int count; 36 | 37 | if (hasPageSetting()) { 38 | int page = getPageSetting(); 39 | int pageSize = getPageSizeSetting(); 40 | 41 | // 根据参数判断用户是否要根据指定值查找 42 | if (hasParam("goodsName")) { 43 | String goodsName = getParam("goodsName"); 44 | goodses = goodsService.findByGoodsNameAndPage(goodsName, page, pageSize, orderKeys); 45 | count = goodsService.getCountByGoodsName(goodsName); 46 | } else if (hasParam("catId")) { 47 | int catId = Integer.parseInt(getParam("catId")); 48 | goodses = goodsService.findByCatIdAndPage(catId, page, pageSize, orderKeys); 49 | count = goodsService.getCountByCatId(catId); 50 | } else if (hasParam("merchantId")) { 51 | System.out.println("merchantId"); 52 | int merchantId = Integer.parseInt(getParam("merchantId")); 53 | goodses = goodsService.findByMerchantIdAndPage(merchantId, page, pageSize, orderKeys); 54 | count = goodsService.getCountByMerchantId(merchantId); 55 | } else { 56 | goodses = goodsService.findByPage(page, pageSize, orderKeys); 57 | count = goodsService.getCount(); 58 | } 59 | } else { 60 | if (hasParam("goodsName")) { 61 | String goodsName = getParam("goodsName"); 62 | goodses = goodsService.findByGoodsName(getParam("goodsName"), orderKeys); 63 | count = goodsService.getCountByGoodsName(goodsName); 64 | } else if (hasParam("catId")) { 65 | int catId = Integer.parseInt(getParam("catId")); 66 | goodses = goodsService.findByCatId(Integer.parseInt(getParam("catId")), orderKeys); 67 | count = goodsService.getCountByCatId(catId); 68 | } else if (hasParam("merchantId")) { 69 | int merchantId = Integer.parseInt("merchantId"); 70 | System.out.println("merchantId"); 71 | goodses = goodsService.findByMerchantId(Integer.parseInt(getParam("merchantId")), orderKeys); 72 | count = goodsService.getCountByMerchantId(merchantId); 73 | } else { 74 | goodses = goodsService.findAll(orderKeys); 75 | count = goodsService.getCount(); 76 | } 77 | } 78 | 79 | Map map = new HashMap<>(); 80 | map.put("data", goodses); 81 | 82 | // 加上商品总数 83 | map.put("goodsSum", count); 84 | jsonResult = ResponseTemplate.success(map); 85 | return SUCCESS; 86 | } 87 | 88 | public String one () { 89 | Map map = new HashMap<>(); 90 | goods = goodsService.findById(goodsId); 91 | map.put("data", goods); 92 | jsonResult = ResponseTemplate.success(map); 93 | return SUCCESS; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/GoodsCommentAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.admin.service.GoodsService; 4 | import com.mall.frontend.service.GoodsCommentService; 5 | import com.mall.model.Goods; 6 | import com.mall.model.GoodsComment; 7 | import com.mall.utils.ResponseTemplate; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | 11 | import java.util.*; 12 | 13 | @Controller(value = "goodsCommentAction") 14 | public class GoodsCommentAction extends BaseAction { 15 | 16 | private GoodsComment goodsComment; 17 | 18 | private List goodsComments; 19 | 20 | @Autowired 21 | private GoodsCommentService goodsCommentService; 22 | 23 | @Autowired 24 | private GoodsService goodsService; 25 | 26 | public Map jsonResult; 27 | 28 | public String list() { 29 | if (!hasParam("goodsId")) { 30 | jsonResult = ResponseTemplate.error(-1, "param goodsId is required!"); 31 | return SUCCESS; 32 | } 33 | 34 | int count = 0; 35 | 36 | if (hasPageSetting()) { 37 | int page = getPageSetting(); 38 | int pageSize = getPageSizeSetting(); 39 | 40 | if (hasParam("goodsId") && hasParam("commentLevel")) { 41 | int goodsId = Integer.parseInt(getParam("goodsId")); 42 | int commentLevel = Integer.parseInt(getParam("commentLevel")); 43 | 44 | goodsComments = goodsCommentService.findByGoodsIdAndCommentLevelAndPage(goodsId, commentLevel, page, pageSize); 45 | count = goodsCommentService.getCountByGoodsIdAndCommentLevel(goodsId, commentLevel); 46 | } else if (hasParam("goodsId")) { 47 | int goodsId = Integer.parseInt(getParam("goodsId")); 48 | 49 | goodsComments = goodsCommentService.findByGoodsIdAndPage(goodsId, page, pageSize); 50 | count = goodsCommentService.getCountByGoodsId(goodsId); 51 | } 52 | } else { 53 | if (hasParam("goodsId") && hasParam("commentLevel")) { 54 | int goodsId = Integer.parseInt(getParam("goodsId")); 55 | int commmentLevel = Integer.parseInt(getParam("commentLevel")); 56 | 57 | goodsComments = goodsCommentService.findByGoodsIdAndCommentLevel(goodsId, commmentLevel); 58 | count = goodsCommentService.getCountByGoodsIdAndCommentLevel(goodsId, commmentLevel); 59 | } else if (hasParam("goodsId")) { 60 | int goodsId = Integer.parseInt(getParam("goodsId")); 61 | 62 | goodsComments = goodsCommentService.findByGoodsId(goodsId); 63 | count = goodsCommentService.getCountByGoodsId(goodsId); 64 | } 65 | } 66 | 67 | Map map = new HashMap<>(); 68 | map.put("data", goodsComments); 69 | map.put("count", count); 70 | 71 | jsonResult = ResponseTemplate.success(map); 72 | return SUCCESS; 73 | } 74 | 75 | public String add() { 76 | if (this.goodsComment == null) { 77 | jsonResult = ResponseTemplate.error(-1, "param goodsComment is required!"); 78 | return SUCCESS; 79 | } 80 | 81 | int status = goodsCommentService.save(goodsComment); 82 | 83 | // Update related goods 84 | Goods goods = goodsService.findById(goodsComment.getGoodsId()); 85 | Set commentSet = new HashSet<>(goods.getGoodsComments()); 86 | commentSet.add(goodsComment); 87 | goods.setGoodsComments(commentSet); 88 | goodsService.update(goods); 89 | 90 | if (status > 0) { 91 | Map map = new HashMap<>(); 92 | map.put("data", goodsComment); 93 | jsonResult = ResponseTemplate.success(map); 94 | } else { 95 | jsonResult = ResponseTemplate.error(-1, "添加失败"); 96 | } 97 | return SUCCESS; 98 | } 99 | 100 | public void setGoodsComment(GoodsComment goodsComment) { 101 | this.goodsComment = goodsComment; 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/OrderAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.frontend.service.OrderService; 4 | import com.mall.frontend.service.ShoppingCartService; 5 | import com.mall.model.Order; 6 | import com.mall.model.User; 7 | import com.mall.utils.ResponseTemplate; 8 | import org.apache.struts2.ServletActionContext; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | 16 | @Controller(value = "orderAction") 17 | public class OrderAction extends BaseAction { 18 | @Autowired 19 | private OrderService orderService; 20 | @Autowired 21 | private ShoppingCartService shoppingCartService; 22 | 23 | private Order order; 24 | 25 | public void setCart(int[] cart) { 26 | this.cart = cart; 27 | } 28 | 29 | private int[] cart; 30 | 31 | public void setOrder(Order order) { 32 | this.order = order; 33 | } 34 | 35 | public Order getOrder() { 36 | return order; 37 | } 38 | 39 | public String add() { 40 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 41 | System.out.println(this.cart.toString()); 42 | order.setUserid(tokenData.getUserid()); 43 | shoppingCartService.delCart(this.cart); 44 | int result = orderService.saveOrder(order); 45 | if (result >= 0) { 46 | jsonResult = ResponseTemplate.success(null); 47 | } else { 48 | jsonResult = ResponseTemplate.error(501, "添加订单失败"); 49 | } 50 | return SUCCESS; 51 | } 52 | 53 | public String list() { 54 | User tokenData = (User) ServletActionContext.getRequest().getAttribute("tokenData"); 55 | List list = orderService.getOrderList(tokenData.getUserid()); 56 | Map map = new HashMap<>(); 57 | map.put("data", list); 58 | jsonResult = ResponseTemplate.success(map); 59 | return SUCCESS; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/action/UserAction.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.action; 2 | 3 | import com.mall.frontend.service.UserService; 4 | import com.mall.model.User; 5 | import com.mall.utils.ResponseTemplate; 6 | import com.mall.utils.Token; 7 | import com.mall.utils.sign; 8 | import com.opensymphony.xwork2.ActionSupport; 9 | 10 | import java.util.HashMap; 11 | import java.util.LinkedHashMap; 12 | import java.util.Map; 13 | 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.context.annotation.Scope; 16 | import org.springframework.stereotype.Controller; 17 | 18 | @Controller(value = "userAction") 19 | @Scope("prototype") 20 | public class UserAction extends ActionSupport { 21 | @Autowired 22 | private UserService userService; 23 | 24 | public Map jsonResult; 25 | public User user; 26 | public String phone; 27 | public String password; 28 | 29 | 30 | public void setPhone(String phone) { 31 | this.phone = phone; 32 | } 33 | 34 | public void setPassword(String password) { 35 | this.password = password; 36 | } 37 | 38 | public void setUser(User user) { 39 | this.user = user; 40 | } 41 | 42 | 43 | /** 44 | * 测试demo 45 | * @return 46 | */ 47 | public String add() { 48 | Map map = new HashMap(); 49 | // int result = userService.saveUser(user); 50 | // System.out.println(result); 51 | map.put("rcode", 0); 52 | System.out.println("111"); 53 | map.put("name", "Gavin"); 54 | String str = null; 55 | try { 56 | str = Token.createToken(map, 30000); 57 | } catch (Exception e) { 58 | System.out.println(e); 59 | } 60 | System.out.println(str); 61 | String string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjoie1wiY3JlYXRlQXRcIjoxNTI5ODQzMjgwMDAwLFwicGFzc3dvcmRcIjpcImUxMGFkYzM5NDliYTU5YWJiZTU2ZTA1N2YyMGY4ODNlXCIsXCJwaG9uZVwiOlwiMTMyMzg1MTIzNjZcIixcInN0YXR1c1wiOjAsXCJ1cGRhdGVBdFwiOjE1Mjk4NDMyODAwMDAsXCJ1c2VyaWRcIjozMSxcInVzZXJuYW1lXCI6XCJHYXZpblwifSIsImV4cCI6MTUyOTg2NjU2NX0.kC7sTZxTn5-PS2HyYFdm8xJ7J8G81aFZLFZlXS5b50w"; 62 | User obj = Token.validToken(string, User.class); 63 | System.out.println(obj.getUserid()); 64 | jsonResult = map; 65 | return SUCCESS; 66 | } 67 | 68 | /** 69 | * 判断手机是否存在 70 | * @return 71 | */ 72 | public String isExist() { 73 | Boolean result = userService.isExist(this.phone); 74 | System.out.println(result); 75 | Map data = new HashMap(); 76 | data.put("isExist", result); 77 | jsonResult = ResponseTemplate.success(data); 78 | return SUCCESS; 79 | } 80 | 81 | /** 82 | * 注册 83 | * @return 84 | */ 85 | public String signUp() { 86 | String encodePwd = sign.md5(this.user.getPassword()); 87 | user.setPassword(encodePwd); 88 | int result = userService.saveUser(user); 89 | if (result > 0) { 90 | jsonResult = ResponseTemplate.success( null); 91 | } else { 92 | jsonResult = ResponseTemplate.error(101, "注册错误"); 93 | } 94 | return SUCCESS; 95 | } 96 | 97 | /** 98 | * 登陆 99 | * @return 100 | */ 101 | public String login() { 102 | User user = userService.isAllowLogin(this.phone, this.password); 103 | if (user != null) { 104 | String str = Token.createToken(user, 3600 * 60); 105 | Map data = new LinkedHashMap<>(); 106 | data.put("username", user.getUsername()); 107 | data.put("phone", user.getPhone()); 108 | data.put("mail", user.getMail()); 109 | data.put("token", str); 110 | jsonResult = ResponseTemplate.success(data); 111 | } else { 112 | jsonResult = ResponseTemplate.error(102, "登陆失败"); 113 | } 114 | return SUCCESS; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/AddressDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao; 2 | 3 | import com.mall.model.Address; 4 | 5 | import java.util.List; 6 | 7 | public interface AddressDao { 8 | int save(Address address); 9 | List
list(int userid); 10 | void delete(Address address); 11 | void update(Address address); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/GoodsCommentDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao; 2 | 3 | import com.mall.model.GoodsComment; 4 | 5 | import java.util.List; 6 | 7 | public interface GoodsCommentDao { 8 | 9 | List findByGoodsId(int goodsId); 10 | 11 | List findByGoodsIdAndPage(int goodsId, int page, int pageSize); 12 | 13 | List findByGoodsIdAndCommentLevel(int goodsId, int commentLevel); 14 | 15 | List findByGoodsIdAndCommentLevelAndPage(int goodsId, int commentLevel, int page, int pageSize); 16 | 17 | int getCount(); 18 | 19 | int getCountByGoodsId(int goodsId); 20 | 21 | int getCountByCommentLevel(int commentLevel); 22 | 23 | int getCountByGoodsIdAndCommentLevel(int goodsId, int commentLevel); 24 | 25 | int save(GoodsComment goodsComment); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/OrderDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao; 2 | 3 | import com.mall.model.Order; 4 | 5 | import java.util.List; 6 | 7 | public interface OrderDao { 8 | int save(Order order); 9 | List list(int userid); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/ShoppingCartDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao; 2 | 3 | import com.mall.model.ShoppingCart; 4 | 5 | import java.util.List; 6 | 7 | public interface ShoppingCartDao { 8 | int saveShoppingCart(ShoppingCart shoppingCart); 9 | List getShoppingCartByUserId(int userid); 10 | void delShoppingCart(int[] cart); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao; 2 | 3 | import com.mall.model.User; 4 | 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | public interface UserDao { 9 | int saveUser(User user); 10 | 11 | List getUserByPhone(String phone); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/impl/AddressDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao.impl; 2 | 3 | import com.mall.frontend.dao.AddressDao; 4 | import com.mall.model.Address; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class AddressDaoImpl implements AddressDao { 18 | 19 | public HibernateTemplate template; 20 | 21 | @Autowired 22 | public AddressDaoImpl(SessionFactory sessionFactory) { 23 | template = new HibernateTemplate(sessionFactory); 24 | } 25 | 26 | @Override 27 | @Transactional 28 | public int save(Address address) { 29 | Serializable result = template.save(address); 30 | Integer integer = (Integer)result; 31 | return integer; 32 | } 33 | 34 | @Override 35 | public List
list(int userid) { 36 | DetachedCriteria criteria= DetachedCriteria.forClass(Address.class); 37 | criteria.add(Restrictions.eq("userid", userid)); 38 | List
list = (List
) template.findByCriteria(criteria); 39 | return list; 40 | } 41 | 42 | @Override 43 | @Transactional() 44 | public void delete(Address address) { 45 | template.delete(address); 46 | } 47 | 48 | @Override 49 | @Transactional() 50 | public void update(Address address) { 51 | template.update(address); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/impl/GoodsCommentDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao.impl; 2 | 3 | import com.mall.frontend.dao.GoodsCommentDao; 4 | import com.mall.model.GoodsComment; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Projections; 8 | import org.hibernate.criterion.Restrictions; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.orm.hibernate5.HibernateTemplate; 11 | import org.springframework.stereotype.Repository; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.io.Serializable; 15 | import java.util.List; 16 | 17 | @Repository 18 | public class GoodsCommentDaoImpl implements GoodsCommentDao { 19 | 20 | public HibernateTemplate template; 21 | 22 | @Autowired 23 | public GoodsCommentDaoImpl(SessionFactory sessionFactory) { 24 | template = new HibernateTemplate(sessionFactory); 25 | } 26 | 27 | @Override 28 | public List findByGoodsId(int goodsId) { 29 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 30 | 31 | criteria.add(Restrictions.eq("goodsid", goodsId)); 32 | return (List) template.findByCriteria(criteria); 33 | } 34 | 35 | @Override 36 | public List findByGoodsIdAndPage(int goodsId, int page, int pageSize) { 37 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 38 | 39 | criteria.add(Restrictions.eq("goodsid", goodsId)); 40 | int offset = (page - 1) * pageSize; 41 | return (List) template.findByCriteria(criteria, offset, pageSize); 42 | } 43 | 44 | @Override 45 | public List findByGoodsIdAndCommentLevel(int goodsId, int commentLevel) { 46 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 47 | 48 | criteria.add(Restrictions.eq("goodsid", goodsId)); 49 | criteria.add(Restrictions.eq("commentLevel", commentLevel)); 50 | return (List) template.findByCriteria(criteria); 51 | } 52 | 53 | @Override 54 | public List findByGoodsIdAndCommentLevelAndPage(int goodsId, int commentLevel, int page, int pageSize) { 55 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 56 | 57 | criteria.add(Restrictions.eq("goodsid", goodsId)); 58 | criteria.add(Restrictions.eq("commentLevel", commentLevel)); 59 | int offset = (page - 1) * pageSize; 60 | return (List) template.findByCriteria(criteria, offset, pageSize); 61 | } 62 | 63 | @Override 64 | public int getCount() { 65 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 66 | criteria.setProjection(Projections.rowCount()); 67 | Object obj = template.findByCriteria(criteria).get(0); 68 | Long longObj = (Long) obj; 69 | int count = longObj.intValue(); 70 | return count; 71 | } 72 | 73 | @Override 74 | public int getCountByGoodsId(int goodsId) { 75 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 76 | 77 | criteria.add(Restrictions.eq("goodsid", goodsId)); 78 | criteria.setProjection(Projections.rowCount()); 79 | 80 | Object obj = template.findByCriteria(criteria).get(0); 81 | Long longObj = (Long) obj; 82 | int count = longObj.intValue(); 83 | return count; 84 | } 85 | 86 | @Override 87 | public int getCountByCommentLevel(int commentLevel) { 88 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 89 | 90 | criteria.add(Restrictions.eq("commentLevel", commentLevel)); 91 | criteria.setProjection(Projections.rowCount()); 92 | 93 | Object obj = template.findByCriteria(criteria).get(0); 94 | Long longObj = (Long) obj; 95 | int count = longObj.intValue(); 96 | return count; 97 | } 98 | 99 | @Override 100 | public int getCountByGoodsIdAndCommentLevel(int goodsId, int commentLevel) { 101 | DetachedCriteria criteria = DetachedCriteria.forClass(GoodsComment.class); 102 | 103 | criteria.add(Restrictions.eq("goodsid", goodsId)); 104 | criteria.add(Restrictions.eq("commentLevel", commentLevel)); 105 | criteria.setProjection(Projections.rowCount()); 106 | 107 | Object obj = template.findByCriteria(criteria).get(0); 108 | Long longObj = (Long) obj; 109 | int count = longObj.intValue(); 110 | return count; 111 | } 112 | 113 | @Override 114 | @Transactional 115 | public int save(GoodsComment goodsComment) { 116 | Serializable result = template.save(goodsComment); 117 | Integer integer = (Integer)result; 118 | return integer; 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/impl/OrderDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao.impl; 2 | 3 | import com.mall.frontend.dao.OrderDao; 4 | import com.mall.model.Order; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | 16 | @Repository 17 | public class OrderDaoImpl implements OrderDao { 18 | public HibernateTemplate template; 19 | 20 | @Autowired 21 | public OrderDaoImpl(SessionFactory sessionFactory) { 22 | template = new HibernateTemplate(sessionFactory); 23 | } 24 | 25 | @Override 26 | @Transactional 27 | public int save(Order order) { 28 | Serializable result = template.save(order); 29 | Integer integer = (Integer)result; 30 | return integer; 31 | } 32 | 33 | @Override 34 | public List list(int userId) { 35 | DetachedCriteria criteria=DetachedCriteria.forClass(Order.class); 36 | criteria.add(Restrictions.eq("userid", userId)); 37 | List list = (List) template.findByCriteria(criteria); 38 | return list; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/impl/ShoppingCartDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao.impl; 2 | 3 | import com.mall.frontend.dao.ShoppingCartDao; 4 | import com.mall.model.ShoppingCart; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Disjunction; 8 | import org.hibernate.criterion.Restrictions; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.orm.hibernate5.HibernateTemplate; 11 | import org.springframework.stereotype.Repository; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.io.Serializable; 15 | import java.util.List; 16 | 17 | @Repository 18 | public class ShoppingCartDaoImpl implements ShoppingCartDao { 19 | public HibernateTemplate template; 20 | 21 | @Autowired 22 | public ShoppingCartDaoImpl(SessionFactory sessionFactory) { 23 | template = new HibernateTemplate(sessionFactory); 24 | } 25 | 26 | @Override 27 | @Transactional 28 | public int saveShoppingCart(ShoppingCart shoppingCart) { 29 | Serializable result = template.save(shoppingCart); 30 | Integer integer = (Integer)result; 31 | return integer; 32 | } 33 | 34 | @Override 35 | public List getShoppingCartByUserId(int userid) { 36 | DetachedCriteria criteria=DetachedCriteria.forClass(ShoppingCart.class); 37 | criteria.add(Restrictions.eq("userId", userid)); 38 | List list = (List) template.findByCriteria(criteria); 39 | return list; 40 | } 41 | 42 | @Override 43 | @Transactional 44 | public void delShoppingCart(int[] cart) { 45 | DetachedCriteria criteria=DetachedCriteria.forClass(ShoppingCart.class); 46 | Disjunction dis = Restrictions.disjunction(); 47 | for(int item : cart) { 48 | System.out.println(item); 49 | dis.add(Restrictions.eq("id", item)); 50 | } 51 | criteria.add(dis); 52 | List list = (List) template.findByCriteria(criteria); 53 | template.deleteAll(list); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/dao/impl/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.dao.impl; 2 | 3 | import com.mall.frontend.dao.UserDao; 4 | import com.mall.model.User; 5 | import org.hibernate.SessionFactory; 6 | import org.hibernate.criterion.DetachedCriteria; 7 | import org.hibernate.criterion.Restrictions; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.orm.hibernate5.HibernateTemplate; 10 | import org.springframework.stereotype.Repository; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.io.Serializable; 14 | import java.util.List; 15 | import java.util.Set; 16 | 17 | @Repository 18 | public class UserDaoImpl implements UserDao{ 19 | public HibernateTemplate template; 20 | 21 | @Autowired 22 | public UserDaoImpl(SessionFactory sessionFactory) { 23 | template = new HibernateTemplate(sessionFactory); 24 | } 25 | 26 | @Override 27 | @Transactional() 28 | public int saveUser(User user) { 29 | Serializable result = template.save(user); 30 | Integer integer = (Integer)result; 31 | return integer; 32 | } 33 | 34 | @Override 35 | public List getUserByPhone(String phone) { 36 | DetachedCriteria criteria=DetachedCriteria.forClass(User.class); 37 | criteria.add(Restrictions.eq("phone", phone)); 38 | List list = (List) template.findByCriteria(criteria, 0, 1); 39 | return list; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service; 2 | 3 | import com.mall.model.Address; 4 | 5 | import java.util.List; 6 | 7 | public interface AddressService { 8 | int saveAddress(Address address); 9 | List
getAddress(int userid); 10 | void delAddress(Address address); 11 | void editAddress(Address address); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/GoodsCommentService.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service; 2 | 3 | import com.mall.model.GoodsComment; 4 | 5 | import java.util.List; 6 | 7 | public interface GoodsCommentService { 8 | 9 | List findByGoodsId(int goodsId); 10 | 11 | List findByGoodsIdAndPage(int goodsId, int page, int pageSize); 12 | 13 | List findByGoodsIdAndCommentLevel(int goodsId, int commentLevel); 14 | 15 | List findByGoodsIdAndCommentLevelAndPage(int goodsId, int commentLevel, int page, int pageSize); 16 | 17 | int getCount(); 18 | 19 | int getCountByGoodsId(int goodsId); 20 | 21 | int getCountByCommentLevel(int commentLevel); 22 | 23 | int getCountByGoodsIdAndCommentLevel(int goodsId, int commentLevel); 24 | 25 | int save(GoodsComment goodsComment); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service; 2 | 3 | import com.mall.model.Order; 4 | import org.aspectj.weaver.ast.Or; 5 | 6 | import java.util.List; 7 | 8 | public interface OrderService { 9 | int saveOrder(Order order); 10 | List getOrderList(int userid); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/ShoppingCartService.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service; 2 | 3 | import com.mall.model.ShoppingCart; 4 | 5 | import java.util.List; 6 | 7 | public interface ShoppingCartService { 8 | int saveCart(ShoppingCart shoppingCart); 9 | List getCartList(int userid); 10 | void delCart(int[] cart); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service; 2 | 3 | import com.mall.model.User; 4 | 5 | public interface UserService { 6 | int saveUser(User user); 7 | Boolean isExist(String phone); 8 | User isAllowLogin(String phone, String password); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/impl/AddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service.impl; 2 | 3 | import com.mall.frontend.dao.AddressDao; 4 | import com.mall.frontend.service.AddressService; 5 | import com.mall.model.Address; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class AddressServiceImpl implements AddressService { 13 | 14 | @Autowired 15 | private AddressDao addressDao; 16 | 17 | @Override 18 | public int saveAddress(Address address) { 19 | int result = addressDao.save(address); 20 | return result; 21 | } 22 | 23 | @Override 24 | public List
getAddress(int userid) { 25 | List
list = addressDao.list(userid); 26 | return list; 27 | } 28 | 29 | @Override 30 | public void delAddress(Address address) { 31 | addressDao.delete(address); 32 | } 33 | 34 | @Override 35 | public void editAddress(Address address) { 36 | addressDao.update(address); 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/impl/GoodsCommentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service.impl; 2 | 3 | import com.mall.frontend.dao.GoodsCommentDao; 4 | import com.mall.frontend.service.GoodsCommentService; 5 | import com.mall.model.GoodsComment; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class GoodsCommentServiceImpl implements GoodsCommentService { 13 | 14 | @Autowired 15 | private GoodsCommentDao goodsCommentDao; 16 | 17 | @Override 18 | public List findByGoodsId(int goodsId) { 19 | return goodsCommentDao.findByGoodsId(goodsId); 20 | } 21 | 22 | @Override 23 | public List findByGoodsIdAndPage(int goodsId, int page, int pageSize) { 24 | return goodsCommentDao.findByGoodsIdAndPage(goodsId, page, pageSize); 25 | } 26 | 27 | @Override 28 | public List findByGoodsIdAndCommentLevel(int goodsId, int commentLevel) { 29 | return goodsCommentDao.findByGoodsIdAndCommentLevel(goodsId, commentLevel); 30 | } 31 | 32 | @Override 33 | public List findByGoodsIdAndCommentLevelAndPage(int goodsId, int commentLevel, int page, int pageSize) { 34 | return goodsCommentDao.findByGoodsIdAndCommentLevelAndPage(goodsId, commentLevel, page, pageSize); 35 | } 36 | 37 | @Override 38 | public int getCount() { 39 | return goodsCommentDao.getCount(); 40 | } 41 | 42 | @Override 43 | public int getCountByGoodsId(int goodsId) { 44 | return goodsCommentDao.getCountByGoodsId(goodsId); 45 | } 46 | 47 | @Override 48 | public int getCountByCommentLevel(int commentLevel) { 49 | return goodsCommentDao.getCountByCommentLevel(commentLevel); 50 | } 51 | 52 | @Override 53 | public int getCountByGoodsIdAndCommentLevel(int goodsId, int commentLevel) { 54 | return goodsCommentDao.getCountByGoodsIdAndCommentLevel(goodsId, commentLevel); 55 | } 56 | 57 | @Override 58 | public int save(GoodsComment goodsComment) { 59 | return goodsCommentDao.save(goodsComment); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service.impl; 2 | 3 | import com.mall.frontend.dao.OrderDao; 4 | import com.mall.frontend.service.OrderService; 5 | import com.mall.model.Order; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | 12 | @Service 13 | public class OrderServiceImpl implements OrderService { 14 | 15 | @Autowired 16 | private OrderDao orderDao; 17 | @Override 18 | public int saveOrder(Order order) { 19 | int result = orderDao.save(order); 20 | return result; 21 | } 22 | 23 | @Override 24 | public List getOrderList(int userid) { 25 | List list = orderDao.list(userid); 26 | return list; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/impl/ShoppingCartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service.impl; 2 | 3 | import com.mall.frontend.dao.ShoppingCartDao; 4 | import com.mall.frontend.service.ShoppingCartService; 5 | import com.mall.model.ShoppingCart; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | @Service 11 | public class ShoppingCartServiceImpl implements ShoppingCartService { 12 | @Autowired 13 | private ShoppingCartDao shoppingCartDao; 14 | @Override 15 | public int saveCart(ShoppingCart shoppingCart) { 16 | int result = shoppingCartDao.saveShoppingCart(shoppingCart); 17 | return result; 18 | } 19 | 20 | @Override 21 | public List getCartList(int userid) { 22 | List list = shoppingCartDao.getShoppingCartByUserId(userid); 23 | return list; 24 | } 25 | 26 | @Override 27 | public void delCart(int[] cart) { 28 | shoppingCartDao.delShoppingCart(cart); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/mall/frontend/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.mall.frontend.service.impl; 2 | 3 | import com.mall.frontend.dao.UserDao; 4 | import com.mall.frontend.service.UserService; 5 | import com.mall.model.User; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.Iterator; 10 | import java.util.List; 11 | import java.util.Set; 12 | 13 | @Service 14 | public class UserServiceImpl implements UserService { 15 | 16 | @Autowired 17 | private UserDao userDao; 18 | 19 | @Override 20 | public int saveUser(User user) { 21 | int result = userDao.saveUser(user); 22 | return result; 23 | } 24 | 25 | @Override 26 | public Boolean isExist(String phone) { 27 | List users = userDao.getUserByPhone(phone); 28 | if (users.size() > 0) { 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | public User isAllowLogin(String phone, String password) { 35 | List users = userDao.getUserByPhone(phone); 36 | String pwd = users.size() > 0 ? users.get(0).getPassword() : "xasda"; 37 | System.out.println(pwd); 38 | if (pwd.equals(password)) { 39 | return users.get(0); 40 | } 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/Address.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.*; 6 | 7 | @Entity 8 | @Table(name="address") 9 | public class Address { 10 | @Id 11 | @GeneratedValue(generator="id") 12 | @GenericGenerator(name="id", strategy="native") 13 | private int address_id; 14 | // 姓名 15 | private String name; 16 | // 省 17 | private String province; 18 | // 市 19 | private String city; 20 | // 区 21 | private String area; 22 | // 详细地址 23 | private String address; 24 | // 手机 25 | private String phone; 26 | // 邮政编码 27 | private String postalcode; 28 | 29 | private int userid; 30 | 31 | public int getUserid() { 32 | return userid; 33 | } 34 | 35 | public void setUserid(int userid) { 36 | this.userid = userid; 37 | } 38 | 39 | public int getAddress_id() { 40 | return address_id; 41 | } 42 | 43 | public void setAddress_id(int address_id) { 44 | this.address_id = address_id; 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | public String getProvince() { 56 | return province; 57 | } 58 | 59 | public void setProvince(String province) { 60 | this.province = province; 61 | } 62 | 63 | public String getCity() { 64 | return city; 65 | } 66 | 67 | public void setCity(String city) { 68 | this.city = city; 69 | } 70 | 71 | public String getArea() { 72 | return area; 73 | } 74 | 75 | public void setArea(String area) { 76 | this.area = area; 77 | } 78 | 79 | public String getAddress() { 80 | return address; 81 | } 82 | 83 | public void setAddress(String address) { 84 | this.address = address; 85 | } 86 | 87 | public String getPhone() { 88 | return phone; 89 | } 90 | 91 | public void setPhone(String phone) { 92 | this.phone = phone; 93 | } 94 | 95 | public String getPostalcode() { 96 | return postalcode; 97 | } 98 | 99 | public void setPostalcode(String postalcode) { 100 | this.postalcode = postalcode; 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/AdminGroup.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.*; 5 | 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.*; 8 | import javax.persistence.Entity; 9 | import javax.persistence.Table; 10 | import java.util.Date; 11 | import java.util.HashSet; 12 | import java.util.Set; 13 | 14 | /** 15 | * 后台管理员分组 16 | */ 17 | @Entity 18 | @Table(name = "admin_group") 19 | public class AdminGroup { 20 | 21 | @Id 22 | @GeneratedValue(generator = "id") 23 | @GenericGenerator(name = "id", strategy = "native") 24 | private int id; 25 | 26 | @Column(length = 30) 27 | private String groupName; 28 | 29 | @Column(updatable=false) 30 | @Temporal(TemporalType.TIMESTAMP) 31 | @CreationTimestamp 32 | private Date createdAt; 33 | 34 | @Temporal(TemporalType.TIMESTAMP) 35 | @UpdateTimestamp 36 | private Date updatedAt; 37 | 38 | @ManyToMany(mappedBy = "adminGroups", cascade = CascadeType.ALL, fetch = FetchType.EAGER) 39 | @Fetch(value = FetchMode.SUBSELECT) 40 | private Set adminUsers = new HashSet<>(); 41 | 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public void setId(int id) { 47 | this.id = id; 48 | } 49 | 50 | public String getGroupName() { 51 | return groupName; 52 | } 53 | 54 | public void setGroupName(String groupName) { 55 | this.groupName = groupName; 56 | } 57 | 58 | public Date getCreatedAt() { 59 | return createdAt; 60 | } 61 | 62 | public void setCreatedAt(Date createdAt) { 63 | this.createdAt = createdAt; 64 | } 65 | 66 | public Date getUpdatedAt() { 67 | return updatedAt; 68 | } 69 | 70 | public void setUpdatedAt(Date updatedAt) { 71 | this.updatedAt = updatedAt; 72 | } 73 | 74 | public Set getAdminUsers() { 75 | return adminUsers; 76 | } 77 | 78 | public void setAdminUsers(Set adminUsers) { 79 | this.adminUsers = adminUsers; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/AdminUser.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.*; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.*; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Table; 9 | import java.util.Date; 10 | import java.util.HashSet; 11 | import java.util.Set; 12 | 13 | /** 14 | * 后台管理员 15 | */ 16 | @Entity 17 | @Table(name = "admin_user") 18 | public class AdminUser { 19 | 20 | @Id 21 | @GeneratedValue(generator = "id") 22 | @GenericGenerator(name = "id", strategy = "native") 23 | private int id; 24 | 25 | @Column(length=30) 26 | private String username; 27 | 28 | @Column(length=64) 29 | private String password; 30 | 31 | @ColumnDefault(value = "false") 32 | private Boolean isAdmin; 33 | 34 | @Column(length=255) 35 | private String email; 36 | 37 | @Column(updatable=false) 38 | @Temporal(TemporalType.TIMESTAMP) 39 | @CreationTimestamp 40 | private Date createdAt; 41 | 42 | @Temporal(TemporalType.TIMESTAMP) 43 | @UpdateTimestamp 44 | private Date updatedAt; 45 | 46 | 47 | @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 48 | @JoinTable(name = "admin_users_groups",joinColumns = @JoinColumn(name = "admin_user_id"),inverseJoinColumns = @JoinColumn(name = "admin_group_id")) 49 | @Fetch(value = FetchMode.SUBSELECT) 50 | private Set adminGroups = new HashSet<>(); 51 | 52 | public AdminUser() { 53 | } 54 | 55 | public int getId() { 56 | return id; 57 | } 58 | 59 | public void setId(int id) { 60 | this.id = id; 61 | } 62 | 63 | public String getUsername() { 64 | return username; 65 | } 66 | 67 | public void setUsername(String username) { 68 | this.username = username; 69 | } 70 | 71 | public String getPassword() { 72 | return password; 73 | } 74 | 75 | public void setPassword(String password) { 76 | this.password = password; 77 | } 78 | 79 | public Boolean getAdmin() { 80 | return isAdmin; 81 | } 82 | 83 | public void setAdmin(Boolean admin) { 84 | isAdmin = admin; 85 | } 86 | 87 | public String getEmail() { 88 | return email; 89 | } 90 | 91 | public void setEmail(String email) { 92 | this.email = email; 93 | } 94 | 95 | public Date getCreatedAt() { 96 | return createdAt; 97 | } 98 | 99 | public void setCreatedAt(Date createdAt) { 100 | this.createdAt = createdAt; 101 | } 102 | 103 | public Date getUpdatedAt() { 104 | return updatedAt; 105 | } 106 | 107 | public void setUpdatedAt(Date updatedAt) { 108 | this.updatedAt = updatedAt; 109 | } 110 | 111 | public Set getAdminGroups() { 112 | return adminGroups; 113 | } 114 | 115 | public void setAdminGroups(Set adminGroups) { 116 | this.adminGroups = adminGroups; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/Goods.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.ColumnDefault; 5 | import org.hibernate.annotations.Fetch; 6 | import org.hibernate.annotations.FetchMode; 7 | import org.hibernate.annotations.GenericGenerator; 8 | 9 | import javax.persistence.*; 10 | import java.util.HashSet; 11 | import java.util.Set; 12 | 13 | /** 14 | * 商品 15 | */ 16 | @Entity 17 | @Table(name = "goods") 18 | public class Goods { 19 | 20 | // 唯一标识 ID 21 | @Id 22 | @GeneratedValue(generator = "id") 23 | @GenericGenerator(name = "id", strategy = "native") 24 | private int id; 25 | 26 | // 商品名称 27 | private String goodsName; 28 | 29 | // 商品图片多张使用 `,` 分割,限制最多五张 30 | private String goodsImgs; 31 | 32 | // 商品描述(只能使用图片,规则和商品图片相同) 33 | private String goodsDesc; 34 | 35 | // 基础价格,套餐价格在此基础上变化 36 | private double basicPrice; 37 | 38 | // 商品销售总数 39 | @ColumnDefault(value = "0") 40 | private int salesNum; 41 | 42 | // 库存总数 43 | @ColumnDefault(value = "0") 44 | private int skuNum; 45 | 46 | // 商品所在分类 ID 47 | @ManyToOne 48 | @JoinColumn(name = "goods_cat_id", 49 | foreignKey = @ForeignKey(name = "GOODS_CAT_ID_FK") 50 | ) 51 | private GoodsCat goodsCat; 52 | 53 | // 商品所属商家 54 | @ManyToOne 55 | @JoinColumn(name = "merchant_id", 56 | foreignKey = @ForeignKey(name = "MERCHANT_ID_FK") 57 | ) 58 | private Merchant merchant; 59 | 60 | // 商品所在分组(提供给商家自己对商品归类) 61 | @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 62 | @JoinTable(name = "goods_groups",joinColumns = @JoinColumn(name = "goods_id"),inverseJoinColumns = @JoinColumn(name = "group_id")) 63 | @Fetch(value = FetchMode.SUBSELECT) 64 | private Set goodsGroups = new HashSet<>(); 65 | 66 | // 商品套餐(价格在这里面定义) 67 | @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) 68 | @Fetch(value = FetchMode.SUBSELECT) 69 | private Set goodsAttrs = new HashSet<>(); 70 | 71 | // 商品详细配置信息 72 | @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) 73 | @Fetch(value = FetchMode.SUBSELECT) 74 | private Set goodsDetails = new HashSet<>(); 75 | 76 | // 商品评价 77 | @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) 78 | @Fetch(value = FetchMode.SUBSELECT) 79 | private Set goodsComments = new HashSet<>(); 80 | 81 | public int getId() { 82 | return id; 83 | } 84 | 85 | public void setId(int id) { 86 | this.id = id; 87 | } 88 | 89 | public String getGoodsName() { 90 | return goodsName; 91 | } 92 | 93 | public void setGoodsName(String goodsName) { 94 | this.goodsName = goodsName; 95 | } 96 | 97 | public String getGoodsImgs() { 98 | return goodsImgs; 99 | } 100 | 101 | public void setGoodsImgs(String goodsImgs) { 102 | this.goodsImgs = goodsImgs; 103 | } 104 | 105 | public String getGoodsDesc() { 106 | return goodsDesc; 107 | } 108 | 109 | public void setGoodsDesc(String goodsDesc) { 110 | this.goodsDesc = goodsDesc; 111 | } 112 | 113 | public int getSalesNum() { 114 | return salesNum; 115 | } 116 | 117 | public void setSalesNum(int salesNum) { 118 | this.salesNum = salesNum; 119 | } 120 | 121 | public GoodsCat getGoodsCat() { 122 | return goodsCat; 123 | } 124 | 125 | public void setGoodsCat(GoodsCat goodsCat) { 126 | this.goodsCat = goodsCat; 127 | } 128 | 129 | public Merchant getMerchant() { 130 | return merchant; 131 | } 132 | 133 | public void setMerchant(Merchant merchant) { 134 | this.merchant = merchant; 135 | } 136 | 137 | public Set getGoodsGroups() { 138 | return goodsGroups; 139 | } 140 | 141 | public void setGoodsGroups(Set goodsGroups) { 142 | this.goodsGroups = goodsGroups; 143 | } 144 | 145 | public Set getGoodsAttrs() { 146 | return goodsAttrs; 147 | } 148 | 149 | public void setGoodsAttrs(Set goodsAttrs) { 150 | this.goodsAttrs = goodsAttrs; 151 | } 152 | 153 | public Set getGoodsDetails() { 154 | return goodsDetails; 155 | } 156 | 157 | public void setGoodsDetails(Set goodsDetails) { 158 | this.goodsDetails = goodsDetails; 159 | } 160 | 161 | public Set getGoodsComments() { 162 | return goodsComments; 163 | } 164 | 165 | public void setGoodsComments(Set goodsComments) { 166 | this.goodsComments = goodsComments; 167 | } 168 | 169 | public double getBasicPrice() { 170 | return basicPrice; 171 | } 172 | 173 | public void setBasicPrice(double basicPrice) { 174 | this.basicPrice = basicPrice; 175 | } 176 | 177 | public int getSkuNum() { 178 | return skuNum; 179 | } 180 | 181 | public void setSkuNum(int skuNum) { 182 | this.skuNum = skuNum; 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/GoodsAttr.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.ColumnDefault; 5 | import org.hibernate.annotations.GenericGenerator; 6 | 7 | import javax.persistence.*; 8 | 9 | /** 10 | * 商品套餐 11 | * 12 | */ 13 | @Entity 14 | @Table(name = "goods_attr") 15 | public class GoodsAttr { 16 | 17 | // 唯一标识 ID 18 | @Id 19 | @GeneratedValue(generator = "id") 20 | @GenericGenerator(name = "id", strategy = "native") 21 | private int id; 22 | 23 | // 该配置信息 24 | private String attrTitle; 25 | 26 | // 该配置商品小图 27 | private String attrImgUrl; 28 | 29 | // 该配置商品编号(每一个属性都有一个独特的商品编号) 30 | private String goodsCode; 31 | 32 | // 该配置商品价格 33 | private double attrPrice; 34 | 35 | // 该配置商品是否已上架 36 | @ColumnDefault(value = "false") 37 | private Boolean onSale; 38 | 39 | public int getId() { 40 | return id; 41 | } 42 | 43 | public void setId(int id) { 44 | this.id = id; 45 | } 46 | 47 | public String getAttrTitle() { 48 | return attrTitle; 49 | } 50 | 51 | public void setAttrTitle(String attrTitle) { 52 | this.attrTitle = attrTitle; 53 | } 54 | 55 | public String getGoodsCode() { 56 | return goodsCode; 57 | } 58 | 59 | public void setGoodsCode(String goodsCode) { 60 | this.goodsCode = goodsCode; 61 | } 62 | 63 | public double getAttrPrice() { 64 | return attrPrice; 65 | } 66 | 67 | public void setAttrPrice(int attrPrice) { 68 | this.attrPrice = attrPrice; 69 | } 70 | 71 | public Boolean getOnSale() { 72 | return onSale; 73 | } 74 | 75 | public void setOnSale(Boolean onSale) { 76 | this.onSale = onSale; 77 | } 78 | 79 | public String getAttrImgUrl() { 80 | return attrImgUrl; 81 | } 82 | 83 | public void setAttrImgUrl(String attrImgUrl) { 84 | this.attrImgUrl = attrImgUrl; 85 | } 86 | 87 | public void setAttrPrice(double attrPrice) { 88 | this.attrPrice = attrPrice; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/GoodsCat.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.ColumnDefault; 5 | import org.hibernate.annotations.GenericGenerator; 6 | 7 | import javax.persistence.*; 8 | import java.util.List; 9 | 10 | /** 11 | * 商品分类 12 | */ 13 | @Entity 14 | @Table(name = "goods_cat") 15 | public class GoodsCat { 16 | 17 | // 唯一标识 ID 18 | @Id 19 | @GeneratedValue(generator = "id") 20 | @GenericGenerator(name = "id", strategy = "native") 21 | private int id; 22 | 23 | // 父 ID 24 | @ColumnDefault(value = "0") 25 | private int parentId; 26 | 27 | // 分类名称 28 | private String catName; 29 | 30 | @Transient 31 | private List childrenCats; 32 | 33 | public int getId() { 34 | return id; 35 | } 36 | 37 | public void setId(int id) { 38 | this.id = id; 39 | } 40 | 41 | public int getParentId() { 42 | return parentId; 43 | } 44 | 45 | public void setParentId(int parentId) { 46 | this.parentId = parentId; 47 | } 48 | 49 | public String getCatName() { 50 | return catName; 51 | } 52 | 53 | public void setCatName(String catName) { 54 | this.catName = catName; 55 | } 56 | 57 | public List getChildrenCats() { 58 | return childrenCats; 59 | } 60 | 61 | public void setChildrenCats(List childrenCats) { 62 | this.childrenCats = childrenCats; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/GoodsComment.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.GenericGenerator; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | /** 10 | * 商品评论 11 | */ 12 | @Entity 13 | @Table(name = "goods_comment") 14 | public class GoodsComment { 15 | 16 | /** 17 | * TODO 18 | * 1.增加评论 19 | * POST: 20 | * { 21 | * commemtContent: '评论信息', 22 | * commentLevel: 4, 23 | * tags: "好用,不错,货美价廉", 24 | * username: "Gavin", 25 | * userid: 1, 26 | * goodsId: 1, 27 | * attrTitle: "4.7英寸-深邃蓝", 28 | * attrId: 102, 29 | * orderId: 2 30 | * } 31 | * 32 | * 注意:goodsId 是外键,连接商品 33 | * 34 | * 2. 获取评论 35 | * 方法 goodsService.findById() 获取单个商品时,需要返回字段 comment 36 | * 具体展示内容如下: 37 | * 38 | * comment: { 39 | * commentNum: 16, // 总评论数 40 | * remarksNumDetail: [ 2, 2, 2, 3, 1 ] // 分别是5个评论等级的评论数(字段:commentLevel), [ 好评, 满意, 一般, 差, 非常差 ] 41 | * detail: [ // 评论详细内容 42 | * { 43 | * username: "Gavin", // 用户名 44 | * commentLevel: 5, // 等级 45 | * commemtContent: "颜色很好看,质量也不错!", // 评论 46 | * attrTitle: "4.7英寸-深邃蓝", 47 | * tags: "好用,不错,货美价廉", 48 | * createAt: "2018-05-15 09:20" 49 | * }, 50 | * { 51 | * username: "Gavin", // 用户名 52 | * commentLevel: 5, // 等级 53 | * commemtContent: "颜色很好看,质量也不错!", // 评论 54 | * attrTitle: "4.7英寸-深邃蓝", 55 | * tags: "好用,不错,货美价廉", 56 | * createAt: "2018-05-15 09:20" 57 | * } 58 | * ] 59 | * } 60 | */ 61 | 62 | // 唯一标识 ID 63 | @Id 64 | @GeneratedValue(generator = "id") 65 | @GenericGenerator(name = "id", strategy = "native") 66 | private int id; 67 | 68 | // 评价内容 69 | private String commentContent; 70 | 71 | // 评价等级:星星数量 72 | private int commentLevel; 73 | 74 | // 评论标签 例:"好用,不错,货美价廉" 前台写死规定几个标签供选择 75 | private String tags; 76 | 77 | // 用户名 78 | private String username; 79 | 80 | // 用户id 81 | private int userid; 82 | 83 | // 商品Id # 外键 84 | private int goodsId; 85 | 86 | // 套餐描述 87 | private String attrTitle; 88 | 89 | // 评论时间 90 | private Date createAt; 91 | 92 | // 订单号 93 | private String orderId; 94 | 95 | // @ManyToOne 96 | // private Goods goods; 97 | 98 | public int getId() { 99 | return id; 100 | } 101 | 102 | public void setId(int id) { 103 | this.id = id; 104 | } 105 | 106 | public String getCommentContent() { 107 | return commentContent; 108 | } 109 | 110 | public void setCommentContent(String commentContent) { 111 | this.commentContent = commentContent; 112 | } 113 | 114 | public int getCommentLevel() { 115 | return commentLevel; 116 | } 117 | 118 | public void setCommentLevel(int commentLevel) { 119 | this.commentLevel = commentLevel; 120 | } 121 | 122 | public String getTags() { 123 | return tags; 124 | } 125 | 126 | public void setTags(String tags) { 127 | tags = tags; 128 | } 129 | 130 | public String getUsername() { 131 | return username; 132 | } 133 | 134 | public void setUsername(String username) { 135 | this.username = username; 136 | } 137 | 138 | public int getUserid() { 139 | return userid; 140 | } 141 | 142 | public void setUserid(int userid) { 143 | this.userid = userid; 144 | } 145 | 146 | public int getGoodsId() { 147 | return goodsId; 148 | } 149 | 150 | public void setGoodsId(int goodsId) { 151 | this.goodsId = goodsId; 152 | } 153 | 154 | public String getAttrTitle() { 155 | return attrTitle; 156 | } 157 | 158 | public void setAttrTitle(String attrTitle) { 159 | this.attrTitle = attrTitle; 160 | } 161 | 162 | public Date getCreateAt() { 163 | return createAt; 164 | } 165 | 166 | public void setCreateAt(Date createAt) { 167 | this.createAt = createAt; 168 | } 169 | 170 | public String getOrderId() { 171 | return orderId; 172 | } 173 | 174 | public void setOrderId(String orderId) { 175 | this.orderId = orderId; 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/GoodsDetail.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.GenericGenerator; 5 | 6 | import javax.persistence.*; 7 | 8 | /** 9 | * 商品信息 10 | * 11 | * 商品信息是商品的多个键值对关系 12 | * 如 重量: 30kg, 功能: 防水 13 | * 14 | */ 15 | @Entity 16 | @Table(name = "goods_detail") 17 | public class GoodsDetail { 18 | 19 | // 唯一标识 ID 20 | @Id 21 | @GeneratedValue(generator = "id") 22 | @GenericGenerator(name = "id", strategy = "native") 23 | private int id; 24 | 25 | // 商品详细信息的 Key 26 | private String detailKey; 27 | 28 | // 商品详细信息的 Value 29 | private String detailValue; 30 | 31 | public int getId() { 32 | return id; 33 | } 34 | 35 | public void setId(int id) { 36 | this.id = id; 37 | } 38 | 39 | public String getDetailKey() { 40 | return detailKey; 41 | } 42 | 43 | public void setDetailKey(String detailKey) { 44 | this.detailKey = detailKey; 45 | } 46 | 47 | public String getDetailValue() { 48 | return detailValue; 49 | } 50 | 51 | public void setDetailValue(String detailValue) { 52 | this.detailValue = detailValue; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/GoodsGroup.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.Fetch; 5 | import org.hibernate.annotations.FetchMode; 6 | import org.hibernate.annotations.GenericGenerator; 7 | 8 | import javax.persistence.*; 9 | import java.util.HashSet; 10 | import java.util.Set; 11 | 12 | /** 13 | * 商品分组 14 | * 15 | * 商品分组提供给商家自己归类商品 16 | * 17 | */ 18 | @Entity 19 | @Table(name = "goods_group") 20 | public class GoodsGroup { 21 | 22 | @Id 23 | @GeneratedValue(generator = "id") 24 | @GenericGenerator(name = "id", strategy = "native") 25 | private int id; 26 | 27 | private String goodsName; 28 | 29 | @ManyToMany(mappedBy = "goodsGroups", cascade = CascadeType.ALL, fetch = FetchType.EAGER) 30 | @Fetch(value = FetchMode.SUBSELECT) 31 | private Set goodses = new HashSet<>(); 32 | 33 | public int getId() { 34 | return id; 35 | } 36 | 37 | public void setId(int id) { 38 | this.id = id; 39 | } 40 | 41 | public String getGoodsName() { 42 | return goodsName; 43 | } 44 | 45 | public void setGoodsName(String goodsName) { 46 | this.goodsName = goodsName; 47 | } 48 | 49 | public Set getGoodses() { 50 | return goodses; 51 | } 52 | 53 | public void setGoodses(Set goodses) { 54 | this.goodses = goodses; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/HomeExtend.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.GenericGenerator; 5 | 6 | import javax.persistence.*; 7 | 8 | /** 9 | * 首页推广 10 | */ 11 | @Entity 12 | @Table(name = "home_extend") 13 | public class HomeExtend { 14 | 15 | // 唯一标识 ID 16 | @Id 17 | @GeneratedValue(generator = "id") 18 | @GenericGenerator(name = "id", strategy = "native") 19 | private int id; 20 | 21 | // 推广标题 22 | private String extendTitle; 23 | 24 | // 推广图片地址 25 | private String extendImgUrl; 26 | 27 | // 推广所在分组 28 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 29 | @JoinColumn(name = "goods_cat_id") 30 | private GoodsCat goodsCat; 31 | 32 | public int getId() { 33 | return id; 34 | } 35 | 36 | public void setId(int id) { 37 | this.id = id; 38 | } 39 | 40 | public String getExtendTitle() { 41 | return extendTitle; 42 | } 43 | 44 | public void setExtendTitle(String extendTitle) { 45 | this.extendTitle = extendTitle; 46 | } 47 | 48 | public String getExtendImgUrl() { 49 | return extendImgUrl; 50 | } 51 | 52 | public void setExtendImgUrl(String extendImgUrl) { 53 | this.extendImgUrl = extendImgUrl; 54 | } 55 | 56 | public GoodsCat getGoodsCat() { 57 | return goodsCat; 58 | } 59 | 60 | public void setGoodsCat(GoodsCat goodsCat) { 61 | this.goodsCat = goodsCat; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/Merchant.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.CreationTimestamp; 5 | import org.hibernate.annotations.GenericGenerator; 6 | import org.hibernate.annotations.UpdateTimestamp; 7 | 8 | import javax.persistence.*; 9 | import java.util.Date; 10 | 11 | /** 12 | * 商家 13 | */ 14 | @Entity 15 | @Table(name = "merchant") 16 | public class Merchant { 17 | 18 | // 唯一标识 ID 19 | @Id 20 | @GeneratedValue(generator = "id") 21 | @GenericGenerator(name = "id", strategy = "native") 22 | private int id; 23 | 24 | // 商家名称 25 | private String merchantName; 26 | 27 | // 店铺地址 28 | private String merchantPlace; 29 | 30 | // 店铺描述 31 | private String merchantDesc; 32 | 33 | // 后台登陆密码 34 | private String adminPass; 35 | 36 | @Column(updatable=false) 37 | @Temporal(TemporalType.TIMESTAMP) 38 | @CreationTimestamp 39 | private Date createdAt; 40 | 41 | @Temporal(TemporalType.TIMESTAMP) 42 | @UpdateTimestamp 43 | private Date updatedAt; 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public void setId(int id) { 50 | this.id = id; 51 | } 52 | 53 | public String getMerchantName() { 54 | return merchantName; 55 | } 56 | 57 | public void setMerchantName(String merchantName) { 58 | this.merchantName = merchantName; 59 | } 60 | 61 | public String getMerchantPlace() { 62 | return merchantPlace; 63 | } 64 | 65 | public void setMerchantPlace(String merchantPlace) { 66 | this.merchantPlace = merchantPlace; 67 | } 68 | 69 | public String getMerchantDesc() { 70 | return merchantDesc; 71 | } 72 | 73 | public void setMerchantDesc(String merchantDesc) { 74 | this.merchantDesc = merchantDesc; 75 | } 76 | 77 | public void setAdminPass(String adminPass) { 78 | this.adminPass = adminPass; 79 | } 80 | 81 | public String getAdminPass() { 82 | return this.adminPass; 83 | } 84 | 85 | public Date getCreatedAt() { 86 | return createdAt; 87 | } 88 | 89 | public void setCreatedAt(Date createdAt) { 90 | this.createdAt = createdAt; 91 | } 92 | 93 | public Date getUpdatedAt() { 94 | return updatedAt; 95 | } 96 | 97 | public void setUpdatedAt(Date updatedAt) { 98 | this.updatedAt = updatedAt; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/Order.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.ColumnDefault; 4 | import org.hibernate.annotations.Fetch; 5 | import org.hibernate.annotations.FetchMode; 6 | import org.hibernate.annotations.GenericGenerator; 7 | 8 | import javax.persistence.*; 9 | import java.util.HashSet; 10 | import java.util.Set; 11 | 12 | @Entity 13 | @Table(name = "order_list") 14 | public class Order { 15 | // 唯一标识 ID 16 | @Id 17 | @GeneratedValue(generator="id") 18 | @GenericGenerator(name="id", strategy="native") 19 | private int orderid; 20 | 21 | // 姓名 22 | private String name; 23 | 24 | // 地址 25 | private String address; 26 | 27 | // 地址ID 28 | @Column(name="address_id") 29 | private int addressId; 30 | 31 | // 价钱 32 | private double price; 33 | 34 | // 用户id 35 | private int userid; 36 | 37 | // 订单状态 38 | @ColumnDefault(value = "0") 39 | private int status; 40 | 41 | // 订单详情 42 | @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) 43 | @Fetch(value = FetchMode.SUBSELECT) 44 | private Set orderDetail = new HashSet<>(); 45 | 46 | public int getOrderid() { 47 | return orderid; 48 | } 49 | 50 | public void setOrderid(int orderid) { 51 | this.orderid = orderid; 52 | } 53 | 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | public void setName(String name) { 59 | this.name = name; 60 | } 61 | 62 | public String getAddress() { 63 | return address; 64 | } 65 | 66 | public void setAddress(String address) { 67 | this.address = address; 68 | } 69 | 70 | public int getAddressId() { 71 | return addressId; 72 | } 73 | 74 | public void setAddressId(int addressId) { 75 | this.addressId = addressId; 76 | } 77 | 78 | public double getPrice() { 79 | return price; 80 | } 81 | 82 | public void setPrice(double price) { 83 | this.price = price; 84 | } 85 | 86 | public int getUserid() { 87 | return userid; 88 | } 89 | 90 | public void setUserid(int userid) { 91 | this.userid = userid; 92 | } 93 | 94 | public int getStatus() { 95 | return status; 96 | } 97 | 98 | public void setStatus(int status) { 99 | this.status = status; 100 | } 101 | 102 | public Set getOrderDetail() { 103 | return orderDetail; 104 | } 105 | 106 | public void setOrderDetail(Set orderDetail) { 107 | this.orderDetail = orderDetail; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/OrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.*; 6 | 7 | @Entity 8 | @Table(name = "order_detail") 9 | public class OrderDetail { 10 | // 唯一标识 ID 11 | @Id 12 | @GeneratedValue(generator="id") 13 | @GenericGenerator(name="id", strategy="native") 14 | private int id; 15 | 16 | // 套餐ID 17 | @Column(name="attr_id") 18 | private int attrId; 19 | 20 | // 套餐名称 21 | @Column(name="attr_title") 22 | private String attrTitle; 23 | 24 | // 商品名称 25 | @Column(name="goods_name") 26 | private String goodsName; 27 | 28 | // 商品图片 29 | private String img; 30 | 31 | // 套餐code 32 | @Column(name="goods_code") 33 | private String goodsCode; 34 | 35 | // 商家ID 36 | @Column(name="merchant_id") 37 | private String merchantId; 38 | 39 | // 购买数量 40 | private int count; 41 | 42 | // @ManyToOne 43 | // private Order order; 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public void setId(int id) { 50 | this.id = id; 51 | } 52 | 53 | public int getAttrId() { 54 | return attrId; 55 | } 56 | 57 | public void setAttrId(int attrId) { 58 | this.attrId = attrId; 59 | } 60 | 61 | public String getAttrTitle() { 62 | return attrTitle; 63 | } 64 | 65 | public void setAttrTitle(String attrTitle) { 66 | this.attrTitle = attrTitle; 67 | } 68 | 69 | public String getGoodsName() { 70 | return goodsName; 71 | } 72 | 73 | public void setGoodsName(String goodsName) { 74 | this.goodsName = goodsName; 75 | } 76 | 77 | public String getImg() { 78 | return img; 79 | } 80 | 81 | public void setImg(String img) { 82 | this.img = img; 83 | } 84 | 85 | public String getGoodsCode() { 86 | return goodsCode; 87 | } 88 | 89 | public void setGoodsCode(String goodsCode) { 90 | this.goodsCode = goodsCode; 91 | } 92 | 93 | public String getMerchantId() { 94 | return merchantId; 95 | } 96 | 97 | public void setMerchantId(String merchantId) { 98 | this.merchantId = merchantId; 99 | } 100 | 101 | public int getCount() { 102 | return count; 103 | } 104 | 105 | public void setCount(int count) { 106 | this.count = count; 107 | } 108 | 109 | // public Order getOrder() { 110 | // return order; 111 | // } 112 | // 113 | // public void setOrder(Order order) { 114 | // this.order = order; 115 | // } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/SecondKill.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | 4 | import org.hibernate.annotations.GenericGenerator; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | /** 10 | * 首页推广 11 | */ 12 | @Entity 13 | @Table(name = "second_kill") 14 | public class SecondKill { 15 | 16 | // 唯一标识 ID 17 | @Id 18 | @GeneratedValue(generator = "id") 19 | @GenericGenerator(name = "id", strategy = "native") 20 | private int id; 21 | 22 | // 秒杀推广图片 23 | private String skImg; 24 | 25 | // 秒杀价格 26 | private double skPrice; 27 | 28 | // 秒杀结束时间 29 | @Temporal(TemporalType.TIMESTAMP) 30 | private Date endedAt; 31 | 32 | // 该秒杀对应的商品套餐 33 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 34 | @JoinColumn(name = "goods_attr_id") 35 | private GoodsAttr goodsAttr; 36 | 37 | public int getId() { 38 | return id; 39 | } 40 | 41 | public void setId(int id) { 42 | this.id = id; 43 | } 44 | 45 | public String getSkImg() { 46 | return skImg; 47 | } 48 | 49 | public void setSkImg(String skImg) { 50 | this.skImg = skImg; 51 | } 52 | 53 | public double getSkPrice() { 54 | return skPrice; 55 | } 56 | 57 | public void setSkPrice(int skPrice) { 58 | this.skPrice = skPrice; 59 | } 60 | 61 | public GoodsAttr getGoodsAttr() { 62 | return goodsAttr; 63 | } 64 | 65 | public void setGoodsAttr(GoodsAttr goodsAttr) { 66 | this.goodsAttr = goodsAttr; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/ShoppingCart.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.*; 6 | 7 | // 购物车 8 | @Entity 9 | @Table(name="shopping_cart") 10 | public class ShoppingCart { 11 | @Id 12 | @GeneratedValue(generator="id") 13 | @GenericGenerator(name="id", strategy="native") 14 | private int id; // 购物车id 15 | // 商品图片 16 | private String img; 17 | // 商品ID 18 | @Column(name="goods_id") 19 | private int goodsId; 20 | @Column(name="user_id") 21 | private int userId; 22 | // 商户ID 23 | @Column(name="merchant_id") 24 | private int merchantId; 25 | // 套餐ID 26 | @Column(name="attr_id") 27 | private int attrId; 28 | // 商品价格 29 | private double price; 30 | // 商品个数 31 | private int count; 32 | // 商品描述 33 | private String title; 34 | // 套餐描述 35 | @Column(name="attr_title") 36 | private String attrTitle; 37 | // 商品code 38 | @Column(name="attr_code") 39 | private String goodsCode; 40 | 41 | public int getId() { 42 | return id; 43 | } 44 | 45 | public void setId(int id) { 46 | this.id = id; 47 | } 48 | 49 | public String getImg() { 50 | return img; 51 | } 52 | 53 | public void setImg(String img) { 54 | this.img = img; 55 | } 56 | 57 | public int getGoodsId() { 58 | return goodsId; 59 | } 60 | 61 | public void setGoodsId(int goodsId) { 62 | this.goodsId = goodsId; 63 | } 64 | 65 | public int getMerchantId() { 66 | return merchantId; 67 | } 68 | 69 | public void setMerchantId(int merchantId) { 70 | this.merchantId = merchantId; 71 | } 72 | 73 | public int getAttrId() { 74 | return attrId; 75 | } 76 | 77 | public void setAttrId(int attrId) { 78 | this.attrId = attrId; 79 | } 80 | 81 | public double getPrice() { 82 | return price; 83 | } 84 | 85 | public void setPrice(double price) { 86 | this.price = price; 87 | } 88 | 89 | public int getCount() { 90 | return count; 91 | } 92 | 93 | public void setCount(int count) { 94 | this.count = count; 95 | } 96 | 97 | public String getTitle() { 98 | return title; 99 | } 100 | 101 | public void setTitle(String title) { 102 | this.title = title; 103 | } 104 | 105 | public String getAttrTitle() { 106 | return attrTitle; 107 | } 108 | 109 | public void setAttrTitle(String attrTitle) { 110 | this.attrTitle = attrTitle; 111 | } 112 | 113 | public String getGoodsCode() { 114 | return goodsCode; 115 | } 116 | 117 | public void setGoodsCode(String goodsCode) { 118 | this.goodsCode = goodsCode; 119 | } 120 | 121 | public int getUserId() { 122 | return userId; 123 | } 124 | 125 | public void setUserId(int userId) { 126 | this.userId = userId; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/java/com/mall/model/User.java: -------------------------------------------------------------------------------- 1 | package com.mall.model; 2 | 3 | import org.hibernate.annotations.CreationTimestamp; 4 | import org.hibernate.annotations.GenericGenerator; 5 | import org.hibernate.annotations.UpdateTimestamp; 6 | 7 | import javax.persistence.*; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * 用户 14 | */ 15 | @Entity 16 | @Table(name="user") 17 | public class User { 18 | @Id 19 | @GeneratedValue(generator="id") 20 | @GenericGenerator(name="id", strategy="native") 21 | private int userid; // 用户id 22 | 23 | private String username; // 用户名 24 | 25 | private String password; // 密码 26 | 27 | private String mail; // 邮箱 28 | 29 | private String phone; // 手机 30 | 31 | private int status; // 状态 32 | 33 | @Column(updatable=false, name="create_at") 34 | @Temporal(TemporalType.TIMESTAMP) 35 | @CreationTimestamp 36 | private Date createAt; // 创建时间 37 | 38 | @Column(name="update_at") 39 | @Temporal(TemporalType.TIMESTAMP) 40 | @UpdateTimestamp 41 | private Date updateAt; // 修改时间 42 | 43 | public int getUserid() { 44 | return userid; 45 | } 46 | 47 | public void setUserid(int userid) { 48 | this.userid = userid; 49 | } 50 | 51 | public String getUsername() { 52 | return username; 53 | } 54 | 55 | public void setUsername(String username) { 56 | this.username = username; 57 | } 58 | 59 | public String getPassword() { 60 | return password; 61 | } 62 | 63 | public void setPassword(String password) { 64 | this.password = password; 65 | } 66 | 67 | public String getPhone() { 68 | return phone; 69 | } 70 | 71 | public void setPhone(String phone) { 72 | this.phone = phone; 73 | } 74 | 75 | public int getStatus() { 76 | return status; 77 | } 78 | 79 | public void setStatus(int status) { 80 | this.status = status; 81 | } 82 | 83 | public Date getCreateAt() { 84 | return createAt; 85 | } 86 | 87 | public void setCreateAt(Date createAt) { 88 | this.createAt = createAt; 89 | } 90 | 91 | public Date getUpdateAt() { 92 | return updateAt; 93 | } 94 | 95 | public void setUpdateAt(Date updateAt) { 96 | this.updateAt = updateAt; 97 | } 98 | 99 | public String getMail() { 100 | return mail; 101 | } 102 | 103 | public void setMail(String mail) { 104 | this.mail = mail; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/com/mall/utils/ResponseTemplate.java: -------------------------------------------------------------------------------- 1 | package com.mall.utils; 2 | 3 | import java.util.LinkedHashMap; 4 | import java.util.Map; 5 | 6 | public class ResponseTemplate { 7 | public static Map success(Map result) { 8 | Map data = new LinkedHashMap(); 9 | data.put("rcode", 0); 10 | data.put("message", "success"); 11 | data.put("result", result); 12 | return data; 13 | } 14 | 15 | public static Map error(int rcode, String message) { 16 | Map data = new LinkedHashMap(); 17 | data.put("rcode", rcode); 18 | data.put("message", message); 19 | return data; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mall/utils/Token.java: -------------------------------------------------------------------------------- 1 | package com.mall.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.auth0.jwt.JWT; 5 | import com.auth0.jwt.algorithms.Algorithm; 6 | import com.auth0.jwt.exceptions.JWTCreationException; 7 | import com.auth0.jwt.interfaces.Claim; 8 | import com.auth0.jwt.interfaces.DecodedJWT; 9 | 10 | import java.util.Date; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | public class Token { 15 | private static final String SECRET = "MallvServersa!@#$#"; 16 | private static final String EXP = "exp"; 17 | private static final String PAYLOAD = "payload"; 18 | /** 19 | * 生成Token:jwt 20 | * @param object 传入的加密对象 - 放入PAYLOAD 21 | * @param maxAge 过期事件,单位秒 22 | * @param 23 | * @return 24 | */ 25 | public static String createToken(T object, long maxAge) { 26 | Date now = new Date(); 27 | Map map = new HashMap(); 28 | String jsonString = JSON.toJSONString(object); 29 | map.put("alg", "HS256"); 30 | map.put("typ", "JWT"); 31 | long exp = now.getTime() + maxAge * 1000; 32 | String token = null; 33 | try { 34 | token = JWT.create() 35 | .withHeader(map)//header 36 | .withClaim(PAYLOAD, jsonString)//存放的内容 json 37 | .withExpiresAt(new Date(exp)) 38 | .sign(Algorithm.HMAC256(SECRET));//密钥 39 | } catch (JWTCreationException e) { 40 | System.out.println(e); 41 | } 42 | return token; 43 | } 44 | 45 | /** 46 | * 解密token 47 | * @param token jwt类型的token 48 | * @param classT 加密时的类型 49 | * @param 50 | * @return 返回解密后的对象 - 如果token过期返回空对象 51 | */ 52 | public static T validToken(String token, Class classT) { 53 | DecodedJWT decode = null; 54 | try { 55 | decode = JWT.decode(token); 56 | Map claims = decode.getClaims(); 57 | if (claims.containsKey(EXP) && claims.containsKey(PAYLOAD)){ 58 | long tokenTime = claims.get(EXP).asDate().getTime(); 59 | long nowTime = new Date().getTime(); 60 | // 判断令牌是否超时 61 | if (tokenTime > nowTime){ 62 | String json = claims.get(PAYLOAD).asString(); 63 | if (classT != null) { 64 | return JSON.parseObject(json, classT); 65 | } else { 66 | return (T) JSON.parse(json); 67 | } 68 | } 69 | } 70 | } catch (Exception e) { 71 | System.out.println(e); 72 | return null; 73 | } 74 | return null; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/mall/utils/sign.java: -------------------------------------------------------------------------------- 1 | package com.mall.utils; 2 | 3 | import java.math.BigInteger; 4 | import java.security.MessageDigest; 5 | 6 | public class sign { 7 | public static String md5(String str) { 8 | try { 9 | // 生成一个MD5加密计算摘要 10 | MessageDigest md = MessageDigest.getInstance("MD5"); 11 | // 计算md5函数 12 | md.update(str.getBytes()); 13 | // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 14 | // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 15 | String md5 = new BigInteger(1, md.digest()).toString(16); 16 | //BigInteger会把0省略掉,需补全至32位 17 | return fillMD5(md5); 18 | } catch (Exception e) { 19 | throw new RuntimeException("MD5加密错误:"+e.getMessage(),e); 20 | } 21 | } 22 | 23 | private static String fillMD5(String md5) { 24 | return md5.length()==32?md5:fillMD5("0"+md5); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/admin.struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | regex:.* 25 | 26 | 27 | 28 | jsonResult 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | true 33 | update 34 | org.hibernate.dialect.MySQL5InnoDBDialect 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/frontend.struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | regex:.* 24 | 25 | 26 | 27 | 28 | jsonResult 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | regex:.* 50 | 51 | 52 | 53 | jsonResult 54 | 55 | 56 | 57 | 58 | 59 | jsonResult 60 | 61 | 62 | 63 | 64 | 65 | jsonResult 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, console 2 | 3 | log4j.appender.console=org.apache.log4j.ConsoleAppender 4 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %t %c{2}:%L - %m%n -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dev.log 5 | finance-pay 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/messageResource.properties: -------------------------------------------------------------------------------- 1 | invalid.fieldvalue.price = \u5546\u54c1\u4ef7\u683c\u8f93\u5165\u683c\u5f0f\u6709\u8bef -------------------------------------------------------------------------------- /src/main/resources/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | jsonResult 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | index.jsp 10 | 11 | 12 | OpenSessionInViewFilter 13 | 14 | org.springframework.orm.hibernate5.support.OpenSessionInViewFilter 15 | 16 | sessionFactoryBeanName 17 | sessionFactory 18 | 19 | 20 | singleSession 21 | true 22 | 23 | 24 | flushMode 25 | AUTO 26 | 27 | 28 | 29 | 30 | struts2 31 | org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter 32 | 33 | 34 | struts2 35 | /* 36 | *.jpg 37 | *.png 38 | 39 | 40 | 41 | 42 | org.springframework.web.context.ContextLoaderListener 43 | 44 | 45 | 46 | 47 | contextConfigLocation 48 | classpath:applicationContext.xml 49 | 50 | 51 | 52 | 53 | org.apache.logging.log4j.web.Log4jServletContextListener 54 | 55 | 56 | log4jServletFilter 57 | org.apache.logging.log4j.web.Log4jServletFilter 58 | 59 | 60 | log4jServletFilter 61 | /* 62 | REQUEST 63 | FORWARD 64 | INCLUDE 65 | ERROR 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="s" uri="/struts-tags" %> 4 | 5 | 6 | 7 | 8 | 新增商品界面 9 | 10 | 11 |

新增商品

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 |
商品名称
商品价格
27 | 28 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/webapp/static/img/attr/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/attr/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/footer/ico_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/footer/ico_service.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/freeback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/freeback.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodDesc/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodDesc/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/hot/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/hot/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/intro/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/intro/8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/item-detail-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/item-detail-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/item-detail-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/item-detail-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/item-detail-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/item-detail-3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/item-detail-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/item-detail-4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsDetail/pack/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsDetail/pack/9.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsImgs/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsImgs/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-as-img-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-as-img-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-as-img-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-as-img-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/goodsList/item-show-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/goodsList/item-show-8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/clock.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1-8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2-8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/computer/item-computer-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/computer/item-computer-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-1-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-1-8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-2-1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-2-2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-2-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-2-6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-2-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-2-7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/eat/item-eat-2-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/eat/item-eat-2-8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/seckill/seckill-item1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/seckill/seckill-item1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/seckill/seckill-item2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/seckill/seckill-item2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/seckill/seckill-item3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/seckill/seckill-item3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/seckill/seckill-item4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/seckill/seckill-item4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/index/seckill/seckill-item5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/index/seckill/seckill-item5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/nav_showimg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/nav_showimg1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/nav/nav_showimg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/nav/nav_showimg2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/7.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/otherBuy/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/otherBuy/8.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/pay-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/pay-success.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/pay/pay-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/pay/pay-demo.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/pay/pay-qrscan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/pay/pay-qrscan.png -------------------------------------------------------------------------------- /src/main/webapp/static/img/sale.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/sale.jpg -------------------------------------------------------------------------------- /src/main/webapp/static/img/signup-sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerDos/Mall-Server/a0c22212952c519f479700a6386befb21505feab/src/main/webapp/static/img/signup-sale.png --------------------------------------------------------------------------------