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
|
package com.cubetiqs.web.controller.admin
|
||||||
|
|
||||||
|
import com.cubetiqs.web.annotation.ApiBearerAuth
|
||||||
import com.cubetiqs.web.controller.BaseController
|
import com.cubetiqs.web.controller.BaseController
|
||||||
import com.cubetiqs.web.util.RouteConstants
|
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 io.swagger.v3.oas.annotations.tags.Tag
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(RouteConstants.ADMIN)
|
@RequestMapping(RouteConstants.ADMIN)
|
||||||
class AdminController : BaseController {
|
class AdminController : BaseController {
|
||||||
@Operation(security = [SecurityRequirement(name = "bearerAuth")])
|
@ApiBearerAuth
|
||||||
@GetMapping
|
@GetMapping
|
||||||
fun getAdmin(): String {
|
fun getAdmin(): String {
|
||||||
return "Admin"
|
return "Admin"
|
||||||
|
Loading…
Reference in New Issue
Block a user