Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
96fc15e0
Commit
96fc15e0
authored
May 22, 2018
by
zhh
Browse files
商品分类接口修改
parent
aba49c58
Changes
3
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/controller/PmsProductCategoryController.java
View file @
96fc15e0
...
...
@@ -65,8 +65,16 @@ public class PmsProductCategoryController {
return
new
CommonResult
().
pageSuccess
(
productCategoryList
);
}
@ApiOperation
(
"根据id获取商品分类"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
getItem
(
@PathVariable
Long
id
)
{
PmsProductCategory
productCategory
=
productCategoryService
.
getItem
(
id
);
return
new
CommonResult
().
success
(
productCategory
);
}
@ApiOperation
(
"删除商品分类"
)
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
POS
T
)
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
GE
T
)
@ResponseBody
public
Object
delete
(
@PathVariable
Long
id
)
{
int
count
=
productCategoryService
.
delete
(
id
);
...
...
mall-admin/src/main/java/com/macro/mall/service/PmsProductCategoryService.java
View file @
96fc15e0
...
...
@@ -20,4 +20,5 @@ public interface PmsProductCategoryService {
List
<
PmsProductCategory
>
getList
(
Long
parentId
,
Integer
pageSize
,
Integer
pageNum
);
int
delete
(
Long
id
);
PmsProductCategory
getItem
(
Long
id
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductCategoryServiceImpl.java
View file @
96fc15e0
...
...
@@ -29,6 +29,7 @@ public class PmsProductCategoryServiceImpl implements PmsProductCategoryService
@Override
public
int
create
(
PmsProductCategoryParam
pmsProductCategoryParam
)
{
PmsProductCategory
productCategory
=
new
PmsProductCategory
();
productCategory
.
setProductCount
(
0
);
BeanUtils
.
copyProperties
(
pmsProductCategoryParam
,
productCategory
);
//没有父分类时为一级分类
setCategoryLevel
(
productCategory
);
...
...
@@ -64,6 +65,11 @@ public class PmsProductCategoryServiceImpl implements PmsProductCategoryService
return
productCategoryMapper
.
deleteByPrimaryKey
(
id
);
}
@Override
public
PmsProductCategory
getItem
(
Long
id
)
{
return
productCategoryMapper
.
selectByPrimaryKey
(
id
);
}
/**
* 根据分类的parentId设置分类的level
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment