gf icon indicating copy to clipboard operation
gf copied to clipboard

When use gf gen service,the nested struct can't get generate there own functions

Open ppxb opened this issue 1 year ago • 4 comments

1. What version of Go and system type/arch are you using?

Go Version: 1.20

2. What version of GoFrame are you using?

GoFrame Version: v2.54

3. Can this issue be re-produced with the latest release?

Not sure

4. What did you do?

When use gf gen service, the nested struct can't generate there own functions

codes below:


type sToken struct {
	*gftoken.GfToken
}

func init() {
	service.RegisterToken(New())
}

5. What did you expect to see?

service should auto generate the GfToken's functions

6. What did you see instead?

empty implements about GfToken struct

ppxb avatar Oct 27 '23 04:10 ppxb

Hello @ppxb. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! 你好 @ppxb。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

github-actions[bot] avatar Nov 02 '23 01:11 github-actions[bot]

@ppxb It needs some improvement for command gen service for such feature. It's now using regular expression to implement service go files generating, which is simple and quick. If recognizing nested struct, it might use ast to do so, which might be slow. We need balance the benefits between regular expression and ast plan.

cc @oldme-git you might be interested as we've discussed similar topic recently.

gqcn avatar Nov 02 '23 01:11 gqcn

@gqcn I will pay attention to this issue recently.

oldme-git avatar Nov 02 '23 07:11 oldme-git

@gqcn @oldme-git thanks for your attention. i have resolved this problem temporarily through delete the gf gen service file's TOP COMMENT to customized the interface implements. it works. goframe is a good framework for golang. thanks again.

ppxb avatar Nov 02 '23 11:11 ppxb

Please show #3067

oldme-git avatar Feb 23 '24 16:02 oldme-git