i am trying to find the best way to add prefix to certain services inside controllers.
To better explain the problem, lets imagine to have 2 controllers
RequestMapping(value = "/api")
public class TryController {
PostMapping(value = "/metA")
public methodA()
PostMapping(value = "/metB")
public methodB()
}
RequestMapping(value = "/apiV2")
public class TryController {
PostMapping(value = "/metC")
public methodC()
PostMapping(value = "/metD")
public methodD()
}
the goal here is that , only for api /api/metA and /apiv2/metC i have to add the keywork “streaming” as prefix, e.g. streaming/api/metA and streaming/apiv2/metC. the other 2 apis sghould remain the same without keyword streaming.
What i am trying difficult to find is the best solution to achieve that, since i dont want to remove requestMapping at controller lever , because in my real example there are so many of services.
thanks for your help
My thought was to create some annotation in order to achieve that, but i dont know how.
Luigi Longo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.