Code optimized (#523)

* optimized markdown generator

* optimized markdown generator

* optimized markdown generator

* add more comment

* add comment

* add comment

* add comments for rpc tool

* add comments for model tool

* add comments for model tool

* add comments for model tool

* add comments for config tool

* add comments for config tool

* add comments

* add comments

* add comments

* add comments

* add comment

* remove rpc main head info

* add comment

* optimized

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
This commit is contained in:
kingxt
2021-02-26 16:11:47 +08:00
committed by GitHub
parent ef146cf5ba
commit e6ef1fca12
104 changed files with 651 additions and 375 deletions

View File

@@ -8,17 +8,22 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/util/stringx"
)
// tableName:user
// {{prefix}}=cache
// key:id
// Key defines cache key variable for generating code
type Key struct {
VarExpression string // cacheUserIdPrefix = "cache#User#id#"
Left string // cacheUserIdPrefix
Right string // cache#user#id#
Variable string // userIdKey
KeyExpression string // userIdKey: = fmt.Sprintf("cache#user#id#%v", userId)
DataKeyExpression string // userIdKey: = fmt.Sprintf("cache#user#id#%v", data.userId)
RespKeyExpression string // userIdKey: = fmt.Sprintf("cache#user#id#%v", resp.userId)
// VarExpression likes cacheUserIdPrefix = "cache#User#id#"
VarExpression string
// Left likes cacheUserIdPrefix
Left string
// Right likes cache#user#id#
Right string
// Variable likes userIdKey
Variable string
// KeyExpression likes userIdKey: = fmt.Sprintf("cache#user#id#%v", userId)
KeyExpression string
// DataKeyExpression likes userIdKey: = fmt.Sprintf("cache#user#id#%v", data.userId)
DataKeyExpression string
// RespKeyExpression likes userIdKey: = fmt.Sprintf("cache#user#id#%v", resp.userId)
RespKeyExpression string
}
// key-数据库原始字段名,value-缓存key相关数据