소스 검색

Merge remote-tracking branch 'origin/master'

Joburgess 5 년 전
부모
커밋
d1e7c37278
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

+ 5 - 4
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiOperation;
 import java.util.Date;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -27,21 +28,21 @@ public class NewsController extends BaseController {
 	private SysNewsInformationService sysNewsInformationService;
 
 	@ApiOperation("资讯列表分页查询")
-	@GetMapping("/list")
+	@GetMapping(value = "/list", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object getList(NewsInformationQueryInfo queryInfo) {
 		return succeed(sysNewsInformationService.queryPage(queryInfo));
 	}
 
 	@ApiOperation("查询资讯详情")
 	@ApiImplicitParam(name = "id", value = "资讯ID编号", required = true, dataType = "Long", paramType = "path")
-	@GetMapping("/query/{id}")
+	@GetMapping(value = "/query/{id}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object query(@PathVariable("id") Long id) {
 
 		return succeed(sysNewsInformationService.get(id));
 	}
 
 	@ApiOperation("新增资讯")
-	@PostMapping("/add")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object add(SysNewsInformation newsInfo) {
 		Date date = new Date();
 		newsInfo.setCreateTime(date);
@@ -51,7 +52,7 @@ public class NewsController extends BaseController {
 	}
 
 	@ApiOperation("更新资讯")
-	@PostMapping("/update")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object update(SysNewsInformation newsInfo) {
 		Date date = new Date();
 		newsInfo.setUpdateTime(date);