1 Star 0 Fork 0

water/goweb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
table_strategy.go 747 Bytes
一键复制 编辑 原始数据 按行查看 历史
leijmdas 提交于 2个月前 . add
package metaentity
import (
"gitee.com/leijmdas/gobase/goconfig/common/base/stringutils"
"gitee.com/leijmdas/gobase/gomini/mini/gometa/db/metacontext"
"strings"
)
type TableStrategy struct {
*EntityField
}
func NewTableStrategy(f *EntityField) *TableStrategy {
return &TableStrategy{EntityField: f}
}
func (self *TableStrategy) ToGoTag() string {
return "`" + `json:"` + self.FieldName + `"` + "`"
}
func (self *TableStrategy) ToGoType() string {
var ctx = metacontext.FindBeanMetadataContext()
return ctx.FindGoType(self.FieldType)
}
func (self *TableStrategy) ToGoStruField() string {
var keys = []string{
"\t",
stringutils.Case2Camel(self.FieldName),
self.ToGoType(),
self.ToGoTag(),
}
return strings.Join(keys, " ")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leijmdas/goweb.git
git@gitee.com:leijmdas/goweb.git
leijmdas
goweb
goweb
v1.2.9

搜索帮助