@RestController
@Api(tags = {"user"}, description = "用户操作方法 ")
public class UserController {
@Autowired
private UserService userService;
* 添加用户
*
* @param user
* @return
*/
@ApiOperation(value = "添加用户 ", notes = "大大")
@ApiResponses({
@ApiResponse(code =200, message ="请求成功" ),
@ApiResponse(code =404, message ="文件页面找不到" )
})
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "用户id", dataType = "Long",paramType = "path"),
@ApiImplicitParam(name = "user", value = "用户信息", dataType = "User",paramType = "body")}
)
@RequestMapping(value = "/user/{id}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public User addUser(@PathVariable Long id,@RequestBody User user) {
return userService.addUser(user);
}
@ApiOperation(value = "获取用户列表" )
@ApiImplicitParam
@RequestMapping(value = "/getUser", method = RequestMethod.GET )
public List<User> getUser(UserCondition condition) {
return null;
}
}