Package com.skava
Class UserApplication
java.lang.Object
com.skava.UserApplication
@RestController
@RequestMapping("/")
@EntityScan(basePackages={"com.skava","${spring.additionalPackages.scan}"})
@SpringBootApplication(scanBasePackages="com.skava,${spring.additionalPackages.scan}")
@PropertySources(@PropertySource(value={"classpath:swagger-docs.yml","${spring.additonal-swagger-doc.ymls}"},factory=com.skava.core.yaml.YamlPropertySourceFactory.class))
@Configuration
public class UserApplication
extends Object
This class used to start a User Micro-Service as a spring boot application and also hold the configuration for
swagger document generation with the help of spring fox
Starting point of the application.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springdoc.core.customizers.OperationCustomizer
Used to generate auth test tokens for the given user id, role and privilege.static void
The User application Spring boot.io.swagger.v3.oas.models.OpenAPI
openApi
(org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties) Swagger Configuration
-
Constructor Details
-
UserApplication
public UserApplication()
-
-
Method Details
-
main
The User application Spring boot.- Parameters:
args
- the arguments
-
openApi
@Bean public io.swagger.v3.oas.models.OpenAPI openApi(org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties) Swagger Configuration- Returns:
- Docket
- See Also:
-
Docket
-
customize
@Bean public org.springdoc.core.customizers.OperationCustomizer customize() -
getTestTokensForUser
@GetMapping("/getTestTokensForUser") public org.springframework.http.ResponseEntity<Map<String,String>> getTestTokensForUser(@RequestParam String userId, @RequestParam(value="businessId",required=false,defaultValue="1") long businessId, @RequestParam(value="privileges",required=false,defaultValue="true") List<String> privileges, @RequestParam(value="roles",required=false,defaultValue="true") List<String> roles) Used to generate auth test tokens for the given user id, role and privilege.- Parameters:
userId
- Indicates the userid for generating auth test tokenbusinessId
- Indicates the business id for which the auth test token gets generated.privileges
- Indicates the privilege of the user for which the auth test token gets generated.roles
- Indicates the roles of the user for which the auth test token gets generated.- Returns:
- the instance of
Map
of test token values. - Throws:
Exception
-