Merge pull request #77 from maxbad/v2.0

fix generate
This commit is contained in:
孟帅 2024-01-09 09:05:51 +08:00 committed by GitHub
commit 401fa538a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,7 @@ func (c *cEms) SendTest(ctx context.Context, req *common.SendTestEmailReq) (res
}
// SendBindEms 发送换绑邮件
func (c *cSms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *common.SendBindEmsRes, err error) {
func (c *cEms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *common.SendBindEmsRes, err error) {
var (
memberId = contexts.GetUserId(ctx)
models *entity.AdminMember

View File

@ -46,6 +46,7 @@ func (l *gCurd) generateWebModelState(ctx context.Context, in *CurdPreviewInput)
}
buffer.WriteString(fmt.Sprintf(" public %s = %v; // %s\n", field.TsName, value, field.Dc))
}
buffer.WriteString("\n constructor(state?: Partial<State>) {\n if (state) {\n Object.assign(this, state);\n }\n }")
buffer.WriteString("}")
return buffer.String()
}

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