Add security ApiBearerAuth annonation

main
Sambo Chea 1 year ago
parent 4561e68c28
commit bba03096a5
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490

@ -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…
Cancel
Save