You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
659 B
33 lines
659 B
package dao |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/library/log" |
|
) |
|
|
|
var ( |
|
_allParamterSQL = "SELECT name, value FROM rating_parameter" |
|
) |
|
|
|
// GetAllParamter get all paramter |
|
func (d *Dao) GetAllParamter(c context.Context) (paramters map[string]int64, err error) { |
|
paramters = make(map[string]int64) |
|
rows, err := d.db.Query(c, _allParamterSQL) |
|
if err != nil { |
|
log.Error("d.db.Query GetAllParamter error(%v)", err) |
|
return |
|
} |
|
defer rows.Close() |
|
for rows.Next() { |
|
var name string |
|
var vaule int64 |
|
err = rows.Scan(&name, &vaule) |
|
if err != nil { |
|
log.Error("rows.Scan GetAllParamter error(%v)", err) |
|
return |
|
} |
|
paramters[name] = vaule |
|
} |
|
return |
|
}
|
|
|