You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
741 B

package {{.pkgName}}
import (
{{.imports}}
)
type {{.logic}} struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
{{if .hasDoc}}{{.doc}}{{end}}
func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} {
return &{{.logic}}{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} {
//
// 1.
// var xxx model.XXX
// err := l.svcCtx.Db.Model(model.XXX{}).Where("id = ?", id).Find(&xxx).Error
return &types.Response{
Success: true,
Code : 200,
Msg: "{{if .hasDoc}}{{.doc}}{{end}}"+" success",
Data: nil,
},nil
}