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

feat: add gen api @doc comment to logic handler routes

Open ch3nnn opened this issue 1 year ago • 1 comments

example:

demo.api

syntax = "v1"

type Request {
	Name string `path:"name,options=you|me"`
}

type Response {
	Message string `json:"message"`
}

service demo-api {

	@doc "demo comment"
	@handler DemoHandler
	get /from/:name(Request) returns (Response)

	@doc ("demo list comment")
	@handler DemoListHandler
	get /from/list returns (Response)

	@doc(
		summary: "comment comment comment"
	)
	@handler NoResponseHandler
	get /from/get (Request)
}

generate logic handler routes comment

image

image

image

ch3nnn avatar Dec 13 '23 14:12 ch3nnn

@kevwan I hope you can help me see if this change is reasonable and correct. thank!

ch3nnn avatar Dec 13 '23 15:12 ch3nnn

i see change approved, want to know the current PR can be merged ? @kevwan

ch3nnn avatar Mar 18 '24 14:03 ch3nnn

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.14%. Comparing base (2629636) to head (7e31aa9). Report is 40 commits behind head on master.

Additional details and impacted files

see 253 files with indirect coverage changes

codecov[bot] avatar Mar 30 '24 09:03 codecov[bot]