示例#1
0
// 保存文章
func (this *contentRep) SaveArticle(v *content.Article) (i int, err error) {
	orm := this.Connector.GetOrm()
	if v.Id > 0 {
		_, _, err = orm.Save(v.Id, v)
	} else {
		var id2 int64
		_, id2, err = orm.Save(nil, v)
		v.Id = int(id2)
	}
	return v.Id, err
}
示例#2
0
文件: article.go 项目: yonglehou/go2o
// 设置值
func (this *articleImpl) SetValue(v *content.Article) error {
	v.Id = this.GetDomainId()
	this._value = v
	return nil
}