예제 #1
0
func (analyser ProgramAnalyser) getDigesters(module repository.Module) (*word.Digester, *word.Digester, *word.Digester) {

	fieldList := "`keywords`, `formats`, `description`"
	sql := "SELECT " + fieldList + " FROM `digest_module` WHERE module=? AND analyse=? LIMIT 0,1"
	rows, err := database.Connection.Query(sql, module.GetID(), analyser.parent.parent.id)

	if err != nil {
		panic(err)
	}

	keywords := word.NewDigester("")
	formats := word.NewDigester("")
	description := word.NewDigester("")

	for rows.Next() {
		var d1, d2, d3 string
		rows.Scan(&d1, &d2, &d3)
		keywords = word.NewDigesterFromJSON(d1)
		formats = word.NewDigesterFromJSON(d2)
		description = word.NewDigesterFromJSON(d3)
	}
	return keywords, formats, description
}
예제 #2
0
func (search ModuleSearch) getURL(module repository.Module) string {
	path := "/institutions/" + strconv.Itoa(module.GetInstitution()) + "/module/" + strconv.Itoa(module.GetID())
	return path
}