I want to create a StudentApiController annotation for RequestMapping. It needs to add auto prefix for the RequestMapping.
Example usage 1:
@StudentApiController(value="/payment")
class PaymentEndpoint
mapping value needs to be "/student/payment"
Example usage 2:
@StudentApiController(value="/exam")
class ExamEndpoint
mapping value needs to be "/student/exam"
This is my code:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping
annotation class StudentApiController(
val value: String = "",
@get:AliasFor(annotation = RequestMapping::class, attribute = "value")
val aliasValue: String = "/student" + value
)
I am getting this error: Default value of annotation parameter must be a compile-time constant