fix generate

接口返回list如果是nil,则赋值为空数组
前端State类加构造函数
This commit is contained in:
maxbad
2024-01-08 17:51:20 +08:00
parent de78b3604e
commit b051c98dec
3 changed files with 6 additions and 1 deletions

View File

@@ -27,6 +27,10 @@ func (c *c@{.varName}) List(ctx context.Context, req *@{.varName | ToLower}.List
if err != nil {
return
}
if list == nil {
list = []*@{.templateGroup}in.@{.varName}ListModel{}
}
res = new(@{.varName | ToLower}.ListRes)
res.List = list