Example #1
0
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
}
Example #2
0
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
}