data_api_remove_base_api.go 710 B

1234567891011121314151617181920212223242526
  1. package data_api
  2. import (
  3. "context"
  4. "gd_management/apis"
  5. "gd_management/common.in/utils"
  6. "gd_management/errors"
  7. "github.com/astaxie/beego/orm"
  8. "go.uber.org/zap"
  9. )
  10. func DataApiRemoveBaseApi(ctx context.Context, req *apis.ManagementDataApiRemoveBaseApiReq, reply *apis.ManagementDataApiRemoveBaseApiReply) error {
  11. if req.DataApiBaseApiId == 0 {
  12. return errors.ArgsError
  13. }
  14. o := orm.NewOrm()
  15. _, err := o.Delete(&apis.ManagementDataApiBaseApi{Id: req.DataApiBaseApiId})
  16. if err != nil {
  17. l.Error("mysql",
  18. zap.String("sql", "delete from t_gd_child_data_api"),
  19. zap.String("fileds", utils.MarshalJsonString(req)),
  20. zap.String("error", err.Error()))
  21. return errors.DataBaseError
  22. }
  23. return nil
  24. }