123456789101112131415161718192021222324 |
- package base_api
- import (
- "context"
- "gd_management/apis"
- "gd_management/errors"
- "fmt"
- "github.com/astaxie/beego/orm"
- )
- func ManagementGetBaseApiId(ctx context.Context, req *apis.ManagementGetBaseApiIdReq, reply *apis.ManagementGetBaseApiIdReply) error {
- fmt.Printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n")
- err := orm.NewOrm().Raw("select id from t_gd_api where router = ? and method = ?", req.Router, req.Method).QueryRow(&reply.ApiId)
- fmt.Printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:%v\n", err)
- if err != nil {
- if err != orm.ErrNoRows {
- return errors.DataBaseError
- } else {
- return errors.ServiceError
- }
- }
- return nil
- }
|