Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support generate nested struct for slim template #101

Merged
merged 9 commits into from
Jan 9, 2024

Conversation

FGYFFFF
Copy link
Contributor

@FGYFFFF FGYFFFF commented Jun 13, 2023

Description

slim 模板下支持生成嵌套接口体,使用方法如下:
IDL

struct HelloReq {}

struct HelloResp {
    1: HelloReq FFF (thrift.nested="true");
    2: test.HelloReq222 TTT (thrift.nested="true");
}

命令

thriftgo -r  -g go:enable_nested_struct,template=slim test.thrift

生成代码

type HelloResp struct {
	*HelloReq `thrift:"HelloReq,1" json:"FFF"`
	*example2.HelloReq222 `thrift:"HelloReq222,2" json:"TTT"`
}

兼容性:
单独加了选项控制生产内容,不影响整体的代码生成

Motivation and Context

Related Issue

@FGYFFFF FGYFFFF requested review from a team as code owners June 13, 2023 09:28
@FGYFFFF FGYFFFF force-pushed the feat/nested_struct_for_slim branch from fe7e08c to 408e489 Compare August 31, 2023 06:52
@FGYFFFF FGYFFFF changed the title feat: support generate nested struct for slim template WIP:feat: support generate nested struct for slim template Oct 24, 2023
@FGYFFFF FGYFFFF changed the title WIP:feat: support generate nested struct for slim template feat: support generate nested struct for slim template Nov 8, 2023
@FGYFFFF FGYFFFF force-pushed the feat/nested_struct_for_slim branch 2 times, most recently from e456b01 to dcdc2cf Compare November 9, 2023 06:37
HeyJavaBean
HeyJavaBean previously approved these changes Nov 9, 2023
generator/golang/option.go Outdated Show resolved Hide resolved
@FGYFFFF FGYFFFF force-pushed the feat/nested_struct_for_slim branch from 9e15a4b to 510c16f Compare January 4, 2024 06:28
@FGYFFFF FGYFFFF disabled auto-merge January 8, 2024 07:30
@HeyJavaBean HeyJavaBean merged commit 6f0023e into main Jan 9, 2024
6 checks passed
@HeyJavaBean HeyJavaBean deleted the feat/nested_struct_for_slim branch January 9, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants