我怎么做,我写的什么字段,就是什么字段,对我的这些字段不做额外的处理?
//此字段数据库全部是大写
type Content struct {
ID int orm:"pk;auto"
Title string
Content string
MD5 string
Path string
Tag string orm:"default(0)
Source string
Shares int orm:"default(0)
Hits int orm:"default(0)"
Comments int orm:"default(0)"
Status int orm:"default(1)"
UpdateTime time.Time orm:"auto_now_add;type(datetime)"
}
func SaveContent(content *Content) int64 { orm.Debug = true //true 打印数据库操作日志信息 o := orm.NewOrm() id, _ := o.Insert(content) return id
} 打印日志就都是小写了
INSERT INTO content
(title
, content
, m_d5
, path
, tag
, source
, shares
, hits
, comments
, status
, update_time
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] - `