Class TwitterController
java.lang.Object
ch.bztf.m226blb1.Base.BaseController
ch.bztf.m226blb1.Platforms.Twitter.TwitterController
-
Field Summary
Fields inherited from class ch.bztf.m226blb1.Base.BaseController
service
-
Constructor Summary
ConstructorDescriptionTwitterController
(TwitterService service) Constructor for theTwitterController
. -
Method Summary
-
Constructor Details
-
TwitterController
Constructor for theTwitterController
.- Parameters:
service
- TheTwitterService
to use.
-
-
Method Details
-
status
Description copied from class:BaseController
Check if the controller is up and running. It can be requested via the base path/
.- Overrides:
status
in classBaseController
- Returns:
- A
ResponseHandler
with the status of the controller
-
getUser
@GetMapping("/user") public ResponseHandler<User> getUser(@RequestParam("username") @NotBlank @NotBlank String username, @RequestParam(name="api_key",required=false) @RequestHeader(name="Authorization",required=false) @Size(min=128,max=128) @NotBlank @Size(min=128,max=128) @NotBlank String apiKey) Description copied from class:BaseController
Gets the stats of a user by itsusername
. It can be requested via the path/user
.- Overrides:
getUser
in classBaseController
- Parameters:
username
- the username of theuser
apiKey
- the api key of theaccount
. Can also be passed via theHttpHeaders.AUTHORIZATION
header.- Returns:
- the stats of the
user
by theusername
- See Also:
-
BaseController.service
GetMapping
-
getPosts
@GetMapping("/posts") public ResponseHandler<Set<Post>> getPosts(@RequestParam("username") @NotBlank @NotBlank String username, @RequestParam(name="api_key",required=false) @RequestHeader(name="Authorization",required=false) @Size(min=128,max=128) @NotBlank @Size(min=128,max=128) @NotBlank String apiKey, @RequestParam(name="limit",required=false) @RequestHeader(name="Content-Length",required=false) Optional<Integer> limit) Description copied from class:BaseController
- Overrides:
getPosts
in classBaseController
- Parameters:
username
- the username of theuser
apiKey
- the api key of theaccount
. Can also be passed via theHttpHeaders.AUTHORIZATION
header.limit
- the limit for the posts (must be greater than 0)- Returns:
- a
ResponseHandler
with a set of the last (limit
)posts
of the user with the givenusername
- See Also:
-
BaseController.service
GetMapping
-