bilibili-backup/app/service/main/open/dao/app.go

18 lines
337 B
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
package dao
import (
"context"
"database/sql"
"go-common/library/ecode"
)
// Secret .
func (d *Dao) Secret(c context.Context, sappKey string) (res string, err error) {
err = d.DB.Table("dm_apps").Where("appkey = ?", sappKey).Select("app_secret").Row().Scan(&res)
if err == sql.ErrNoRows {
err = ecode.NothingFound
}
return
}