You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: del_business.go
    path of file: ./repos/bk-cmdb/src/scene_server/topo_server/logics/inst
    
    the code of the file until where you have to start completion: /*
 * Tencent is pleased to support the open source community by making 蓝鲸 available.
 * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
 */

package inst

import (
	"strconv"

	"configcenter/src/common"
	"configcenter/src/common/blog"
	"configcenter/src/common/http/rest"
	"configcenter/src/common/mapstr"
	"configcenter/src/common/metadata"
	"configcenter/src/common/util"
)

// DeleteBusiness delete business instances by condition
func (b *business) DeleteBusiness(kit *rest.Kit, bizIDs []int64) error {
	// pre-check
	if err := b.checkCanDelete(kit, bizIDs); err != nil {
		return err
	}

	// clean business and related resources
	for _, bizID := range bizIDs {
		if err := b.cleanBizA
    
func (b *business) cleanObjAttDes(kit *rest.Kit, bizID int64) error {
	distinctOpt := &metadata.DistinctFieldOption{
		TableName: common.BKTableNameObjAttDes,
		Field:     common.BKObjIDField,
		Filter: mapstr.MapStr{
			common.BKAppIDField: bizID,
		},
	}

	rst, errDistinct := b.clientSet.CoreService().Common().GetDistinctField(kit.Ctx, kit.Header, distinctOpt)
	if errDistinct != nil {
		blog.Errorf("get obj attribute ids failed, distinct opt: %+v, err: %v, rid: %s", distinctOpt,
			errDistinct, kit.Rid)
		return errDistinct
	}

	objIDs, err := util.SliceInterfaceToString(rst)
	if err != nil {
		blog.Errorf("set ids to string failed, ids: %v, err: %v, rid: %s", rst, err, kit.Rid)
		return err
	}

	delOpt := &metadata.DeleteOption{
		Condition: mapstr.MapStr{
			common.BKAppIDField: bizID,
		},
	}

	for _, objID := range objIDs {
		rsp, err := b.clientSet.CoreService().Model().DeleteModelAttr(kit.Ctx, kit.Header, objID, delOpt)
		if err != nil {
			blog.Errorf("failed to request object controller, err: %v, rid: %s", err, kit.Rid)
			return kit.CCError.Error(common.CCErrCommHTTPDoRequestFailed)
		}

		if !rsp.Result {
			blog.Errorf("failed to delete object attribute, obj id: %s, option: %+v,  err: %s, rid: %s", objID,
				delOpt, rsp.ErrMsg, kit.Rid)
			return kit.CCError.New(rsp.Code, rsp.ErrMsg)
		}
	}

	return nil
}