@ -10,16 +10,16 @@ import (
)
type ExpandLogic struct {
svcCtx *svc.ServiceContext
ctx context.Context
logx.Logger
}
func NewExpandLogic(ctx context.Context, svcCtx *svc.ServiceContext) ExpandLogic {
return ExpandLogic{
svcCtx: svcCtx,
ctx: ctx,
Logger: logx.WithContext(ctx),
type ShortenLogic struct {
func NewShortenLogic(ctx context.Context, svcCtx *svc.ServiceContext) ShortenLogic {
return ShortenLogic{
func NewExpandLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExpandLogic {
return &ExpandLogic{
@ -12,16 +12,16 @@ import (
func NewShortenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShortenLogic {
return &ShortenLogic{
@ -20,16 +20,16 @@ import (
type {{.logic}} struct {
func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) {{.logic}} {
return {{.logic}}{
@ -9,7 +9,7 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
// struct匹配
// struct match
const typeRegex = `(?m)(?m)(^ *type\s+[a-zA-Z][a-zA-Z0-9_-]+\s+(((struct)\s*?\{[\w\W]*?[^\{]\})|([a-zA-Z][a-zA-Z0-9_-]+)))|(^ *type\s*?\([\w\W]+\}\s*\))`
var (