Skip to content
切换导航面板
项目
群组
代码片段
帮助
zhangtai
/
zzhnc
当前项目
正在载入...
登录
切换导航面板
转到一个项目
项目
版本库
问题
0
合并请求
0
流水线
维基
设置
活动
图像
图表
创建新的问题
作业
提交
问题看板
文件
提交
分支
标签
贡献者
图像
比较
图表
Commit cab21e84
由
zxt@theyeasy.com
编写于
Dec 28, 2017
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'zxt'
2 个父辈
1fa36364
ee2232a1
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
9 行删除
src/com/w1hd/zzhnc/controller/pc/ArticlesController.java
src/com/w1hd/zzhnc/service/GoodsService.java
src/com/w1hd/zzhnc/service/PrizeService.java
src/com/w1hd/zzhnc/service/SellerService.java
src/com/w1hd/zzhnc/controller/pc/ArticlesController.java
查看文件 @
cab21e8
...
...
@@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
...
...
@@ -33,15 +34,19 @@ public class ArticlesController extends BaseController {
// 列表
@RequestMapping
(
value
=
"/getArticlesList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
getArticlesList
(
Integer
page
,
Integer
pagesize
,
String
keyword
)
{
public
Object
getArticlesList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
,
required
=
false
)
Integer
size
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
)
{
return
new
Vo_msg
(
0
,
articleService
.
getArticlesList
(
page
,
page
size
,
keyword
));
return
new
Vo_msg
(
0
,
articleService
.
getArticlesList
(
page
,
size
,
keyword
));
}
// 添加
@RequestMapping
(
value
=
"/addArticle"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
addArticle
(
String
title
,
String
content
,
String
imgurl
)
{
public
Object
addArticle
(
@RequestParam
(
value
=
"title"
,
required
=
true
)
String
title
,
@RequestParam
(
value
=
"content"
,
required
=
true
)
String
content
,
@RequestParam
(
value
=
"imgurl"
,
required
=
false
)
String
imgurl
)
{
String
result
=
articleService
.
addArticle
(
title
,
content
,
imgurl
);
if
(
result
.
equals
(
"ok"
))
{
return
new
Vo_msg
(
0
,
null
,
"添加成功"
);
...
...
@@ -51,7 +56,7 @@ public class ArticlesController extends BaseController {
}
// 修改
@RequestMapping
(
value
=
"/updateArticle"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/updateArticle"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateArticle
(
Integer
id
,
String
title
,
String
content
,
String
imgurl
)
{
String
result
=
articleService
.
updateArticle
(
id
,
title
,
content
,
imgurl
);
...
...
@@ -63,7 +68,7 @@ public class ArticlesController extends BaseController {
}
// 删除
@RequestMapping
(
value
=
"/deleteArticle"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/deleteArticle"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
deleteArticle
(
Integer
id
)
{
String
result
=
articleService
.
deleteArticle
(
id
);
...
...
@@ -75,7 +80,7 @@ public class ArticlesController extends BaseController {
}
// 获取
@RequestMapping
(
value
=
"/getArticle"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getArticle"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
getArticle
(
Integer
id
)
{
Articles
article
=
articleService
.
getArticle
(
id
);
...
...
src/com/w1hd/zzhnc/service/GoodsService.java
查看文件 @
cab21e8
...
...
@@ -54,7 +54,7 @@ public class GoodsService {
}
c
.
andEqualTo
(
"deleted"
,
false
);
RowBounds
row
=
new
RowBounds
(
page
-
1
,
size
);
RowBounds
row
=
new
RowBounds
(
(
page
-
1
)
*
size
,
size
);
List
<
Goods
>
list
=
goodsDao
.
selectByExampleAndRowBounds
(
ex
,
row
);
int
count
=
goodsDao
.
selectCountByExample
(
ex
);
PageResults
<
Goods
>
pageResults
=
new
PageResults
<>();
...
...
src/com/w1hd/zzhnc/service/PrizeService.java
查看文件 @
cab21e8
...
...
@@ -37,7 +37,7 @@ public class PrizeService {
c
.
andCondition
(
" (name like \"%"
+
key
+
"%\" )"
);
}
c
.
andEqualTo
(
"deleted"
,
false
);
RowBounds
row
=
new
RowBounds
(
pag
e
,
size
);
RowBounds
row
=
new
RowBounds
(
(
page
-
1
)
*
siz
e
,
size
);
List
<
Prize
>
list
=
prizeDao
.
selectByExampleAndRowBounds
(
ex
,
row
);
int
count
=
prizeDao
.
selectCountByExample
(
ex
);
PageResults
<
Prize
>
pageResults
=
new
PageResults
<>();
...
...
src/com/w1hd/zzhnc/service/SellerService.java
查看文件 @
cab21e8
...
...
@@ -38,7 +38,7 @@ public class SellerService {
c
.
andEqualTo
(
"sellerId"
,
sellerId
);
}
c
.
andEqualTo
(
"deleted"
,
false
);
RowBounds
row
=
new
RowBounds
(
pag
e
,
size
);
RowBounds
row
=
new
RowBounds
(
(
page
-
1
)
*
siz
e
,
size
);
List
<
Seller
>
list
=
sellerDao
.
selectByExampleAndRowBounds
(
ex
,
row
);
int
count
=
sellerDao
.
selectCountByExample
(
ex
);
PageResults
<
Seller
>
pageResults
=
new
PageResults
<>();
...
...
编写
预览
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
请先完成此消息的编辑!
取消
请
注册
或
登录
后发表评论