bilibili-backup/app/service/main/open/dao/app.go
2019-04-22 02:59:20 +00:00

18 lines
337 B
Go

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
}