management_get_provider_ids.go 582 B

1234567891011121314151617181920
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package management
  4. import (
  5. "context"
  6. "gd_management/apis"
  7. "gd_management/errors"
  8. "github.com/astaxie/beego/orm"
  9. )
  10. func ManagementGetProviderIds(ctx context.Context, req *apis.ManagementGetProviderIdsReq, reply *apis.ManagementGetProviderIdsReply) (err error) {
  11. sql := "select id as provider_id, platform_name as provider_name from t_gd_provider"
  12. _, err = orm.NewOrm().Raw(sql).QueryRows(&reply.Infos)
  13. if err != nil {
  14. return errors.DataBaseError
  15. }
  16. return nil
  17. }