规范方法

This commit is contained in:
msgroup 2021-07-12 07:49:38 +08:00
parent 4e8fbac7e1
commit 1436686176
7 changed files with 27 additions and 38 deletions

View File

@ -104,7 +104,7 @@ public class CategoryAction extends BaseAction {
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping("/list")
@RequestMapping(value="/list",method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
BasicUtil.startPage();

View File

@ -107,7 +107,7 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping("/list")
@PostMapping("/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
BasicUtil.startPage();

View File

@ -51,9 +51,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -111,7 +109,7 @@ public class GeneraterAction extends BaseAction {
*
* @return
*/
@RequestMapping("/index")
@GetMapping("/index")
public String index(HttpServletRequest request, ModelMap model) {
return "/cms/generate/index";
}
@ -122,7 +120,7 @@ public class GeneraterAction extends BaseAction {
* @param request
* @param response
*/
@RequestMapping("/generateIndex")
@RequestMapping(value="/generateIndex",method = {RequestMethod.GET, RequestMethod.POST})
@RequiresPermissions("cms:generate:index")
@LogAnn(title = "生成主页", businessType = BusinessTypeEnum.UPDATE)
@ResponseBody
@ -150,7 +148,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param categoryId
*/
@RequestMapping("/{categoryId}/genernateColumn")
@RequestMapping(value="/{categoryId}/genernateColumn",method = {RequestMethod.GET, RequestMethod.POST})
@LogAnn(title = "生成栏目", businessType = BusinessTypeEnum.UPDATE)
@RequiresPermissions("cms:generate:column")
@ResponseBody
@ -216,7 +214,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param columnId
*/
@RequestMapping("/{columnId}/generateArticle")
@RequestMapping(value="/{columnId}/generateArticle",method = {RequestMethod.GET, RequestMethod.POST})
@RequiresPermissions("cms:generate:article")
@LogAnn(title = "生成文章", businessType = BusinessTypeEnum.UPDATE)
@ResponseBody
@ -273,7 +271,7 @@ public class GeneraterAction extends BaseAction {
* @param request
* @return
*/
@RequestMapping("/{position}/viewIndex")
@RequestMapping(value="/{position}/viewIndex",method = {RequestMethod.GET, RequestMethod.POST})
public String viewIndex(HttpServletRequest request, @PathVariable String position, HttpServletResponse response) {
AppEntity app = BasicUtil.getApp();
// 组织主页预览地址

View File

@ -37,13 +37,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.ui.ModelMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.entity.CategoryEntity;
@ -108,7 +103,7 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping("/list")
@RequestMapping(value="/list",method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) {
BasicUtil.startPage();

View File

@ -38,11 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
@ -97,7 +93,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping("/list")
@PostMapping("/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
BasicUtil.startPage();

View File

@ -317,7 +317,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
* @param request 搜索id
* @param response
*/
@RequestMapping(value = "search")
@RequestMapping(value = "search",method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public String search(HttpServletRequest request, HttpServletResponse response) {
//设置分页类

View File

@ -284,7 +284,7 @@
};
var form = JSON.parse(JSON.stringify(that.form));
if (form.contentType.length > 0) {
if (form.contentType!=null && form.contentType.length > 0) {
form.contentType = form.contentType.join(',');
}