|
@@ -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);
|