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: recycle.go
    path of file: ./repos/erda/internal/apps/dop/services/testcase
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distribute
    
func (svc *Service) BatchCleanFromRecycleBin(req apistructs.TestCaseBatchCleanFromRecycleBinRequest) error {
	// 确认所有 testCaseIDs 存在
	tcs, err := svc.db.ListTestCasesByIDs(req.TestCaseIDs)
	if err != nil {
		return apierrors.ErrBatchCleanTestCasesFromRecycleBin.InvalidParameter(err)
	}

	// 校验 recycled
	var notRecycledIDs []uint64
	for _, tc := range tcs {
		if !*tc.Recycled {
			notRecycledIDs = append(notRecycledIDs, uint64(tc.ID))
		}
	}
	if len(notRecycledIDs) > 0 {
		return apierrors.ErrBatchCleanTestCasesFromRecycleBin.InvalidParameter(fmt.Errorf("some testcase not in recycle bin, ids: %v", notRecycledIDs))
	}

	// 批量删除缺陷测试计划用例关联
	if err := svc.issueDBClient.DeleteIssueTestCaseRelationsByTestCaseIDs(req.TestCaseIDs); err != nil {
		return apierrors.ErrBatchCleanTestCasesFromRecycleBin.InternalError(err)
	}

	// 批量删除测试用例
	if err := svc.db.BatchDeleteTestCases(req.TestCaseIDs); err != nil {
		return apierrors.ErrBatchCleanTestCasesFromRecycleBin.InternalError(err)
	}

	return nil
}