统一url规范

This commit is contained in:
shuzheng 2017-02-16 23:26:06 +08:00
parent 3368984cd1
commit 5b34a0b09c
10 changed files with 31 additions and 45 deletions

View File

@ -75,9 +75,9 @@ public class CmsArticleController extends BaseController {
*/
@ApiOperation(value = "新增文章", notes = "新增文章页")
@RequiresPermissions("cms:article:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/article/add";
return "/manage/article/create";
}
/**
@ -88,14 +88,13 @@ public class CmsArticleController extends BaseController {
*/
@ApiOperation(value = "新增文章", notes = "新增文章提交接口")
@RequiresPermissions("cms:article:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(CmsArticle cmsArticle, ModelMap modelMap) {
long time = System.currentTimeMillis();
cmsArticle.setCtime(time);
cmsArticle.setOrders(time);
int count = cmsArticleService.insertSelective(cmsArticle);
modelMap.put("count", count);
_log.info("新增记录id为{}", cmsArticle.getArticleId());
return "redirect:/manage/article/list";
}

View File

@ -76,9 +76,9 @@ public class CmsCategoryController extends BaseController {
*/
@ApiOperation(value = "新增类目", notes = "新增类目页")
@RequiresPermissions("cms:category:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/category/add";
return "/manage/category/create";
}
/**
@ -90,14 +90,13 @@ public class CmsCategoryController extends BaseController {
@ApiOperation(value = "新增类目", notes = "新增类目提交接口")
@RequiresPermissions("cms:category:create")
@ApiImplicitParam(name = "cmsCategory", value = "类目实体cmsCategory", required = true, dataType = "CmsCategory")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(CmsCategory cmsCategory, ModelMap modelMap) {
long time = System.currentTimeMillis();
cmsCategory.setCtime(time);
cmsCategory.setOrders(time);
int count = cmsCategoryService.insertSelective(cmsCategory);
modelMap.put("count", count);
_log.info("新增记录id为{}", cmsCategory.getCategoryId());
return "redirect:/manage/category/list";
}

View File

@ -75,9 +75,9 @@ public class CmsCommentController extends BaseController {
*/
@ApiOperation(value = "新增评论", notes = "新增评论页")
@RequiresPermissions("cms:comment:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/comment/add";
return "/manage/comment/create";
}
/**
@ -88,12 +88,11 @@ public class CmsCommentController extends BaseController {
*/
@ApiOperation(value = "新增评论", notes = "新增评论提交接口")
@RequiresPermissions("cms:comment:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(CmsComment cmsComment, ModelMap modelMap) {
cmsComment.setCtime(System.currentTimeMillis());
int count = cmsCommentService.insertSelective(cmsComment);
modelMap.put("count", count);
_log.info("新增记录id为{}", cmsComment.getArticleId());
return "redirect:/manage/comment/list";
}

View File

@ -80,9 +80,9 @@ public class CmsTagController extends BaseController {
*/
@ApiOperation(value = "新增标签", notes = "新增标签页")
@RequiresPermissions("cms:tag:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/tag/add";
return "/manage/tag/create";
}
/**
@ -93,14 +93,13 @@ public class CmsTagController extends BaseController {
*/
@ApiOperation(value = "新增标签", notes = "新增标签提交接口")
@RequiresPermissions("cms:tag:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(CmsTag cmsTag, ModelMap modelMap) {
long time = System.currentTimeMillis();
cmsTag.setCtime(time);
cmsTag.setOrders(time);
int count = cmsTagService.insertSelective(cmsTag);
modelMap.put("count", count);
_log.info("新增记录id为{}", cmsTag.getTagId());
return "redirect:/manage/tag/list";
}

View File

@ -92,9 +92,9 @@ public class UserController extends BaseController {
* 新增get
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/user/add";
return "/user/create";
}
/**
@ -103,13 +103,13 @@ public class UserController extends BaseController {
* @param binding
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(@Valid CmsUser user, BindingResult binding) {
if (binding.hasErrors()) {
for (ObjectError error : binding.getAllErrors()) {
_log.error(error.getDefaultMessage());
}
return "/user/add";
return "/user/create";
}
user.setCtime(System.currentTimeMillis());

View File

@ -50,7 +50,6 @@ public class UpmsOrganizationController extends BaseController {
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsOrganizationExample upmsOrganizationExample = new UpmsOrganizationExample();
upmsOrganizationExample.setOffset(offset);
upmsOrganizationExample.setLimit(limit);
@ -67,20 +66,19 @@ public class UpmsOrganizationController extends BaseController {
@ApiOperation(value = "新增组织")
@RequiresPermissions("upms:organization:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/organization/add";
return "/manage/organization/create";
}
@ApiOperation(value = "新增组织")
@RequiresPermissions("cms:organization:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(UpmsOrganization upmsOrganization, ModelMap modelMap) {
long time = System.currentTimeMillis();
upmsOrganization.setCtime(time);
int count = upmsOrganizationService.insertSelective(upmsOrganization);
modelMap.put("count", count);
_log.info("新增记录id为{}", upmsOrganization.getOrganizationId());
return "redirect:/manage/organization/list";
}

View File

@ -64,7 +64,6 @@ public class UpmsPermissionController extends BaseController {
@RequestParam(required = false, defaultValue = "0", value = "type") int type,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsPermissionExample upmsPermissionExample = new UpmsPermissionExample();
if (0 != type) {
upmsPermissionExample.createCriteria()
@ -85,21 +84,20 @@ public class UpmsPermissionController extends BaseController {
@ApiOperation(value = "新增权限")
@RequiresPermissions("upms:permission:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/permission/add";
return "/manage/permission/create";
}
@ApiOperation(value = "新增权限")
@RequiresPermissions("cms:permission:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(UpmsPermission upmsPermission, ModelMap modelMap) {
long time = System.currentTimeMillis();
upmsPermission.setCtime(time);
upmsPermission.setOrders(time);
int count = upmsPermissionService.insertSelective(upmsPermission);
modelMap.put("count", count);
_log.info("新增记录id为{}", upmsPermission.getPermissionId());
return "redirect:/manage/permission/list";
}

View File

@ -49,7 +49,6 @@ public class UpmsRoleController extends BaseController {
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsRoleExample upmsRoleExample = new UpmsRoleExample();
upmsRoleExample.setOffset(offset);
upmsRoleExample.setLimit(limit);
@ -66,21 +65,20 @@ public class UpmsRoleController extends BaseController {
@ApiOperation(value = "新增角色")
@RequiresPermissions("upms:role:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/role/add";
return "/manage/role/create";
}
@ApiOperation(value = "新增角色")
@RequiresPermissions("cms:role:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(UpmsRole upmsRole, ModelMap modelMap) {
long time = System.currentTimeMillis();
upmsRole.setCtime(time);
upmsRole.setOrders(time);
int count = upmsRoleService.insertSelective(upmsRole);
modelMap.put("count", count);
_log.info("新增记录id为{}", upmsRole.getRoleId());
return "redirect:/manage/role/list";
}

View File

@ -49,7 +49,6 @@ public class UpmsSystemController extends BaseController {
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsSystemExample upmsSystemExample = new UpmsSystemExample();
upmsSystemExample.setOffset(offset);
upmsSystemExample.setLimit(limit);
@ -66,21 +65,20 @@ public class UpmsSystemController extends BaseController {
@ApiOperation(value = "新增系统")
@RequiresPermissions("upms:system:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/system/add";
return "/manage/system/create";
}
@ApiOperation(value = "新增系统")
@RequiresPermissions("cms:system:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(UpmsSystem upmsSystem, ModelMap modelMap) {
long time = System.currentTimeMillis();
upmsSystem.setCtime(time);
upmsSystem.setOrders(time);
int count = upmsSystemService.insertSelective(upmsSystem);
modelMap.put("count", count);
_log.info("新增记录id为{}", upmsSystem.getSystemId());
return "redirect:/manage/system/list";
}

View File

@ -49,7 +49,6 @@ public class UpmsUserController extends BaseController {
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
// 数据列表
UpmsUserExample upmsUserExample = new UpmsUserExample();
upmsUserExample.setOffset(offset);
upmsUserExample.setLimit(limit);
@ -66,20 +65,19 @@ public class UpmsUserController extends BaseController {
@ApiOperation(value = "新增用户")
@RequiresPermissions("upms:user:create")
@RequestMapping(value = "/add", method = RequestMethod.GET)
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/manage/user/add";
return "/manage/user/create";
}
@ApiOperation(value = "新增用户")
@RequiresPermissions("cms:user:create")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(UpmsUser upmsUser, ModelMap modelMap) {
long time = System.currentTimeMillis();
upmsUser.setCtime(time);
int count = upmsUserService.insertSelective(upmsUser);
modelMap.put("count", count);
_log.info("新增记录id为{}", upmsUser.getUserId());
return "redirect:/manage/user/list";
}