123456789101112131415161718192021222324 |
- package provider
- import (
- "context"
- "gd_management/apis"
- "gd_management/errors"
- "github.com/astaxie/beego/orm"
- )
- func ManagementGetSecret(ctx context.Context, req *apis.ManagementGetSecretReq, reply *apis.ManagementGetSecretReply) error {
- o := orm.NewOrm()
- if req.AppKey == "" {
- return errors.ArgsError
- }
- err := o.Raw("select app_secret from t_gd_merchants where app_key=?", req.AppKey).QueryRow(&reply.AppSecret)
- if err != nil {
- if err == orm.ErrNoRows {
- return errors.DataBaseNoRecord
- }
- return errors.DataBaseError
- }
- return nil
- }
|