File tree Expand file tree Collapse file tree 4 files changed +26
-22
lines changed Expand file tree Collapse file tree 4 files changed +26
-22
lines changed Original file line number Diff line number Diff line change 25
25
* 通过 参数注解 进行方法级** 数据校验** ,无需额外配置校验类 (通过 AOP 切面实现)
26
26
* 统一的错误处理
27
27
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
+
28
39
功能:
29
40
30
41
- [x] 首页、分类页、搜索页、产品页
47
58
48
59
[ 1 ] : http://small.ડ.com
49
60
[ 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
Original file line number Diff line number Diff line change 1
1
<?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
+
21
3
<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" >
22
4
23
5
<modelVersion >4.0.0</modelVersion >
Original file line number Diff line number Diff line change 5
5
import org .springframework .web .bind .annotation .RequestMapping ;
6
6
import tmall .annotation .Auth ;
7
7
import tmall .pojo .User ;
8
+ import tmall .util .Pagination ;
8
9
9
10
import java .util .List ;
10
11
13
14
public class UserController extends AdminBaseController {
14
15
@ Auth (User .Group .admin )
15
16
@ 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 );
18
19
model .addAttribute ("users" , users );
19
20
return "/admin/listUser" ;
20
21
}
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ public BasePOJO get(int id) throws Exception {
131
131
@ Override
132
132
public BasePOJO get (int id , int depth ) throws Exception {
133
133
BasePOJO object = (BasePOJO ) mapper .selectByPrimaryKey (id , depth );
134
+ if (object == null ) {
135
+ throw new NoSuchObjectException ("访问的id不存在或已经被删除" );
136
+ }
134
137
return object ;
135
138
}
136
139
You can’t perform that action at this time.
0 commit comments