Skip to content

Commit 8ffb742

Browse files
author
xenv
committed
update readme and fix bugs
1 parent ab752c5 commit 8ffb742

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
* 通过 参数注解 进行方法级**数据校验**,无需额外配置校验类 (通过 AOP 切面实现)
2626
* 统一的错误处理
2727

28+
29+
讲解文章:
30+
* [小小商城项目概述 —— 需求分析、数据表设计、原型设计、多层结构设计、项目规划][4]
31+
* [SSM开发 | 合理配置 mybatis-generator,隔离机器生成代码和额外增加代码][5]
32+
* [SSM开发 | 开发自定义插件,使 mybatis-generator 支持软删除][6]
33+
* [SSM开发 | 实现 Mybatis 的通用 Mapper,免写 SQL 自动处理关联查询 (类hibernate)(mybatis-generator+自定义插件+自定义注解+静态代理+泛型+反射)][7]
34+
* [SSM开发 | 配合Mybatis,通过泛型实现 BaseService ,抽象增改删查方法][8]
35+
* [SSM开发 | 配合自定义注解 和 SpringMVC拦截器,实现 方法级粒度 用户鉴权][9]
36+
* [SSM开发 | 对 SpringMVC 传入参数 进行参数校验 (使用自定义AOP切面+自定义参数注解)][10]
37+
38+
2839
功能:
2940

3041
- [x] 首页、分类页、搜索页、产品页
@@ -47,4 +58,11 @@
4758

4859
[1]: http://small.ડ.com
4960
[2]: https://github.com/xenv/S-mall-servlet
50-
[3]: https://github.com/xenv/S-mall-ssh
61+
[3]: https://github.com/xenv/S-mall-ssh
62+
[4]: http://www.cnblogs.com/bukong/p/small-start.html
63+
[5]: http://www.cnblogs.com/bukong/p/mybatis-generator-insulate.html
64+
[6]: http://www.cnblogs.com/bukong/p/mybatis-generator-delete-flag.html
65+
[7]: http://www.cnblogs.com/bukong/p/mybatis-general-mapper.html
66+
[8]: http://www.cnblogs.com/bukong/p/ssm-BaseService.html
67+
[9]: http://www.cnblogs.com/bukong/p/ssm-auth.html
68+
[10]: http://www.cnblogs.com/bukong/p/ssm-aop-verification.html

pom.xml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
19-
-->
20-
<!-- $Id: pom.xml 642118 2008-03-28 08:04:16Z reinhard $ -->
2+
213
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
224

235
<modelVersion>4.0.0</modelVersion>

src/main/java/tmall/controller/admin/UserController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.springframework.web.bind.annotation.RequestMapping;
66
import tmall.annotation.Auth;
77
import tmall.pojo.User;
8+
import tmall.util.Pagination;
89

910
import java.util.List;
1011

@@ -13,8 +14,8 @@
1314
public class UserController extends AdminBaseController {
1415
@Auth(User.Group.admin)
1516
@RequestMapping("list")
16-
public String list(Model model) throws Exception {
17-
List<User> users = userService.list();
17+
public String list(Model model, Pagination pagination) throws Exception {
18+
List<User> users = userService.list("pagination", pagination);
1819
model.addAttribute("users", users);
1920
return "/admin/listUser";
2021
}

src/main/java/tmall/service/impl/BaseServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ public BasePOJO get(int id) throws Exception {
131131
@Override
132132
public BasePOJO get(int id, int depth) throws Exception {
133133
BasePOJO object = (BasePOJO) mapper.selectByPrimaryKey(id, depth);
134+
if (object == null) {
135+
throw new NoSuchObjectException("访问的id不存在或已经被删除");
136+
}
134137
return object;
135138
}
136139

0 commit comments

Comments
 (0)