提交 7d6bba6b authored 作者: xc's avatar xc

xc

上级 17f1079c
...@@ -9,10 +9,16 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -9,10 +9,16 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@AutoDocument @AutoDocument
@Api(tags = "通知接口") @Api(tags = "通知接口")
...@@ -26,9 +32,9 @@ public class NoticeController { ...@@ -26,9 +32,9 @@ public class NoticeController {
@ApiOperation(value = "测试接口") @ApiOperation(value = "测试接口")
@ApiImplicitParam(name = "notice", value = "", dataType = "String", paramType = "query", required = true) @ApiImplicitParam(name = "notice", value = "", dataType = "String", paramType = "query", required = true)
@PostMapping("/testNotice") @PostMapping("/testNotice")
public String test(@RequestParam String notice){ public ResponseEntity test(@RequestParam String notice){
System.out.println(notice); System.out.println(notice);
return "test"; return ResponseEntity.ok(true);
} }
/** /**
...@@ -39,9 +45,9 @@ public class NoticeController { ...@@ -39,9 +45,9 @@ public class NoticeController {
@ApiOperation(value = "新增通知接口") @ApiOperation(value = "新增通知接口")
@ApiImplicitParam(name = "notice", value = "通知实体", dataType = "Notice", paramType = "body", required = true) @ApiImplicitParam(name = "notice", value = "通知实体", dataType = "Notice", paramType = "body", required = true)
@PostMapping("/addNotice") @PostMapping("/addNotice")
public String addNotice(@RequestBody @Valid Notice notice){ public ResponseEntity addNotice(@RequestBody @Valid Notice notice){
System.out.println(notice); System.out.println(notice);
return noticeService.addNotice(notice); return ResponseEntity.ok(true);
} }
/** /**
...@@ -51,29 +57,40 @@ public class NoticeController { ...@@ -51,29 +57,40 @@ public class NoticeController {
*/ */
@ApiOperation(value = "修改通知接口") @ApiOperation(value = "修改通知接口")
@ApiImplicitParam(name = "notice", value = "通知实体", dataType = "Notice", paramType = "body", required = true) @ApiImplicitParam(name = "notice", value = "通知实体", dataType = "Notice", paramType = "body", required = true)
@PostMapping("/updateNotice") @PutMapping("/updateNotice")
public String updateNotice(@RequestBody @Valid Notice notice){ public ResponseEntity updateNotice(@RequestBody @Valid Notice notice){
System.out.println(notice); System.out.println(notice);
return noticeService.updateNotice(notice); return ResponseEntity.ok(true);
} }
@ApiOperation(value = "查看通知接口") @ApiOperation(value = "查看通知接口")
@ApiImplicitParam(name = "id", value = "通知id", paramType = "query", @ApiImplicitParam(name = "id", value = "通知id", paramType = "query",
required = true, example = "1") required = true, example = "1", dataType = "int")
@PostMapping("/getNotice") @GetMapping("/getNotice")
public String getNotice(@RequestParam int id){ public ResponseEntity<Notice> getNotice(@RequestParam int id){
System.out.println(id); System.out.println(id);
return noticeService.getNotice(id); return ResponseEntity.ok(new Notice());
} }
@PostMapping("/getNoticeList") @GetMapping("/getNoticeList")
@ApiOperation(value = "获取通知列表接口", notes = "获取列表,type为通知类型,接收 0,发送 1,草稿 2,消息提醒 0") @ApiOperation(value = "获取通知列表接口", notes = "获取列表,type为通知类型,接收 0,发送 1,草稿 2,消息提醒 0")
@ApiImplicitParams({@ApiImplicitParam(name = "user", value = "当前用户名称", paramType = "query", required = true, example = "username", dataType = "String"), @ApiImplicitParams({@ApiImplicitParam(name = "user", value = "当前用户名称", paramType = "query", required = true, example = "username", dataType = "String"),
@ApiImplicitParam(name = "type", value = "通知类型", paramType = "query", required = true, example = "0", dataType = "int")}) @ApiImplicitParam(name = "type", value = "通知类型", paramType = "query", required = true, example = "0", dataType = "int"),
public String getNoticeList(@RequestParam String user, int type){ @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "int"),
return noticeService.getReceiveList(user, type); @ApiImplicitParam(name = "pageSize", value = "条数", paramType = "query", required = true, dataType = "int")})
public ResponseEntity<List<Notice>> getNoticeList(@RequestParam String user, int type, int pageNum, int pageSize){
return ResponseEntity.ok(new ArrayList<>());
} }
@PutMapping("/updateStatus")
@ApiOperation(value = "修改通知为已读")
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "通知id列表", paramType = "query", required = true,
allowMultiple = true, dataType = "int")})
public ResponseEntity updateStatus(@RequestParam List<Integer> ids){
System.out.println(ids);
return ResponseEntity.ok(true);
}
} }
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
<artifactId>efs-misc</artifactId> <artifactId>efs-misc</artifactId>
<properties> <properties>
<swagger.version>2.9.0</swagger.version> <swagger.version>2.8.0</swagger.version>
</properties> </properties>
<dependencies> <dependencies>
<!--swagger2 enable dependency--> <!--swagger2 enable dependency-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId> <artifactId>spring-boot-configuration-processor</artifactId>
...@@ -49,6 +48,7 @@ ...@@ -49,6 +48,7 @@
<version>${swagger.version}</version> <version>${swagger.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论