1234567891011121314151617181920212223242526 |
- package provider
- import (
- "context"
- "gd_management/apis"
- "gd_management/errors"
- "github.com/astaxie/beego/orm"
- )
- func ManagementDelProviderPlatform(ctx context.Context, req *apis.ManagementDelProviderPlatformReq, reply *apis.ManagementDelProviderPlatformReply) error {
- if req.ProviderId == 0 {
- return errors.ArgsError
- }
- exist := orm.NewOrm().QueryTable("t_gd_provider_api").Filter("provider_id", req.ProviderId).Exist()
- if exist {
- return errors.ProviderHaveApi
- }
- _, err := orm.NewOrm().Raw("delete from t_gd_provider where id = ?", req.ProviderId).Exec()
- if err != nil {
- return errors.DataBaseError
- }
- return nil
- }
|