```
feat(core): 添加 vars 包导入以支持状态回复功能 在生成逻辑文件时,为处理 StatusReply 类型的输出, 添加了对 "git.apinb.com/bsm-sdk/core/vars" 包的导入。 同时调整了模板中导入语句的顺序和格式。 ```
This commit is contained in:
parent
15caac2a20
commit
45079048af
1
main.go
1
main.go
|
@ -181,6 +181,7 @@ func generateLogicFile(gen *protogen.Plugin, file *protogen.File, service *proto
|
|||
|
||||
if strings.ToLower(method.Output.GoIdent.GoName) == "statusreply" {
|
||||
imports = append(imports, "\"time\"")
|
||||
imports = append(imports, "\"git.apinb.com/bsm-sdk/core/vars\"")
|
||||
code = strings.ReplaceAll(code, "{return}", tpl.StatusReplyCode)
|
||||
} else {
|
||||
code = strings.ReplaceAll(code, "{return}", "return ")
|
||||
|
|
|
@ -4,9 +4,9 @@ var LogicFile = `package {methodName}
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
{import}
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
)
|
||||
|
||||
{comment}
|
||||
|
|
Loading…
Reference in New Issue