app.go 337 B

1234567891011121314151617
  1. package dao
  2. import (
  3. "context"
  4. "database/sql"
  5. "go-common/library/ecode"
  6. )
  7. // Secret .
  8. func (d *Dao) Secret(c context.Context, sappKey string) (res string, err error) {
  9. err = d.DB.Table("dm_apps").Where("appkey = ?", sappKey).Select("app_secret").Row().Scan(&res)
  10. if err == sql.ErrNoRows {
  11. err = ecode.NothingFound
  12. }
  13. return
  14. }