|
@@ -5,6 +5,7 @@ import com.zheng.cms.dao.model.CmsCategory;
|
|
|
import com.zheng.cms.dao.model.CmsCategoryExample;
|
|
import com.zheng.cms.dao.model.CmsCategoryExample;
|
|
|
import com.zheng.cms.rpc.api.CmsCategoryService;
|
|
import com.zheng.cms.rpc.api.CmsCategoryService;
|
|
|
import com.zheng.common.util.Paginator;
|
|
import com.zheng.common.util.Paginator;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -26,6 +27,7 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
@Controller
|
|
@Controller
|
|
|
@RequestMapping("/manage/category")
|
|
@RequestMapping("/manage/category")
|
|
|
|
|
+@Api(value = "类目控制器")
|
|
|
public class CmsCategoryController extends BaseController {
|
|
public class CmsCategoryController extends BaseController {
|
|
|
|
|
|
|
|
private final static Logger _log = LoggerFactory.getLogger(CmsCategoryController.class);
|
|
private final static Logger _log = LoggerFactory.getLogger(CmsCategoryController.class);
|
|
@@ -43,7 +45,7 @@ public class CmsCategoryController extends BaseController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "类目列表", notes = "获取类目列表并分页")
|
|
@ApiOperation(value = "类目列表", notes = "获取类目列表并分页")
|
|
|
- @RequestMapping("/list")
|
|
|
|
|
|
|
+ @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
public String list(
|
|
public String list(
|
|
|
@RequestParam(required = false, defaultValue = "1", value = "page") int page,
|
|
@RequestParam(required = false, defaultValue = "1", value = "page") int page,
|
|
|
@RequestParam(required = false, defaultValue = "20", value = "rows") int rows,
|
|
@RequestParam(required = false, defaultValue = "20", value = "rows") int rows,
|
|
@@ -70,6 +72,7 @@ public class CmsCategoryController extends BaseController {
|
|
|
* 新增get
|
|
* 新增get
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @ApiOperation(value = "新增类目", notes = "新增类目页")
|
|
|
@RequestMapping(value = "/add", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/add", method = RequestMethod.GET)
|
|
|
public String add() {
|
|
public String add() {
|
|
|
return "/manage/category/add";
|
|
return "/manage/category/add";
|
|
@@ -81,9 +84,8 @@ public class CmsCategoryController extends BaseController {
|
|
|
* @param modelMap
|
|
* @param modelMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- @ApiOperation(value = "创建类目", notes = "根据CmsCategory对象创建类目")
|
|
|
|
|
|
|
+ @ApiOperation(value = "新增类目", notes = "新增类目提交接口")
|
|
|
@ApiImplicitParam(name = "cmsCategory", value = "类目实体cmsCategory", required = true, dataType = "CmsCategory")
|
|
@ApiImplicitParam(name = "cmsCategory", value = "类目实体cmsCategory", required = true, dataType = "CmsCategory")
|
|
|
-
|
|
|
|
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
|
public String add(CmsCategory cmsCategory, ModelMap modelMap) {
|
|
public String add(CmsCategory cmsCategory, ModelMap modelMap) {
|
|
|
long time = System.currentTimeMillis();
|
|
long time = System.currentTimeMillis();
|
|
@@ -101,6 +103,7 @@ public class CmsCategoryController extends BaseController {
|
|
|
* @param modelMap
|
|
* @param modelMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @ApiOperation(value = "删除类目", notes = "批量删除类目")
|
|
|
@RequestMapping(value = "/delete/{ids}",method = RequestMethod.GET)
|
|
@RequestMapping(value = "/delete/{ids}",method = RequestMethod.GET)
|
|
|
public String delete(@PathVariable("ids") String ids, ModelMap modelMap) {
|
|
public String delete(@PathVariable("ids") String ids, ModelMap modelMap) {
|
|
|
int count = cmsCategoryService.deleteByPrimaryKeys(ids);
|
|
int count = cmsCategoryService.deleteByPrimaryKeys(ids);
|
|
@@ -114,6 +117,7 @@ public class CmsCategoryController extends BaseController {
|
|
|
* @param modelMap
|
|
* @param modelMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @ApiOperation(value = "修改类目", notes = "根据id修改类目页")
|
|
|
@RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
|
|
|
public String update(@PathVariable("id") int id, ModelMap modelMap) {
|
|
public String update(@PathVariable("id") int id, ModelMap modelMap) {
|
|
|
CmsCategory category = cmsCategoryService.selectByPrimaryKey(id);
|
|
CmsCategory category = cmsCategoryService.selectByPrimaryKey(id);
|
|
@@ -128,6 +132,7 @@ public class CmsCategoryController extends BaseController {
|
|
|
* @param modelMap
|
|
* @param modelMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @ApiOperation(value = "修改类目", notes = "根据id修改类目提交接口")
|
|
|
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
|
|
public String update(@PathVariable("id") int id, CmsCategory cmsCategory, ModelMap modelMap) {
|
|
public String update(@PathVariable("id") int id, CmsCategory cmsCategory, ModelMap modelMap) {
|
|
|
int count = cmsCategoryService.updateByPrimaryKeySelective(cmsCategory);
|
|
int count = cmsCategoryService.updateByPrimaryKeySelective(cmsCategory);
|