Add security ApiBearerAuth annonation
This commit is contained in:
parent
4561e68c28
commit
bba03096a5
@ -0,0 +1,8 @@
|
||||
package com.cubetiqs.web.annotation
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@Operation(security = [SecurityRequirement(name = "bearerAuth")])
|
||||
annotation class ApiBearerAuth()
|
@ -1,9 +1,8 @@
|
||||
package com.cubetiqs.web.controller.admin
|
||||
|
||||
import com.cubetiqs.web.annotation.ApiBearerAuth
|
||||
import com.cubetiqs.web.controller.BaseController
|
||||
import com.cubetiqs.web.util.RouteConstants
|
||||
import io.swagger.v3.oas.annotations.Operation
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement
|
||||
import io.swagger.v3.oas.annotations.tags.Tag
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController
|
||||
@RestController
|
||||
@RequestMapping(RouteConstants.ADMIN)
|
||||
class AdminController : BaseController {
|
||||
@Operation(security = [SecurityRequirement(name = "bearerAuth")])
|
||||
@ApiBearerAuth
|
||||
@GetMapping
|
||||
fun getAdmin(): String {
|
||||
return "Admin"
|
||||
|
Loading…
Reference in New Issue
Block a user