go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Can add a middleware that supports single routing

Open xjl12322 opened this issue 2 years ago • 2 comments

So I need to split multiple routing groups. I just want to specify an interface under the same routing group that requires jwt verification. Other interfaces do not need to For example in the following example, I need the add, getById method jwt check。No other method is needed @server( prefix: book/v1 group: book ) service book-api{ jwt: JwtAuth @handler add post /add (AddBookReq) returns (AddBookResp) jwt: JwtAuth @handler getById get /get(GetBookByIdReq) returns (GetBookByIdResp) @handler getByIdList post /getIdList(GetBookByIdListReq) returns (GetBookByIdListResp)`` }`

xjl12322 avatar Sep 08 '23 03:09 xjl12322

Sure, you can separate the jwt related routes from others in API file.

kevwan avatar Sep 08 '23 15:09 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 16 '24 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 18 '24 02:12 github-actions[bot]