示例#1
0
文件: db.go 项目: sisteamnik/guseful
func createRate(db *gorp.Transaction, guruid int64) error {
	humor := rate.Rate{
		ItemType: 0,
		ItemId:   guruid,
	}
	goodwill := rate.Rate{
		ItemType: 1,
		ItemId:   guruid,
	}
	understandability := rate.Rate{
		ItemType: 2,
		ItemId:   guruid,
	}
	err := db.Insert(&humor, &goodwill, &understandability)
	return err
}
示例#2
0
文件: db.go 项目: sisteamnik/guseful
func createFeatures(db *gorp.Transaction, guruid int64) error {
	humor := GuruFeatures{
		Feature: "humor",
		GuruId:  guruid,
	}
	goodwill := GuruFeatures{
		Feature: "goodwill",
		GuruId:  guruid,
	}
	understandability := GuruFeatures{
		Feature: "understandability",
		GuruId:  guruid,
	}
	err := db.Insert(&humor, &goodwill, &understandability)
	return err
}