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.
35 lines
639 B
35 lines
639 B
package show |
|
|
|
import ( |
|
"context" |
|
"go-common/library/log" |
|
) |
|
|
|
var ( |
|
_auditSQL = "SELECT mobi_app,build FROM audit" |
|
) |
|
|
|
// Audit get audit. |
|
func (d *Dao) Audit(c context.Context) (res map[string][]int, err error) { |
|
res = make(map[string][]int) |
|
rows, err := d.db.Query(c, _auditSQL) |
|
if err != nil { |
|
log.Error("d.audit error(%v)", err) |
|
return |
|
} |
|
defer rows.Close() |
|
for rows.Next() { |
|
var ( |
|
mobiApp string |
|
build int |
|
) |
|
if err = rows.Scan(&mobiApp, &build); err != nil { |
|
log.Error("d.audit rows.Scan error(%v)", err) |
|
res = nil |
|
return |
|
} |
|
res[mobiApp] = append(res[mobiApp], build) |
|
} |
|
err = rows.Err() |
|
return |
|
}
|
|
|