10
10
import io .swagger .annotations .ApiOperation ;
11
11
import org .springframework .beans .factory .annotation .Autowired ;
12
12
import org .springframework .http .MediaType ;
13
- import org .springframework .web .bind .annotation .PathVariable ;
14
- import org .springframework .web .bind .annotation .RequestMapping ;
15
- import org .springframework .web .bind .annotation .RequestMethod ;
16
- import org .springframework .web .bind .annotation .RestController ;
13
+ import org .springframework .web .bind .annotation .*;
17
14
18
15
/**
19
16
* 把今天最好的表现当作明天最新的起点..~
@@ -47,7 +44,7 @@ public QuestionController(QuestionService service) {
47
44
* @param id id
48
45
* @return result
49
46
*/
50
- @ ApiOperation (value = "查找用户 " , notes = "查找用户 " , httpMethod = "GET" , produces = MediaType .APPLICATION_JSON_UTF8_VALUE )
47
+ @ ApiOperation (value = "查找问题 " , notes = "查找问题 " , httpMethod = "GET" , produces = MediaType .APPLICATION_JSON_UTF8_VALUE )
51
48
@ RequestMapping (value = "findById/{id}" , method = RequestMethod .GET )
52
49
@ ApiImplicitParams ({
53
50
@ ApiImplicitParam (name = "id" , value = "唯一id" , required = true , dataType = "Long" , paramType = "path" ),
@@ -60,4 +57,16 @@ public Result findUserById(@PathVariable("id") Long id) {
60
57
return new Result <>(questionModel );
61
58
}
62
59
60
+ /**
61
+ * 根据id 查找用户
62
+ *
63
+ * @return result
64
+ */
65
+ @ ApiOperation (value = "添加" , notes = "添加" , httpMethod = "POST" , produces = MediaType .APPLICATION_JSON_UTF8_VALUE )
66
+ @ RequestMapping (value = "findById/{id}" , method = RequestMethod .POST )
67
+ public Result addQuestion (@ RequestBody QuestionModel questionModel ) {
68
+ boolean add = service .add (questionModel );
69
+ return new Result <>(add );
70
+ }
71
+
63
72
}
0 commit comments