Example #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
}
Example #2
0
// 设置值
func (this *articleImpl) SetValue(v *content.Article) error {
	v.Id = this.GetDomainId()
	this._value = v
	return nil
}