dao

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package dbclient 定义数据库操作的方法, orm 等。

Index

Constants

View Source
const BULK_INSERT_CHUNK_SIZE = 3000
View Source
const IsDeleteValue = "Y"

Variables

View Source
var (
	ErrNotFoundOrg         = errors.New("org not found")
	ErrNotFoundProject     = errors.New("project not found")
	ErrNotFoundApplication = errors.New("application not found")
	ErrNotFoundMember      = errors.New("member not found")
	ErrNotFoundTicket      = errors.New("ticket not found")
	ErrNotFoundPublisher   = errors.New("publisher not found")
	ErrNotFoundCertificate = errors.New("certificate not found")
	ErrNotFoundApprove     = errors.New("approve not found")
	ErrNotFoundUsecase     = errors.New("usecase not found")
)

dao层错误码统一定义

Functions

func NotDeleted

func NotDeleted(db *gorm.DB) *gorm.DB

func ValidateTestSetDirectoryLength

func ValidateTestSetDirectoryLength(dir string) error

Types

type AutoTestExecHistory

type AutoTestExecHistory struct {
	dbengine.BaseModel

	CreatorID     string
	ProjectID     uint64
	SpaceID       uint64
	IterationID   uint64
	PlanID        uint64
	SceneID       uint64
	SceneSetID    uint64
	StepID        uint64
	ParentPID     uint64
	Type          apistructs.StepAPIType
	Status        apistructs.PipelineStatus
	PipelineYml   string // Used to record the order of scenes,sceneSets and steps
	ExecuteApiNum int64
	SuccessApiNum int64
	PassRate      float64
	ExecuteRate   float64
	TotalApiNum   int64
	ExecuteTime   time.Time
	CostTimeSec   int64
	OrgID         uint64
	TimeBegin     time.Time
	TimeEnd       time.Time
	PipelineID    uint64
}

func (*AutoTestExecHistory) Convert

func (AutoTestExecHistory) TableName

func (AutoTestExecHistory) TableName() string

type AutoTestFileTreeNode

type AutoTestFileTreeNode struct {
	dbengine.BaseModel
	Type      apistructs.UnifiedFileTreeNodeType
	Scope     string
	ScopeID   string
	Pinode    string `gorm:"type:bigint(20)"` // root dir 的 pinode 为 "0",表示无 pinode
	Inode     string `gorm:"type:bigint(20)"`
	Name      string
	Desc      string
	CreatorID string
	UpdaterID string
}

Inode / Pinode 使用 snowflake uuid

func (AutoTestFileTreeNode) TableName

func (AutoTestFileTreeNode) TableName() string

type AutoTestFileTreeNodeHistory

type AutoTestFileTreeNodeHistory struct {
	dbengine.BaseModel
	Pinode        string                        `gorm:"type:bigint(20)"` // root dir 的 pinode 为 "0",表示无 pinode
	Inode         string                        `gorm:"type:bigint(20)"`
	Name          string                        `gorm:"name"`
	Desc          string                        `gorm:"desc"`
	CreatorID     string                        `gorm:"creator_id"`
	UpdaterID     string                        `gorm:"updater_id"`
	PipelineYml   string                        `gorm:"pipeline_yml"`   // 节点的 pipeline yml 文件,pipeline 可以通过 snippetAction 配置
	SnippetAction snippetActionType             `gorm:"snippet_action"` // 其他用例或计划通过 snippet 方式引用时当前节点时, 根据该参数拼装出 snippet action
	Extra         autoTestFileTreeNodeMetaExtra `gorm:"extra"`
}

func (AutoTestFileTreeNodeHistory) TableName

func (AutoTestFileTreeNodeHistory) TableName() string

type AutoTestFileTreeNodeMeta

type AutoTestFileTreeNodeMeta struct {
	dbengine.BaseModel
	Inode         string            `gorm:"type:bigint(20)"`
	PipelineYml   string            // 节点的 pipeline yml 文件,pipeline 可以通过 snippetAction 配置
	SnippetAction snippetActionType // 其他用例或计划通过 snippet 方式引用时当前节点时, 根据该参数拼装出 snippet action
	Extra         autoTestFileTreeNodeMetaExtra
}

func (AutoTestFileTreeNodeMeta) TableName

func (AutoTestFileTreeNodeMeta) TableName() string

type AutoTestPlanMember

type AutoTestPlanMember struct {
	dbengine.BaseModel
	TestPlanID uint64                        `json:"testPlanID"`
	Role       apistructs.TestPlanMemberRole `json:"role"`
	UserID     string                        `json:"userID"`
}

AutoTestPlanMember 自动测试计划成员表

func (AutoTestPlanMember) TableName

func (AutoTestPlanMember) TableName() string

type AutoTestScene

type AutoTestScene struct {
	dbengine.BaseModel
	Name        string                 `gorm:"name"`
	Description string                 `gorm:"description"` // 描述
	SpaceID     uint64                 `gorm:"space_id"`    // 场景所属测试空间ID
	SetID       uint64                 `gorm:"set_id"`      // 场景集ID
	PreID       uint64                 `gorm:"pre_id"`      // 排序的前驱ID
	CreatorID   string                 `gorm:"creator_id"`
	UpdaterID   string                 `gorm:"updater_id"`
	Status      apistructs.SceneStatus `gorm:"status"`
	RefSetID    uint64                 `gorm:"ref_set_id"` // 引用场景集ID
	GroupID     uint64                 `gorm:"group_id"`   // scene group, in the same group run with parallel
	Policy      apistructs.PolicyType  `gorm:"policy"`
}

func (*AutoTestScene) Convert

func (s *AutoTestScene) Convert() apistructs.AutoTestScene

func (AutoTestScene) TableName

func (AutoTestScene) TableName() string

type AutoTestSceneInput

type AutoTestSceneInput struct {
	dbengine.BaseModel
	Name        string `gorm:"name"`
	Value       string `gorm:"value"`       // 默认值
	Temp        string `gorm:"temp"`        // 当前值
	Description string `gorm:"description"` // 描述
	SceneID     uint64 `gorm:"scene_id"`    // 场景ID
	SpaceID     uint64 `gorm:"space_id"`    // 所属测试空间ID
	CreatorID   string `gorm:"creator_id"`
	UpdaterID   string `gorm:"updater_id"`
}

func (AutoTestSceneInput) TableName

func (AutoTestSceneInput) TableName() string

type AutoTestSceneOutput

type AutoTestSceneOutput struct {
	dbengine.BaseModel
	Name        string `gorm:"name"`
	Value       string `gorm:"value"`       // 值表达式
	Description string `gorm:"description"` // 描述
	SceneID     uint64 `gorm:"scene_id"`    // 场景ID
	SpaceID     uint64 `gorm:"space_id"`    // 所属测试空间ID
	CreatorID   string `gorm:"creator_id"`
	UpdaterID   string `gorm:"updater_id"`
}

func (AutoTestSceneOutput) TableName

func (AutoTestSceneOutput) TableName() string

type AutoTestSceneStep

type AutoTestSceneStep struct {
	dbengine.BaseModel
	Type       apistructs.StepAPIType `gorm:"type"`               // 类型
	Value      string                 `gorm:"value"`              // 值
	Name       string                 `gorm:"name"`               // 名称
	PreID      uint64                 `gorm:"pre_id"`             // 排序id
	PreType    apistructs.PreType     `gorm:"pre_type"`           // 串行/并行类型
	SceneID    uint64                 `gorm:"scene_id"`           // 场景ID
	SpaceID    uint64                 `gorm:"space_id"`           // 所属测试空间ID
	APISpecID  uint64                 `gorm:"column:api_spec_id"` // api集市id
	IsDisabled bool                   `gorm:"is_disabled"`        // disable or enable step execute
	CreatorID  string                 `gorm:"creator_id"`
	UpdaterID  string                 `gorm:"updater_id"`
}

func (*AutoTestSceneStep) Convert

func (AutoTestSceneStep) TableName

func (AutoTestSceneStep) TableName() string

type AutoTestSpace

type AutoTestSpace struct {
	dbengine.BaseModel
	Name          string
	ProjectID     int64
	Description   string
	CreatorID     string
	UpdaterID     string
	Status        apistructs.AutoTestSpaceStatus
	ArchiveStatus apistructs.AutoTestSpaceArchiveStatus
	// 被复制的源测试空间
	SourceSpaceID *uint64
	// DeletedAt 删除时间
	DeletedAt *time.Time
}

AutoTestSpace 测试空间

func (AutoTestSpace) TableName

func (AutoTestSpace) TableName() string

TableName 表名

type AutoTestSpaceSceneSetStats

type AutoTestSpaceSceneSetStats struct {
	SpaceID uint64
	SetNum  int
}

type AutoTestSpaceSceneStats

type AutoTestSpaceSceneStats struct {
	SpaceID  uint64
	SceneNum int
}

type AutoTestSpaceSceneStepStats

type AutoTestSpaceSceneStepStats struct {
	SpaceID uint64
	StepNum int
}

type CodeCoverageExecRecord

type CodeCoverageExecRecord struct {
	dbengine.BaseModel

	ProjectID     uint64                            `json:"project_id"`
	Status        apistructs.CodeCoverageExecStatus `json:"status"`
	ReportStatus  apistructs.CodeCoverageExecStatus `json:"report_status"`
	Msg           string                            `json:"msg"`
	ReportMsg     string                            `json:"report_msg"`
	Coverage      float64                           `json:"coverage"`
	ReportUrl     string                            `json:"report_url"`
	ReportTime    time.Time                         `json:"report_time"`
	ReportContent CodeCoverageNodes                 `json:"report_content" sql:"TYPE:json"`
	StartExecutor string                            `json:"start_executor"`
	EndExecutor   string                            `json:"end_executor"`
	TimeBegin     time.Time                         `json:"time_begin"`
	TimeEnd       time.Time                         `json:"time_end"`
	Workspace     string                            `json:"workspace"`
}

func (*CodeCoverageExecRecord) Covert

func (CodeCoverageExecRecord) TableName

func (CodeCoverageExecRecord) TableName() string

type CodeCoverageExecRecordShort

type CodeCoverageExecRecordShort struct {
	dbengine.BaseModel

	ProjectID     uint64                            `json:"project_id"`
	Status        apistructs.CodeCoverageExecStatus `json:"status"`
	ReportStatus  apistructs.CodeCoverageExecStatus `json:"report_status"`
	Msg           string                            `json:"msg"`
	ReportMsg     string                            `json:"report_msg"`
	Coverage      float64                           `json:"coverage"`
	ReportUrl     string                            `json:"report_url"`
	StartExecutor string                            `json:"start_executor"`
	EndExecutor   string                            `json:"end_executor"`
	TimeBegin     time.Time                         `json:"time_begin"`
	TimeEnd       time.Time                         `json:"time_end"`
	ReportTime    time.Time                         `json:"report_time"`
}

func (*CodeCoverageExecRecordShort) Covert

func (CodeCoverageExecRecordShort) TableName

func (CodeCoverageExecRecordShort) TableName() string

type CodeCoverageNodes

type CodeCoverageNodes []*apistructs.CodeCoverageNode

func (*CodeCoverageNodes) Scan

func (c *CodeCoverageNodes) Scan(input interface{}) error

func (CodeCoverageNodes) Value

func (c CodeCoverageNodes) Value() (driver.Value, error)

type CodeCoverageSetting

type CodeCoverageSetting struct {
	dbengine.BaseModel

	ProjectID    uint64 `json:"project_id"`
	MavenSetting string `json:"maven_setting"`
	Includes     string `json:"includes"`
	Excludes     string `json:"excludes"`
	Workspace    string `json:"workspace"`
}

func (CodeCoverageSetting) TableName

func (CodeCoverageSetting) TableName() string

type DBClient

type DBClient struct {
	*dbengine.DBEngine
}

func Open

func Open() (*DBClient, error)

func (*DBClient) AddTestPlanV2Step

func (client *DBClient) AddTestPlanV2Step(req *apistructs.TestPlanV2StepAddRequest) (uint64, error)

AddTestPlanV2Step Insert a step in the test plan

func (*DBClient) AfterUpdateAutoTestSpaceElements

func (db *DBClient) AfterUpdateAutoTestSpaceElements(spaceID uint64)

func (*DBClient) BatchClearScore

func (db *DBClient) BatchClearScore() error

func (*DBClient) BatchCopyTestCases

func (client *DBClient) BatchCopyTestCases(req apistructs.TestCaseBatchCopyRequest) error

func (*DBClient) BatchCreateAutoTestPlanMembers

func (client *DBClient) BatchCreateAutoTestPlanMembers(members []AutoTestPlanMember) error

func (*DBClient) BatchCreateLabelRelations

func (client *DBClient) BatchCreateLabelRelations(lr []LabelRelation) error

func (*DBClient) BatchCreateTestPlanCaseRels

func (client *DBClient) BatchCreateTestPlanCaseRels(rels []TestPlanCaseRel) error

func (*DBClient) BatchCreateTestPlanMembers

func (client *DBClient) BatchCreateTestPlanMembers(members []TestPlanMember) error

func (*DBClient) BatchDeleteSonarMetricRules

func (client *DBClient) BatchDeleteSonarMetricRules(rules []QASonarMetricRules) (err error)

func (*DBClient) BatchDeleteTestCases

func (client *DBClient) BatchDeleteTestCases(ids []uint64) error

func (*DBClient) BatchInsertSonarMetricRules

func (client *DBClient) BatchInsertSonarMetricRules(rules []*QASonarMetricRules) (err error)

func (*DBClient) BatchQueryIssueLabelIDMap

func (client *DBClient) BatchQueryIssueLabelIDMap(issueIDs []int64) (map[uint64][]uint64, error)

BatchGetIssueLabelIDMap 批量查询 issue label id

func (*DBClient) BatchUpdateRecords

func (client *DBClient) BatchUpdateRecords() error

func (*DBClient) BatchUpdateTestCases

func (client *DBClient) BatchUpdateTestCases(req apistructs.TestCaseBatchUpdateRequest) error

func (*DBClient) BatchUpdateTestPlanCaseRels

func (client *DBClient) BatchUpdateTestPlanCaseRels(req apistructs.TestPlanCaseRelBatchUpdateRequest) error

BatchUpdateTestPlanCaseRels 批量更新测试计划用例

func (*DBClient) BulkInsert

func (db *DBClient) BulkInsert(objects interface{}, excludeColumns ...string) error

func (*DBClient) CancelCodeCoverage

func (client *DBClient) CancelCodeCoverage(projectID uint64, workspace string, record *CodeCoverageExecRecord) error

CancelCodeCoverage .

func (*DBClient) CancelQuoteCertificate

func (client *DBClient) CancelQuoteCertificate(quoteCertificateID int64) error

CancelQuoteCertificate 取消引用Certificate

func (*DBClient) CheckRelatedSceneSet

func (client *DBClient) CheckRelatedSceneSet(setId uint64) (bool, error)

func (*DBClient) CheckSceneSetIsExists

func (client *DBClient) CheckSceneSetIsExists(setID uint64) error

CheckSceneSetIsExists check the SceneSet is exists

func (*DBClient) CheckTestPlanCaseRelIDsExistOrNot

func (client *DBClient) CheckTestPlanCaseRelIDsExistOrNot(planID uint64, caseIDs []uint64) ([]uint64, []uint64, error)

CheckTestPlanCaseRelIDsExistOrNot 返回已存在和不存在的 id 列表 return: existIDs, notExistIDs, error

func (*DBClient) CheckTestPlanV2NameExist

func (client *DBClient) CheckTestPlanV2NameExist(name string) error

CheckTestPlanV2NameExist Check if the name of the test plan is repeated

func (*DBClient) CleanTestCasesByTestSetID

func (client *DBClient) CleanTestCasesByTestSetID(projectID, testSetID uint64) error

CleanTestCasesByTestSetID 彻底删除测试集下的测试用例

func (*DBClient) CleanTestSetFromRecycleBin

func (db *DBClient) CleanTestSetFromRecycleBin(testSetID uint64) error

func (*DBClient) Close

func (db *DBClient) Close() error

func (*DBClient) CommitScore

func (db *DBClient) CommitScore() error

func (*DBClient) Copy

func (db *DBClient) Copy(scene *AutoTestScene, isCopyTo bool) error

func (*DBClient) CopyAutoTestSceneStep

func (db *DBClient) CopyAutoTestSceneStep(req apistructs.AutotestSceneRequest) error

func (*DBClient) CountAutoTestSceneSteps

func (db *DBClient) CountAutoTestSceneSteps(planIDs []uint64) (stepCount apistructs.AutoTestSceneStepCount, err error)

func (*DBClient) CountSceneByPlanIDs

func (db *DBClient) CountSceneByPlanIDs(planIDs ...uint64) (sceneCount apistructs.AutoTestSceneCount, err error)

func (*DBClient) CountSceneBySetID

func (db *DBClient) CountSceneBySetID(setId uint64) (uint64, error)

func (*DBClient) CountSceneBySpaceID

func (db *DBClient) CountSceneBySpaceID(spaceID uint64) (uint64, error)

func (*DBClient) CountSceneSetByName

func (client *DBClient) CountSceneSetByName(name string, spaceID uint64) (int, error)

func (*DBClient) CreateAutoTestFileTreeNode

func (db *DBClient) CreateAutoTestFileTreeNode(node *AutoTestFileTreeNode) error

func (*DBClient) CreateAutoTestFileTreeNodeHistory

func (db *DBClient) CreateAutoTestFileTreeNodeHistory(node *AutoTestFileTreeNodeHistory) error

func (*DBClient) CreateAutoTestFileTreeNodeMeta

func (db *DBClient) CreateAutoTestFileTreeNodeMeta(meta *AutoTestFileTreeNodeMeta) error

func (*DBClient) CreateAutoTestPlanMember

func (client *DBClient) CreateAutoTestPlanMember(mem *AutoTestPlanMember) error

func (*DBClient) CreateAutoTestSceneInput

func (db *DBClient) CreateAutoTestSceneInput(input *AutoTestSceneInput) error

func (*DBClient) CreateAutoTestSceneInputs

func (db *DBClient) CreateAutoTestSceneInputs(input []AutoTestSceneInput) error

func (*DBClient) CreateAutoTestSceneOutput

func (db *DBClient) CreateAutoTestSceneOutput(output *AutoTestSceneOutput) error

func (*DBClient) CreateAutoTestSceneOutputs

func (db *DBClient) CreateAutoTestSceneOutputs(output []AutoTestSceneOutput) error

func (*DBClient) CreateAutoTestSceneStep

func (db *DBClient) CreateAutoTestSceneStep(step *AutoTestSceneStep) error

func (*DBClient) CreateAutoTestSpace

func (db *DBClient) CreateAutoTestSpace(space *AutoTestSpace) (*AutoTestSpace, error)

CreateAutoTestSpace 创建测试空间

func (*DBClient) CreateAutotestScene

func (db *DBClient) CreateAutotestScene(scene *AutoTestScene) error

func (*DBClient) CreateBranchRule

func (client *DBClient) CreateBranchRule(branchRule *model.BranchRule) error

CreateBranchRule 创建分支规则

func (*DBClient) CreateCertificate

func (client *DBClient) CreateCertificate(certificate *model.Certificate) error

CreateCertificate 创建Certificate

func (*DBClient) CreateCodeCoverage

func (client *DBClient) CreateCodeCoverage(record *CodeCoverageExecRecord) error

CreateCodeCoverage .

func (*DBClient) CreateComment

func (client *DBClient) CreateComment(comment *model.Comment) error

CreateComment 创建工单评论

func (*DBClient) CreateFile

func (client *DBClient) CreateFile(file *File) error

func (*DBClient) CreateIssueFilterBookmark

func (db *DBClient) CreateIssueFilterBookmark(bm *IssueFilterBookmark) error

func (*DBClient) CreateIteration

func (client *DBClient) CreateIteration(Iteration *Iteration) error

CreateIteration 创建

func (*DBClient) CreateLabelRelation

func (client *DBClient) CreateLabelRelation(lr *LabelRelation) error

CreateLabelRelation 创建标签关联关系

func (*DBClient) CreateLibReference

func (client *DBClient) CreateLibReference(libReference *LibReference) error

CreateLibReference 创建库引用

func (*DBClient) CreateOrUpdateAutoTestFileTreeNodeMetaAddExtraByInode

func (db *DBClient) CreateOrUpdateAutoTestFileTreeNodeMetaAddExtraByInode(inode string, addExtra map[string]interface{}) error

func (*DBClient) CreateOrUpdateAutoTestFileTreeNodeMetaPipelineYmlAndSnippetObjByInode

func (db *DBClient) CreateOrUpdateAutoTestFileTreeNodeMetaPipelineYmlAndSnippetObjByInode(inode, pipelineYml string, snippetAction pb.PipelineYmlAction) error

func (*DBClient) CreateOrUpdateMemberActiveRank

func (db *DBClient) CreateOrUpdateMemberActiveRank(r *MemberActiveScore) error

func (*DBClient) CreateOrUpdateNexusRepository

func (client *DBClient) CreateOrUpdateNexusRepository(repo *NexusRepository) error

func (*DBClient) CreateOrUpdateNexusUser

func (client *DBClient) CreateOrUpdateNexusUser(user *NexusUser) error

func (*DBClient) CreateOrUpdateProjectHome

func (db *DBClient) CreateOrUpdateProjectHome(projectID string, readme string, links string, updater string) error

func (*DBClient) CreatePublisher

func (client *DBClient) CreatePublisher(publisher *model.Publisher) error

CreatePublisher 创建Publisher

func (*DBClient) CreateRecord

func (client *DBClient) CreateRecord(record *TestFileRecord) error

Create Record

func (*DBClient) CreateSceneSet

func (client *DBClient) CreateSceneSet(sceneSet *SceneSet) error

Create Scene Set

func (*DBClient) CreateTestCase

func (client *DBClient) CreateTestCase(uc *TestCase) error

CreateTestCase 创建测试用例

func (*DBClient) CreateTestPlan

func (client *DBClient) CreateTestPlan(testPlan *TestPlan) error

CreateTestPlan Create test plan

func (*DBClient) CreateTestPlanCaseRel

func (client *DBClient) CreateTestPlanCaseRel(testPlanCaseRel *TestPlanCaseRel) error

CreateTestPlanCaseRel Create testPlanCaseRel

func (*DBClient) CreateTestPlanMember

func (client *DBClient) CreateTestPlanMember(mem *TestPlanMember) error

func (*DBClient) CreateTestPlanV2

func (client *DBClient) CreateTestPlanV2(testPlan *TestPlanV2) error

CreateTestPlanV2 Create test plan

func (*DBClient) CreateTestReportRecord

func (client *DBClient) CreateTestReportRecord(record *TestReportRecord) error

func (*DBClient) CreateTestSet

func (db *DBClient) CreateTestSet(testset *TestSet) error

CreateTestSet insert testset

func (*DBClient) CreateTicket

func (client *DBClient) CreateTicket(ticket *model.Ticket) error

CreateTicket 创建工单

func (*DBClient) DeleteAutoTestFileTreeNodeByInode

func (db *DBClient) DeleteAutoTestFileTreeNodeByInode(inode string) error

func (*DBClient) DeleteAutoTestFileTreeNodeHistory

func (db *DBClient) DeleteAutoTestFileTreeNodeHistory(node *AutoTestFileTreeNodeHistory) error

func (*DBClient) DeleteAutoTestPlanMemberByPlanID

func (client *DBClient) DeleteAutoTestPlanMemberByPlanID(planID uint64) error

func (*DBClient) DeleteAutoTestScene

func (db *DBClient) DeleteAutoTestScene(id uint64) (err error)

func (*DBClient) DeleteAutoTestSceneInput

func (db *DBClient) DeleteAutoTestSceneInput(id uint64) error

func (*DBClient) DeleteAutoTestSceneOutput

func (db *DBClient) DeleteAutoTestSceneOutput(id uint64) error

func (*DBClient) DeleteAutoTestSceneStep

func (db *DBClient) DeleteAutoTestSceneStep(id uint64) error

func (*DBClient) DeleteAutoTestSpace

func (db *DBClient) DeleteAutoTestSpace(space *AutoTestSpace) (*AutoTestSpace, error)

DeleteAutoTestSpace 删除测试空间

func (*DBClient) DeleteAutoTestSpaceRelation

func (db *DBClient) DeleteAutoTestSpaceRelation(spaceID uint64) error

DeleteAutoTestSpaceRelation 删除测试空间关联

func (*DBClient) DeleteBranchRule

func (client *DBClient) DeleteBranchRule(id int64) error

DeleteBranchRule 删除分支规则

func (*DBClient) DeleteBranchRuleByScope

func (client *DBClient) DeleteBranchRuleByScope(scopeType apistructs.ScopeType, scopeID int64) error

DeleteBranchRuleByScope 批量删除分支规则

func (*DBClient) DeleteCertificate

func (client *DBClient) DeleteCertificate(certificateID int64) error

DeleteCertificate 删除Certificate

func (*DBClient) DeleteFile

func (client *DBClient) DeleteFile(id uint64) error

func (*DBClient) DeleteIssueFilterBookmarkByID

func (db *DBClient) DeleteIssueFilterBookmarkByID(id string) error

func (*DBClient) DeleteIteration

func (client *DBClient) DeleteIteration(id uint64) error

DeleteIteration 删除

func (*DBClient) DeleteLabelRelations

func (client *DBClient) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID string, labelIDs []uint64) error

DeleteLabelRelations 删除标签关联关系

func (*DBClient) DeleteLabelRelationsByLabel

func (client *DBClient) DeleteLabelRelationsByLabel(labelID uint64) error

DeleteLabelRelationsByLabel 根据 labelID 删除标签

func (*DBClient) DeleteLibReference

func (client *DBClient) DeleteLibReference(libReferenceID uint64) error

DeleteLibReference 删除库引用

func (*DBClient) DeletePublisher

func (client *DBClient) DeletePublisher(publisherID int64) error

DeletePublisher 删除Publisher

func (*DBClient) DeleteRecordBy

func (client *DBClient) DeleteRecordBy(id uint64) error

Delete Record by id

func (*DBClient) DeleteSceneSet

func (client *DBClient) DeleteSceneSet(sceneSet *SceneSet, scenes []uint64) error

Delete Sceneset

func (*DBClient) DeleteTestPlan

func (client *DBClient) DeleteTestPlan(testPlanID uint64) error

DeleteTestPlan Delete test plan

func (*DBClient) DeleteTestPlanCaseRelByTestCaseID

func (client *DBClient) DeleteTestPlanCaseRelByTestCaseID(testCaseID uint64) error

DeleteTestPlanCaseRelByTestCaseID Delete relations by testCaseID

func (*DBClient) DeleteTestPlanCaseRelByTestPlanID

func (client *DBClient) DeleteTestPlanCaseRelByTestPlanID(testPlanID uint64) error

DeleteTestPlanCaseRelByTestPlanID Delete relations by testPlanID

func (*DBClient) DeleteTestPlanCaseRelations

func (client *DBClient) DeleteTestPlanCaseRelations(testPlanID uint64, relIDs []uint64) error

DeleteTestPlanCaseRelations

func (*DBClient) DeleteTestPlanCaseRelationsByTestCaseIds

func (client *DBClient) DeleteTestPlanCaseRelationsByTestCaseIds(testCaseIds []uint64) error

DeleteTestPlanCaseRelationsByTestCaseIds

func (*DBClient) DeleteTestPlanMemberByPlanID

func (client *DBClient) DeleteTestPlanMemberByPlanID(planID uint64) error

func (*DBClient) DeleteTestPlanV2ByID

func (client *DBClient) DeleteTestPlanV2ByID(testPlanID uint64) error

DeleteTestPlanV2ByID Delete test plan and his all steps by ID

func (*DBClient) DeleteTestPlanV2Step

func (client *DBClient) DeleteTestPlanV2Step(req *apistructs.TestPlanV2StepDeleteRequest) error

DeleteTestPlanV2Step Delete a step in the test plan

func (*DBClient) DeleteTicket

func (client *DBClient) DeleteTicket(targetID, targetType, ticketType string) error

DeleteTicket 删除工单

func (*DBClient) ExecHistoryApiAvgCostTime

func (client *DBClient) ExecHistoryApiAvgCostTime(req apistructs.StatisticsExecHistoryRequest) (list []apistructs.ExecHistoryApiAvgCostTime, err error)

ExecHistoryApiAvgCostTime .

func (*DBClient) ExecHistoryApiStatusCount

func (client *DBClient) ExecHistoryApiStatusCount(req apistructs.StatisticsExecHistoryRequest) (list []apistructs.ExecHistoryApiStatusCount, err error)

ExecHistoryApiStatusCount .

func (*DBClient) ExecHistorySceneApiStatusCount

func (client *DBClient) ExecHistorySceneApiStatusCount(req apistructs.StatisticsExecHistoryRequest) (list []apistructs.ExecHistorySceneApiStatusCount, err error)

ExecHistorySceneApiStatusCount .

func (*DBClient) ExecHistorySceneAvgCostTime

func (client *DBClient) ExecHistorySceneAvgCostTime(req apistructs.StatisticsExecHistoryRequest) (list []apistructs.ExecHistorySceneAvgCostTime, err error)

ExecHistorySceneAvgCostTime .

func (*DBClient) ExecHistorySceneStatusCount

func (client *DBClient) ExecHistorySceneStatusCount(req apistructs.StatisticsExecHistoryRequest) (list []apistructs.ExecHistorySceneStatusCount, err error)

ExecHistorySceneStatusCount .

func (*DBClient) FindByPreId

func (client *DBClient) FindByPreId(id uint64) (*SceneSet, error)

func (*DBClient) FindIterations

func (client *DBClient) FindIterations(projectID uint64) (iterations []Iteration, err error)

func (*DBClient) FindMemberRank

func (db *DBClient) FindMemberRank(orgID, userID string) (*MemberActiveRank, uint64, error)

func (*DBClient) FindSceneBySetAndName

func (db *DBClient) FindSceneBySetAndName(setId uint64, name string) ([]AutoTestScene, error)

func (*DBClient) FindSceneSetsByName

func (client *DBClient) FindSceneSetsByName(name string, spaceID uint64) ([]SceneSet, error)

func (*DBClient) FirstFileReady

func (client *DBClient) FirstFileReady(actionType ...apistructs.FileActionType) (bool, *TestFileRecord, error)

func (*DBClient) FuzzySearchAutoTestFileTreeNodes

func (db *DBClient) FuzzySearchAutoTestFileTreeNodes(scope, scopeID string, prefixFuzzy, suffixFuzzy, fuzzy string, pinodes []string, creatorID string) ([]AutoTestFileTreeNode, error)

func (*DBClient) GetAllTestSets

func (db *DBClient) GetAllTestSets() ([]TestSet, error)

func (*DBClient) GetAppCertificateByAppIDAndCertificateID

func (client *DBClient) GetAppCertificateByAppIDAndCertificateID(appID, quoteCertificateID uint64) (*model.AppCertificate, error)

GetAppCertificateByAppIDAndCertificateID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificateByApprovalID

func (client *DBClient) GetAppCertificateByApprovalID(approvalID int64) (*model.AppCertificate, error)

GetAppCertificateByApprovalID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificateByID

func (client *DBClient) GetAppCertificateByID(quoteCertificateID uint64) (model.AppCertificate, error)

GetAppCertificateByID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificatesByOrgIDAndName

func (client *DBClient) GetAppCertificatesByOrgIDAndName(params *apistructs.AppCertificateListRequest) (
	int, []model.AppCertificate, error)

GetAppCertificatesByOrgIDAndName 根据appID和状态获取Certificate列表

func (*DBClient) GetApplicationByID

func (client *DBClient) GetApplicationByID(applicationID int64) (model.Application, error)

func (*DBClient) GetAutoTestExecHistoryByPipelineID

func (client *DBClient) GetAutoTestExecHistoryByPipelineID(pipelineID uint64) (AutoTestExecHistory, error)

GetAutoTestExecHistoryByPipelineID .

func (*DBClient) GetAutoTestFileTreeNodeByInode

func (db *DBClient) GetAutoTestFileTreeNodeByInode(inode string) (*AutoTestFileTreeNode, bool, error)

func (*DBClient) GetAutoTestFileTreeNodeMetaByInode

func (db *DBClient) GetAutoTestFileTreeNodeMetaByInode(inode string) (*AutoTestFileTreeNodeMeta, bool, error)

func (*DBClient) GetAutoTestFileTreeScopeRootDir

func (db *DBClient) GetAutoTestFileTreeScopeRootDir(scope, scopeID string) (*AutoTestFileTreeNode, bool, error)

func (*DBClient) GetAutoTestSceneInput

func (db *DBClient) GetAutoTestSceneInput(id uint64) (*AutoTestSceneInput, error)

func (*DBClient) GetAutoTestSceneOutput

func (db *DBClient) GetAutoTestSceneOutput(id uint64) (*AutoTestSceneOutput, error)

func (*DBClient) GetAutoTestScenePreByPosition

func (db *DBClient) GetAutoTestScenePreByPosition(req apistructs.AutotestSceneRequest) (uint64, uint64, bool, error)

func (*DBClient) GetAutoTestSceneStep

func (db *DBClient) GetAutoTestSceneStep(id uint64) (*AutoTestSceneStep, error)

func (*DBClient) GetAutoTestSceneStepByPreID

func (db *DBClient) GetAutoTestSceneStepByPreID(preID uint64, preType apistructs.PreType) (*AutoTestSceneStep, error)

func (*DBClient) GetAutoTestSceneStepCount

func (db *DBClient) GetAutoTestSceneStepCount(sceneID []uint64) ([]GetNum, error)

func (*DBClient) GetAutoTestSceneStepNumber

func (db *DBClient) GetAutoTestSceneStepNumber(sceneID uint64) (uint64, error)

func (*DBClient) GetAutoTestSpace

func (db *DBClient) GetAutoTestSpace(id uint64) (*AutoTestSpace, error)

GetAutoTestSpace 获取测试空间

func (*DBClient) GetAutoTestSpaceStats

func (*DBClient) GetAutoTestSpaceStepNumber

func (db *DBClient) GetAutoTestSpaceStepNumber(spaceID uint64) (uint64, error)

func (*DBClient) GetAutotestScene

func (db *DBClient) GetAutotestScene(id uint64) (*AutoTestScene, error)

func (*DBClient) GetAutotestSceneByName

func (db *DBClient) GetAutotestSceneByName(name string, setID uint64) (*AutoTestScene, error)

func (*DBClient) GetAutotestSceneByPreID

func (db *DBClient) GetAutotestSceneByPreID(preID uint64) (*AutoTestScene, error)

func (*DBClient) GetAutotestSceneFirst

func (db *DBClient) GetAutotestSceneFirst(setID uint64) (*AutoTestScene, error)

func (*DBClient) GetAutotestSceneTx

func (db *DBClient) GetAutotestSceneTx(id uint64, tx *gorm.DB) (*AutoTestScene, error)

func (*DBClient) GetAutotestSpaceByName

func (db *DBClient) GetAutotestSpaceByName(name string, projectID int64) (*AutoTestSpace, error)

GetAutotestSpaceByName 通过空间名获取空间

func (*DBClient) GetBranchRule

func (client *DBClient) GetBranchRule(id int64) (model.BranchRule, error)

GetBranchRule 获取分支规则

func (*DBClient) GetBranchRulesCount

func (client *DBClient) GetBranchRulesCount(scopeType apistructs.ScopeType) (int64, error)

GetBranchRulesCount 查询分支规则数量

func (*DBClient) GetCertificateByID

func (client *DBClient) GetCertificateByID(certificateID int64) (model.Certificate, error)

GetCertificateByID 根据certificateID获取Certificate信息

func (*DBClient) GetCertificateByOrgAndName

func (client *DBClient) GetCertificateByOrgAndName(orgID int64, name string) (*model.Certificate, error)

GetCertificateByOrgAndName 根据orgID & Certificate名称 获取证书信息

func (*DBClient) GetCertificatesByIDs

func (client *DBClient) GetCertificatesByIDs(certificateIDs []int64, params *apistructs.CertificateListRequest) (
	int, []model.Certificate, error)

GetCertificatesByIDs 根据certificateIDs获取Certificate列表

func (*DBClient) GetCertificatesByOrgIDAndName

func (client *DBClient) GetCertificatesByOrgIDAndName(orgID int64, params *apistructs.CertificateListRequest) (
	int, []model.Certificate, error)

GetCertificatesByOrgIDAndName 根据orgID与名称获取Certificate列表

func (*DBClient) GetClusterOpenTicketsNum

func (client *DBClient) GetClusterOpenTicketsNum(ticketType, targetType, targetID string) (uint64, error)

GetClusterOpenTicketsNum 获取指定集群open状态的工单总数

func (*DBClient) GetCodeCoverageByID

func (client *DBClient) GetCodeCoverageByID(id uint64) (*CodeCoverageExecRecord, error)

GetCodeCoverageByID .

func (*DBClient) GetCodeCoverageSettingByProjectID

func (client *DBClient) GetCodeCoverageSettingByProjectID(projectID uint64, workSpace string) (*CodeCoverageSetting, error)

func (*DBClient) GetCommentByID

func (client *DBClient) GetCommentByID(commentID int64) (*model.Comment, error)

GetCommentByID 根据commentID获取评论

func (*DBClient) GetCommentsByTicketID

func (client *DBClient) GetCommentsByTicketID(ticketID int64, pageNo, pageSize int) (int64, []model.Comment, error)

GetCommentsByTicketID 根据ticketID获取工单评论

func (*DBClient) GetCountByCertificateID

func (client *DBClient) GetCountByCertificateID(certificateID int64) (int64, error)

GetCountByCertificateID 根据certificateID获取引用总数

func (*DBClient) GetEnvConfigByID

func (client *DBClient) GetEnvConfigByID(configID int64) (*model.ConfigItem, error)

GetEnvConfigByID 根据 ID 获取 配置信息

func (*DBClient) GetEnvConfigByKey

func (client *DBClient) GetEnvConfigByKey(namespaceID int64, key string) (*model.ConfigItem, error)

GetEnvConfigByKey 根据 namespaceID, key 获取某个配置信息

func (*DBClient) GetEnvConfigsByNamespaceID

func (client *DBClient) GetEnvConfigsByNamespaceID(namespaceID int64) ([]model.ConfigItem, error)

GetEnvConfigsByNamespaceID 根据 namespaceID 获取所有配置信息

func (*DBClient) GetFile

func (client *DBClient) GetFile(id uint64) (File, error)

func (*DBClient) GetFileByUUID

func (client *DBClient) GetFileByUUID(uuid string) (File, error)

func (*DBClient) GetIteration

func (client *DBClient) GetIteration(id uint64) (*Iteration, error)

GetIteration Iteration 详情

func (*DBClient) GetIterationByTitle

func (client *DBClient) GetIterationByTitle(projectID uint64, title string) (*Iteration, error)

GetIterationByTitle 根据 title 获取 Iteration 信息

func (*DBClient) GetLabelRelationsByLabels

func (client *DBClient) GetLabelRelationsByLabels(refType apistructs.ProjectLabelType, labelIDs []uint64) ([]LabelRelation, error)

GetLabelRelationsByLabels 获取标签关联关系列表

func (*DBClient) GetLabelRelationsByRef

func (client *DBClient) GetLabelRelationsByRef(refType apistructs.ProjectLabelType, refID string) ([]LabelRelation, error)

GetLabelRelationsByRef 获取标签关联关系列表

func (*DBClient) GetLastCommentByTicket

func (client *DBClient) GetLastCommentByTicket(ticketID int64) (*model.Comment, error)

GetLastCommentByTicket 根据 ticketID 获取最新评论

func (*DBClient) GetLibReference

func (client *DBClient) GetLibReference(libReferenceID uint64) (*LibReference, error)

GetLibReference 库引用详情

func (*DBClient) GetMaxOrderNumUnderParentTestSet

func (db *DBClient) GetMaxOrderNumUnderParentTestSet(projectID, parentID uint64, recycled bool) (int, error)

GetMaxOrderNumUnderParentTestSet 返回当前父测试集下的最大 order num 若当前父测试集下没有子测试集,则返回 -1

func (*DBClient) GetMemberActiveRank

func (db *DBClient) GetMemberActiveRank(orgID, userID string) (*MemberActiveRank, error)

func (*DBClient) GetMemberActiveRankList

func (db *DBClient) GetMemberActiveRankList(orgID string, limit int) ([]MemberActiveRank, error)

func (*DBClient) GetNamespaceByName

func (client *DBClient) GetNamespaceByName(name string) (*model.ConfigNamespace, error)

GetNamespaceByName 根据 name 获取 namespac

func (*DBClient) GetNamespaceRelationByName

func (client *DBClient) GetNamespaceRelationByName(name string) (*model.ConfigNamespaceRelation, error)

GetNamespaceRelationByName 根据 name 获取 namespace 关联关系

func (*DBClient) GetNamespaceRelationsByDefaultName

func (client *DBClient) GetNamespaceRelationsByDefaultName(name string) ([]model.ConfigNamespaceRelation, error)

GetNamespaceRelationByDefaultName 根据 defaultName 获取 namespace 关联关系

func (*DBClient) GetNamespacesByNames

func (client *DBClient) GetNamespacesByNames(names []string) ([]model.ConfigNamespace, error)

GetNamespacesByNames 根据 多个names 获取 多个namespace

func (*DBClient) GetNexusRepository

func (client *DBClient) GetNexusRepository(id uint64) (*NexusRepository, error)

func (*DBClient) GetNexusRepositoryByName

func (client *DBClient) GetNexusRepositoryByName(name string) (*NexusRepository, error)

func (*DBClient) GetNexusUser

func (client *DBClient) GetNexusUser(id uint64) (*NexusUser, error)

func (*DBClient) GetNexusUserByName

func (client *DBClient) GetNexusUserByName(name string) (*NexusUser, error)

func (*DBClient) GetOpenTicketByKey

func (client *DBClient) GetOpenTicketByKey(key string) (*model.Ticket, error)

GetOpenTicketByKey 获取open状态的工单

func (*DBClient) GetOrgClusterRelationsByOrg

func (client *DBClient) GetOrgClusterRelationsByOrg(orgID uint64) ([]model.OrgClusterRelation, error)

GetOrgClusterRelationsByOrg 根据 orgID 获取企业对应集群关系

func (*DBClient) GetOrgPublishersCount

func (client *DBClient) GetOrgPublishersCount(orgID uint64) (int64, error)

GetPublishersByIDs 获取企业的Publisher个数

func (*DBClient) GetProjectHome

func (db *DBClient) GetProjectHome(projectID string) (*ProjectHome, error)

func (*DBClient) GetPublisherByID

func (client *DBClient) GetPublisherByID(publisherID int64) (model.Publisher, error)

GetPublisherByID 根据publisherID获取Publisher信息

func (*DBClient) GetPublisherByOrgAndName

func (client *DBClient) GetPublisherByOrgAndName(orgID int64, name string) (*model.Publisher, error)

GetPublisherByOrgAndName 根据orgID & Publisher名称 获取Publisher

func (*DBClient) GetPublisherByOrgID

func (client *DBClient) GetPublisherByOrgID(orgID int64) (*model.Publisher, error)

GetPublisherByOrgID 根据orgID 获取Publisher

func (*DBClient) GetPublishersByIDs

func (client *DBClient) GetPublishersByIDs(publisherIDs []int64, params *apistructs.PublisherListRequest) (
	int, []model.Publisher, error)

GetPublishersByIDs 根据publisherIDs获取Publisher列表

func (*DBClient) GetPublishersByOrgIDAndName

func (client *DBClient) GetPublishersByOrgIDAndName(orgID int64, params *apistructs.PublisherListRequest) (
	int, []model.Publisher, error)

GetPublishersByOrgIDAndName 根据orgID与名称获取Publisher列表

func (*DBClient) GetRecord

func (client *DBClient) GetRecord(id uint64) (*TestFileRecord, error)

Get Record by id

func (*DBClient) GetSceneSet

func (client *DBClient) GetSceneSet(id uint64) (*SceneSet, error)

Get Sceneset by id

func (*DBClient) GetSceneSetByPreID

func (client *DBClient) GetSceneSetByPreID(preID uint64) (*SceneSet, error)

func (*DBClient) GetSonarMetricRules

func (client *DBClient) GetSonarMetricRules(ID int64) (*QASonarMetricRules, error)

func (*DBClient) GetStepByTestPlanID

func (client *DBClient) GetStepByTestPlanID(testPlanID uint64, needSort bool) ([]TestPlanV2StepJoin, int64, error)

GetStepByTestPlanID Get steps of test plan if needSort is true then return a sorted list

func (*DBClient) GetTestCaseByID

func (client *DBClient) GetTestCaseByID(id uint64) (*TestCase, error)

func (*DBClient) GetTestPlan

func (client *DBClient) GetTestPlan(testPlanID uint64) (*TestPlan, error)

GetTestPlan Fetch test plan

func (*DBClient) GetTestPlanByName

func (client *DBClient) GetTestPlanByName(projectID uint64, name string) (*TestPlan, error)

GetTestPlanByName

func (*DBClient) GetTestPlanCaseRel

func (client *DBClient) GetTestPlanCaseRel(relID uint64) (*TestPlanCaseRel, error)

GetTestPlanCaseRel Fetch testPlanCaseRel

func (*DBClient) GetTestPlanCaseRelByPlanIDAndCaseID

func (client *DBClient) GetTestPlanCaseRelByPlanIDAndCaseID(planID, caseID uint64) (*TestPlanCaseRel, error)

func (*DBClient) GetTestPlanV2ByID

func (client *DBClient) GetTestPlanV2ByID(testPlanID uint64) (*TestPlanV2, error)

GetTestPlanV2ByID Get test plan by id

func (*DBClient) GetTestPlanV2Step

func (client *DBClient) GetTestPlanV2Step(ID uint64) (*TestPlanV2StepJoin, error)

func (*DBClient) GetTestPlanV2StepByPreID

func (client *DBClient) GetTestPlanV2StepByPreID(preID uint64) (*TestPlanV2Step, error)

func (*DBClient) GetTestReportRecordByID

func (client *DBClient) GetTestReportRecordByID(id uint64) (TestReportRecord, error)

func (*DBClient) GetTestSetByID

func (db *DBClient) GetTestSetByID(id uint64) (*TestSet, error)

GetTestSetByID 根据ID获取测试集

func (*DBClient) GetTestSetByNameAndParentIDAndProjectID

func (db *DBClient) GetTestSetByNameAndParentIDAndProjectID(projectID, parentID uint64, recycled bool, name string) (*TestSet, error)

ListTestSets 根据父ID和项目ID获取测试集

func (*DBClient) GetTestSetByParentID

func (db *DBClient) GetTestSetByParentID(parentID, projectID uint64) (*[]TestSet, error)

GetTestSetByParentID 根据父ID和项目ID获取测试集

func (*DBClient) GetTestSetByParentIDAndProjectIDAsc

func (db *DBClient) GetTestSetByParentIDAndProjectIDAsc(parentIDs []uint64, projectID uint64, recycled bool, testSetIDs []uint64) ([]TestSet, error)

GetTestSetByParentIDAndProjectIDAsc 根据父ID和项目ID获取子测试集信息,升序排列

func (*DBClient) GetTestSetByParentIDsAndProjectID

func (db *DBClient) GetTestSetByParentIDsAndProjectID(parentIDs []uint64, projectID uint64, recycled bool) ([]TestSet, error)

GetTestSetByParentIDsAndProjectID 根据父ID和项目ID获取测试集

func (*DBClient) GetTestSetDirectoryByID

func (db *DBClient) GetTestSetDirectoryByID(id uint64) (string, error)

GetTestSetDirectoryByID 根据ID获取测试集的路径

func (*DBClient) GetTicket

func (client *DBClient) GetTicket(ticketID int64) (*model.Ticket, error)

GetTicket 获取工单详情

func (*DBClient) GetTicketByRequestID

func (client *DBClient) GetTicketByRequestID(requestID string) (*model.Ticket, error)

GetTicketByRequestID 根据requestID header获取记录

func (*DBClient) GetUserAutoTestPlanRole

func (client *DBClient) GetUserAutoTestPlanRole(userID string, testPlanID uint64) (apistructs.TestPlanMemberRole, error)

func (*DBClient) GetUserTestPlanRole

func (client *DBClient) GetUserTestPlanRole(userID string, testPlanID uint64) (apistructs.TestPlanMemberRole, error)

func (*DBClient) Insert

func (db *DBClient) Insert(scene *AutoTestScene, id uint64) error

func (*DBClient) InsertAutoTestSceneStep

func (db *DBClient) InsertAutoTestSceneStep(req apistructs.AutotestSceneRequest, preID uint64) (uint64, error)

func (*DBClient) IssueScore

func (db *DBClient) IssueScore() error

func (*DBClient) ListAutoTestExecHistory

func (client *DBClient) ListAutoTestExecHistory(timeStart, timeEnd string, planIDs ...uint64) ([]AutoTestExecHistory, error)

ListAutoTestExecHistory .

func (*DBClient) ListAutoTestFileTreeNodeByPinode

func (db *DBClient) ListAutoTestFileTreeNodeByPinode(pinode string) ([]AutoTestFileTreeNode, error)

func (*DBClient) ListAutoTestFileTreeNodeByPinodeAndNamePrefix

func (db *DBClient) ListAutoTestFileTreeNodeByPinodeAndNamePrefix(pinode, namePrefix string) ([]AutoTestFileTreeNode, error)

func (*DBClient) ListAutoTestFileTreeNodeHistoryByinode

func (db *DBClient) ListAutoTestFileTreeNodeHistoryByinode(inode string) ([]AutoTestFileTreeNodeHistory, error)

func (*DBClient) ListAutoTestPlanMembersByPlanID

func (client *DBClient) ListAutoTestPlanMembersByPlanID(testPlanID uint64, roles ...apistructs.TestPlanMemberRole) ([]AutoTestPlanMember, error)

func (*DBClient) ListAutoTestPlanMembersByPlanIDs

func (client *DBClient) ListAutoTestPlanMembersByPlanIDs(testPlanIDs []uint64, roles ...apistructs.TestPlanMemberRole) (map[uint64][]AutoTestPlanMember, error)

func (*DBClient) ListAutoTestPlanOwnersByOwners

func (client *DBClient) ListAutoTestPlanOwnersByOwners(owners []string) ([]AutoTestPlanMember, error)

func (*DBClient) ListAutoTestPlanOwnersByPlanID

func (client *DBClient) ListAutoTestPlanOwnersByPlanID(testPlanID uint64) ([]AutoTestPlanMember, error)

func (*DBClient) ListAutoTestSceneInput

func (db *DBClient) ListAutoTestSceneInput(sceneID uint64) ([]AutoTestSceneInput, error)

func (*DBClient) ListAutoTestSceneInputByScenes

func (db *DBClient) ListAutoTestSceneInputByScenes(sceneID []uint64) ([]AutoTestSceneInput, error)

func (*DBClient) ListAutoTestSceneOutput

func (db *DBClient) ListAutoTestSceneOutput(sceneID uint64) ([]AutoTestSceneOutput, error)

func (*DBClient) ListAutoTestSceneOutputByScenes

func (db *DBClient) ListAutoTestSceneOutputByScenes(sceneID []uint64) ([]AutoTestSceneOutput, error)

func (*DBClient) ListAutoTestSceneStep

func (db *DBClient) ListAutoTestSceneStep(sceneID uint64) ([]AutoTestSceneStep, error)

func (*DBClient) ListAutoTestSceneSteps

func (db *DBClient) ListAutoTestSceneSteps(sceneID []uint64) ([]AutoTestSceneStep, error)

func (*DBClient) ListAutoTestSpaceByProject

func (db *DBClient) ListAutoTestSpaceByProject(req apistructs.AutoTestSpaceListRequest) ([]AutoTestSpace, int, error)

ListAutoTestSpaceByProject 项目下获取测试空间列表

func (*DBClient) ListAutotestScene

func (db *DBClient) ListAutotestScene(req apistructs.AutotestSceneRequest) (uint64, []AutoTestScene, error)

func (*DBClient) ListAutotestSceneByGroupID

func (db *DBClient) ListAutotestSceneByGroupID(setID, groupID uint64) (scenes []AutoTestScene, err error)

ListAutotestSceneByGroupID .

func (*DBClient) ListAutotestSceneTx

func (db *DBClient) ListAutotestSceneTx(req apistructs.AutotestSceneRequest, tx *gorm.DB) (uint64, []AutoTestScene, error)

func (*DBClient) ListAutotestScenes

func (db *DBClient) ListAutotestScenes(setIDs []uint64) ([]AutoTestScene, error)

ListAutotestScenes 批量查询场景

func (*DBClient) ListCodeCoverage

func (client *DBClient) ListCodeCoverage(req apistructs.CodeCoverageListRequest) (records []CodeCoverageExecRecordShort, total uint64, err error)

ListCodeCoverage .

func (*DBClient) ListCodeCoverageByStatus

func (client *DBClient) ListCodeCoverageByStatus(projectID uint64, status []apistructs.CodeCoverageExecStatus, workspace string) (records []CodeCoverageExecRecord, err error)

ListCodeCoverageByStatus .

func (*DBClient) ListEnvConfigsByNamespaceID

func (client *DBClient) ListEnvConfigsByNamespaceID(namespaceIDList []int64) ([]model.ConfigItem, error)

func (*DBClient) ListExecHistorySceneSetByParentPID

func (client *DBClient) ListExecHistorySceneSetByParentPID(parentPID uint64) (list []AutoTestExecHistory, err error)

ListExecHistorySceneSetByParentPID .

func (*DBClient) ListExpiredFiles

func (client *DBClient) ListExpiredFiles(expiredAt time.Time) ([]File, error)

func (*DBClient) ListFileRecordApiFileUUIDsByTime

func (client *DBClient) ListFileRecordApiFileUUIDsByTime(t time.Time) ([]FileUUIDStr, error)

func (*DBClient) ListFileRecordsByState

func (client *DBClient) ListFileRecordsByState(state apistructs.FileRecordState) ([]*TestFileRecord, error)

func (*DBClient) ListIssueFilterBookmarkByUserIDAndProjectID

func (db *DBClient) ListIssueFilterBookmarkByUserIDAndProjectID(userID, projectID string) ([]IssueFilterBookmark, error)

func (*DBClient) ListLibReference

func (client *DBClient) ListLibReference(req *apistructs.LibReferenceListRequest) (uint64, []LibReference, error)

ListLibReference 库引用列表

func (*DBClient) ListNamespaceByAppID

func (client *DBClient) ListNamespaceByAppID(name string) ([]model.ConfigNamespace, error)

ListNamespaceByAppID 修复数据库老数据使用 name = app-2079

func (*DBClient) ListNamespaceByName

func (client *DBClient) ListNamespaceByName(names []string) ([]model.ConfigNamespace, error)

func (*DBClient) ListNexusRepositories

func (client *DBClient) ListNexusRepositories(req apistructs.NexusRepositoryListRequest) ([]*NexusRepository, error)

func (*DBClient) ListNexusUsers

func (client *DBClient) ListNexusUsers(req apistructs.NexusUserListRequest) ([]NexusUser, error)

func (*DBClient) ListRecordsByProject

func (client *DBClient) ListRecordsByProject(req apistructs.ListTestFileRecordsRequest) ([]TestFileRecord, map[string]int, int, error)

Get Records by projectId, spaceId, types

func (*DBClient) ListSceneBySceneSetID

func (db *DBClient) ListSceneBySceneSetID(setIDs ...uint64) ([]AutoTestScene, int64, error)

ListSceneBySceneSetID .

func (*DBClient) ListSonarMetricRules

func (client *DBClient) ListSonarMetricRules(query *QASonarMetricRules, otherQueryFuncList ...func(sql *gorm.DB) *gorm.DB) (dbRules []QASonarMetricRules, err error)

func (*DBClient) ListStepByPlanID

func (client *DBClient) ListStepByPlanID(planIDs ...uint64) ([]TestPlanV2StepJoin, error)

ListStepByPlanID .

func (*DBClient) ListTestCasesByIDs

func (client *DBClient) ListTestCasesByIDs(ids []uint64) ([]TestCase, error)

func (*DBClient) ListTestCasesByTestSetIDs

func (client *DBClient) ListTestCasesByTestSetIDs(req apistructs.TestCaseListRequest) ([]TestCase, error)

func (*DBClient) ListTestPlanCaseRels

func (client *DBClient) ListTestPlanCaseRels(req apistructs.TestPlanCaseRelListRequest) ([]TestPlanCaseRel, error)

ListTestPlanCaseRels List testPlanCaseRel

func (*DBClient) ListTestPlanCaseRelsCount

func (client *DBClient) ListTestPlanCaseRelsCount(testPlanIDs []uint64) (map[uint64]apistructs.TestPlanRelsCount, error)

func (*DBClient) ListTestPlanIDsByOwnerIDs

func (client *DBClient) ListTestPlanIDsByOwnerIDs(ownerIDs []string) ([]uint64, error)

func (*DBClient) ListTestPlanIDsByPartnerIDs

func (client *DBClient) ListTestPlanIDsByPartnerIDs(partnerIDs []string) ([]uint64, error)

func (*DBClient) ListTestPlanIDsByUserIDs

func (client *DBClient) ListTestPlanIDsByUserIDs(userIDs []string, roles ...apistructs.TestPlanMemberRole) ([]uint64, error)

func (*DBClient) ListTestPlanMembersByPlanID

func (client *DBClient) ListTestPlanMembersByPlanID(testPlanID uint64, roles ...apistructs.TestPlanMemberRole) ([]TestPlanMember, error)

func (*DBClient) ListTestPlanMembersByPlanIDs

func (client *DBClient) ListTestPlanMembersByPlanIDs(testPlanIDs []uint64, roles ...apistructs.TestPlanMemberRole) (map[uint64][]TestPlanMember, error)

func (*DBClient) ListTestPlanOwnersByOwners

func (client *DBClient) ListTestPlanOwnersByOwners(owners []string) ([]TestPlanMember, error)

func (*DBClient) ListTestPlanOwnersByPlanID

func (client *DBClient) ListTestPlanOwnersByPlanID(testPlanID uint64) ([]TestPlanMember, error)

func (*DBClient) ListTestPlanPartnersByPlanID

func (client *DBClient) ListTestPlanPartnersByPlanID(testPlanID uint64) ([]TestPlanMember, error)

func (*DBClient) ListTestPlanTestSetIDs

func (client *DBClient) ListTestPlanTestSetIDs(testPlanID uint64) ([]uint64, error)

ListTestPlanTestSetIDs 获取测试计划下的测试集 ID 列表,从关联关系而来

func (*DBClient) ListTestPlanV2ByID

func (client *DBClient) ListTestPlanV2ByID(ids ...uint64) ([]TestPlanV2, error)

ListTestPlanV2ByID .

func (*DBClient) ListTestPlanV2Step

func (client *DBClient) ListTestPlanV2Step(testPlanID, groupID uint64) ([]TestPlanV2StepJoin, error)

ListTestPlanV2Step list testPlan step

func (*DBClient) ListTestReportRecord

func (client *DBClient) ListTestReportRecord(req apistructs.TestReportRecordListRequest) ([]TestReportRecord, uint64, error)

func (*DBClient) ListTestSetByIDs

func (db *DBClient) ListTestSetByIDs(ids []uint64) ([]TestSet, error)

func (*DBClient) ListTestSets

func (db *DBClient) ListTestSets(req apistructs.TestSetListRequest) ([]TestSet, error)

ListTestSets

func (*DBClient) ListTestSetsRecursive

func (db *DBClient) ListTestSetsRecursive(req apistructs.TestSetListRequest) ([]uint64, []TestSet, error)

ListTestSetsRecursive 获取测试集列表,可选是否包含子测试集

func (*DBClient) MoveAutoTestFileTreeNode

func (db *DBClient) MoveAutoTestFileTreeNode(inode, pinode, name, updaterID string) error

func (*DBClient) MoveAutoTestScene

func (db *DBClient) MoveAutoTestScene(id, newPreID, newSetID uint64, tx *gorm.DB) (err error)

like linklist change to node index

func (*DBClient) MoveAutoTestSceneStep

func (db *DBClient) MoveAutoTestSceneStep(req apistructs.AutotestSceneRequest) error

单个移动

func (*DBClient) MoveAutoTestSceneStepGroup

func (db *DBClient) MoveAutoTestSceneStepGroup(req apistructs.AutotestSceneRequest) error

整组移动

func (*DBClient) MoveAutoTestSceneStepToGroup

func (db *DBClient) MoveAutoTestSceneStepToGroup(req apistructs.AutotestSceneRequest) error

把单个步骤改为目标之后的串行节点

func (*DBClient) MoveAutoTestSceneV2

func (db *DBClient) MoveAutoTestSceneV2(req apistructs.AutotestSceneMoveRequest) error

MoveAutoTestSceneV2 Move scene between scene set, include the group drag

func (*DBClient) MoveSceneSet

func (client *DBClient) MoveSceneSet(req apistructs.SceneSetRequest) error

func (*DBClient) MoveTestPlanV2Step

func (client *DBClient) MoveTestPlanV2Step(req *apistructs.TestPlanV2StepMoveRequest) error

MoveTestPlanV2Step move a step in the test plan

func (*DBClient) OverwriteAutoTestPlanMembers

func (client *DBClient) OverwriteAutoTestPlanMembers(testPlanID uint64, members []AutoTestPlanMember) error

OverwriteAutoTestPlanMembers 使用新的成员列表覆盖之前的成员列表

func (*DBClient) OverwriteAutoTestPlanOwner

func (client *DBClient) OverwriteAutoTestPlanOwner(testPlanID uint64, ownerID string) error

OverwriteAutoTestPlanOwner 使用新的 owner 覆盖之前的 owner

func (*DBClient) OverwriteAutoTestPlanPartners

func (client *DBClient) OverwriteAutoTestPlanPartners(testPlanID uint64, partnerIDs []string) error

OverwriteAutoTestPlanPartners 使用新的 partner 列表覆盖之前的 partner 列表

func (*DBClient) OverwriteTestPlanMembers

func (client *DBClient) OverwriteTestPlanMembers(testPlanID uint64, members []TestPlanMember) error

OverwriteTestPlanMembers 使用新的成员列表覆盖之前的成员列表

func (*DBClient) OverwriteTestPlanOwner

func (client *DBClient) OverwriteTestPlanOwner(testPlanID uint64, ownerID string) error

OverwriteTestPlanOwner 使用新的 owner 覆盖之前的 owner

func (*DBClient) OverwriteTestPlanPartners

func (client *DBClient) OverwriteTestPlanPartners(testPlanID uint64, partnerIDs []string) error

OverwriteTestPlanPartners 使用新的 partner 列表覆盖之前的 partner 列表

func (*DBClient) PagingIterations

func (client *DBClient) PagingIterations(req apistructs.IterationPagingRequest) ([]Iteration, uint64, error)

PagingIterations 分页查询

func (*DBClient) PagingSonarMetricRules

func (client *DBClient) PagingSonarMetricRules(req apistructs.SonarMetricRulesPagingRequest) (*dbclient.Paging, error)

PagingTestPlan List test plan

func (*DBClient) PagingTestCases

func (client *DBClient) PagingTestCases(req apistructs.TestCasePagingRequest) ([]TestCase, uint64, error)

func (*DBClient) PagingTestPlan

func (client *DBClient) PagingTestPlan(req apistructs.TestPlanPagingRequest) (uint64, []TestPlan, error)

PagingTestPlan List test plan

func (*DBClient) PagingTestPlanCaseRelations

func (client *DBClient) PagingTestPlanCaseRelations(req apistructs.TestPlanCaseRelPagingRequest) ([]TestPlanCaseRelDetail, uint64, error)

func (*DBClient) PagingTestPlanV2

func (client *DBClient) PagingTestPlanV2(req *apistructs.TestPlanV2PagingRequest) (int, []*apistructs.TestPlanV2, []string, error)

PagingTestPlanV2 Page query testplan

func (*DBClient) QualityScore

func (db *DBClient) QualityScore() error

func (*DBClient) QueryAppPublishItemRelations

func (client *DBClient) QueryAppPublishItemRelations(req apistructs.QueryAppPublishItemRelationRequest) ([]apistructs.AppPublishItemRelation, error)

func (*DBClient) QueryBranchRules

func (client *DBClient) QueryBranchRules(scopeType apistructs.ScopeType, scopeID int64) ([]model.BranchRule, error)

QueryBranchRules 查询分支列表

func (*DBClient) QueryBranchRulesByScope

func (client *DBClient) QueryBranchRulesByScope(scopeType apistructs.ScopeType) ([]model.BranchRule, error)

func (*DBClient) QuoteCertificate

func (client *DBClient) QuoteCertificate(certificate *model.AppCertificate) error

QuoteCertificate 创建应用Certificate

func (*DBClient) RecoverTestCasesByTestSetID

func (client *DBClient) RecoverTestCasesByTestSetID(projectID, testSetID uint64) error

RecoverTestCasesByTestSetID 回收站恢复测试集下的测试用例

func (*DBClient) RecoverTestSet

func (db *DBClient) RecoverTestSet(testSetID, targetTestSetID uint64, name string) error

func (*DBClient) RecycleTestSet

func (db *DBClient) RecycleTestSet(testSetID uint64, newParentID *uint64) error

func (*DBClient) RecycledTestCasesByTestSetID

func (client *DBClient) RecycledTestCasesByTestSetID(projectID, testSetID uint64) error

RecycledTestCasesByTestSetID 回收测试集下的测试用例

func (*DBClient) RemovePublishItemRelations

func (client *DBClient) RemovePublishItemRelations(request *apistructs.RemoveAppPublishItemRelationsRequest) error

func (*DBClient) SaveCodeCoverageSettingByProjectID

func (client *DBClient) SaveCodeCoverageSettingByProjectID(record *CodeCoverageSetting) (*CodeCoverageSetting, error)

func (*DBClient) SceneSetsBySpaceID

func (client *DBClient) SceneSetsBySpaceID(spaceID uint64) ([]SceneSet, error)

Get Scenesets by spaceID

func (*DBClient) SoftDeleteEnvConfig

func (client *DBClient) SoftDeleteEnvConfig(config *model.ConfigItem) error

UpdateEnvConfig 更新环境变量配置

func (*DBClient) SoftDeleteNamespace

func (client *DBClient) SoftDeleteNamespace(namespace *model.ConfigNamespace) error

SoftDeleteNamespace 软删除 namespace

func (*DBClient) SoftDeleteNamespaceRelation

func (client *DBClient) SoftDeleteNamespaceRelation(namespaceRelation *model.ConfigNamespaceRelation) error

SoftDeleteNamespace 软删除 namespace

func (*DBClient) Sq

func (db *DBClient) Sq() *gorm.DB

func (*DBClient) Transaction

func (db *DBClient) Transaction(f func(tx *gorm.DB) error) error

Transaction Execute Transaction

func (*DBClient) Tx

func (db *DBClient) Tx() *TX

func (*DBClient) UpdateAppPublishItemRelations

func (client *DBClient) UpdateAppPublishItemRelations(request *apistructs.UpdateAppPublishItemRelationRequest) error

func (*DBClient) UpdateApprovalStatusByApprovalID

func (client *DBClient) UpdateApprovalStatusByApprovalID(approvalID uint64, status apistructs.ApprovalStatus) error

UpdateApprovalStatusByApprovalID 更新审批流状态

func (*DBClient) UpdateAutoTestFileTreeNodeBasicInfo

func (db *DBClient) UpdateAutoTestFileTreeNodeBasicInfo(inode string, updateColumns map[string]interface{}) error

func (*DBClient) UpdateAutoTestPlanMember

func (client *DBClient) UpdateAutoTestPlanMember(mem *AutoTestPlanMember) error

func (*DBClient) UpdateAutoTestSpace

func (db *DBClient) UpdateAutoTestSpace(space *AutoTestSpace) (*AutoTestSpace, error)

UpdateAutoTestSpace 更新测试空间

func (*DBClient) UpdateAutotestScene

func (db *DBClient) UpdateAutotestScene(node *AutoTestScene) error

func (*DBClient) UpdateAutotestSceneInput

func (db *DBClient) UpdateAutotestSceneInput(input *AutoTestSceneInput) error

func (*DBClient) UpdateAutotestSceneOutput

func (db *DBClient) UpdateAutotestSceneOutput(output *AutoTestSceneOutput) error

func (*DBClient) UpdateAutotestSceneStep

func (db *DBClient) UpdateAutotestSceneStep(step *AutoTestSceneStep) error

func (*DBClient) UpdateAutotestSceneUpdateAt

func (db *DBClient) UpdateAutotestSceneUpdateAt(sceneID uint64, time time.Time) error

func (*DBClient) UpdateAutotestSceneUpdater

func (db *DBClient) UpdateAutotestSceneUpdater(sceneID uint64, userID string) error

func (*DBClient) UpdateBranchRule

func (client *DBClient) UpdateBranchRule(branchRule *model.BranchRule) error

UpdateBranchRule 更新分支规则

func (*DBClient) UpdateCertificate

func (client *DBClient) UpdateCertificate(certificate *model.Certificate) error

UpdateCertificate 更新Certificate

func (*DBClient) UpdateCodeCoverage

func (client *DBClient) UpdateCodeCoverage(record *CodeCoverageExecRecord) error

UpdateCodeCoverage .

func (*DBClient) UpdateComment

func (client *DBClient) UpdateComment(comment *model.Comment) error

UpdateComment 更新工单评论

func (*DBClient) UpdateIteration

func (client *DBClient) UpdateIteration(Iteration *Iteration) error

UpdateIteration 更新

func (*DBClient) UpdateOrAddEnvConfig

func (client *DBClient) UpdateOrAddEnvConfig(config *model.ConfigItem) error

UpdateOrAddEnvConfig 更新环境变量配置

func (*DBClient) UpdateOrAddNamespace

func (client *DBClient) UpdateOrAddNamespace(namespace *model.ConfigNamespace) error

UpdateOrAddNamespace 更新/添加 namespace

func (*DBClient) UpdateOrAddNamespaceRelation

func (client *DBClient) UpdateOrAddNamespaceRelation(namespaceRelation *model.ConfigNamespaceRelation) error

UpdateOrAddNamespaceRelation 更新/添加命名空间关联关系

func (*DBClient) UpdatePublisher

func (client *DBClient) UpdatePublisher(publisher *model.Publisher) error

UpdatePublisher 更新Publisher

func (*DBClient) UpdateQuoteCertificate

func (client *DBClient) UpdateQuoteCertificate(certificate *model.AppCertificate) error

UpdateQuoteCertificate 更新Certificate

func (*DBClient) UpdateRecord

func (client *DBClient) UpdateRecord(record *TestFileRecord) error

Update Record

func (*DBClient) UpdateSceneRefSetID

func (db *DBClient) UpdateSceneRefSetID(copyRefs apistructs.AutoTestSceneCopyRef) error

func (*DBClient) UpdateSceneSet

func (client *DBClient) UpdateSceneSet(sceneSet *SceneSet) (*SceneSet, error)

Update Sceneset

func (*DBClient) UpdateSonarMetricRules

func (client *DBClient) UpdateSonarMetricRules(updateObj *QASonarMetricRules) (err error)

func (*DBClient) UpdateTestCase

func (client *DBClient) UpdateTestCase(uc *TestCase) error

UpdateTestCase 更新测试用例

func (*DBClient) UpdateTestPlan

func (client *DBClient) UpdateTestPlan(testPlan *TestPlan) error

UpdateTestPlan Update test plan

func (*DBClient) UpdateTestPlanMember

func (client *DBClient) UpdateTestPlanMember(mem *TestPlanMember) error

func (*DBClient) UpdateTestPlanTestCaseRel

func (client *DBClient) UpdateTestPlanTestCaseRel(testPlanCaseRel *TestPlanCaseRel) error

UpdateTestPlanTestCaseRel Update testPlanCaseRel

func (*DBClient) UpdateTestPlanV2

func (client *DBClient) UpdateTestPlanV2(testPlanID uint64, fields map[string]interface{}) error

UpdateTestPlanV2 Update test plan

func (*DBClient) UpdateTestPlanV2Step

func (client *DBClient) UpdateTestPlanV2Step(step TestPlanV2Step) error

func (*DBClient) UpdateTestReportRecord

func (client *DBClient) UpdateTestReportRecord(record *TestReportRecord) error

func (*DBClient) UpdateTestSet

func (db *DBClient) UpdateTestSet(testset *TestSet) error

UpdateTestSet update testset

func (*DBClient) UpdateTicket

func (client *DBClient) UpdateTicket(ticket *model.Ticket) error

UpdateTicket 更新工单

type File

type File struct {
	dbengine.BaseModel

	UUID             string       // UUID,解决重名问题;用自增 id 在存储介质上容易冲突
	DisplayName      string       // 文件名,用于下载的时候展示
	Ext              string       // 文件后缀,带 dot
	ByteSize         int64        // 文件大小,Byte
	StorageType      storage.Type // 存储类型
	FullRelativePath string       // 文件相对路径,不包含 网盘挂载点 或 oss bucket
	From             string       // 文件来源,例如 issue / gittar mr
	Creator          string       // 文件创建者 ID
	Extra            FileExtra    // 额外信息,包括存储介质关键信息快照等
	ExpiredAt        *time.Time   // 文件超时自动删除
}

func (File) TableName

func (File) TableName() string

type FileExtra

type FileExtra struct {
	OSSSnapshot OSSSnapshot `json:"ossSnapshot,omitempty"`
	IsPublic    bool        `json:"isPublic,omitempty"`

	Encrypt             bool   `json:"encrypt,omitempty"`
	KMSKeyID            string `json:"kmsKeyID,omitempty"`
	DEKCiphertextBase64 string `json:"dekCiphertextBase64,omitempty"`
}

func (*FileExtra) Scan

func (ex *FileExtra) Scan(value interface{}) error

func (FileExtra) Value

func (ex FileExtra) Value() (driver.Value, error)

type FileUUIDStr

type FileUUIDStr struct {
	ApiFileUUID string
}

type GetNum

type GetNum struct {
	ID      uint64 `gorm:"primary_key"`
	SceneID uint64 `gorm:"scene_id"` // 场景ID
}

type IssueFilterBookmark

type IssueFilterBookmark struct {
	ID           string `gorm:"primary_key"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
	Name         string
	UserID       string
	ProjectID    string
	PageKey      string // 4 page and each page has 2 variants, thus 8 page for bookmarks
	FilterEntity string
}

IssueFilterBookmark users' bookmark of issue filter

func (IssueFilterBookmark) TableName

func (IssueFilterBookmark) TableName() string

type Iteration

type Iteration struct {
	dbengine.BaseModel

	StartedAt  *time.Time                // 迭代开始时间
	FinishedAt *time.Time                // 迭代结束时间
	ProjectID  uint64                    // 所属项目 ID
	Title      string                    // 标题
	Content    string                    // 内容
	Creator    string                    // 创建者 ID
	State      apistructs.IterationState // 归档状态
	ManHour    string                    // 迭代工时信息
}

func (*Iteration) Convert

func (i *Iteration) Convert(labels []string, labelDetails []apistructs.ProjectLabel) apistructs.Iteration

func (Iteration) TableName

func (Iteration) TableName() string

type LabelRelation

type LabelRelation struct {
	dbengine.BaseModel

	LabelID uint64                      `json:"label_id"` // 标签 id
	RefType apistructs.ProjectLabelType `json:"ref_type"` // 标签作用类型, eg: issue
	RefID   string                      `json:"ref_id"`   // 标签关联目标 id
}

LabelRelation 标签关联关系

func (LabelRelation) TableName

func (LabelRelation) TableName() string

TableName 表名

type LibReference

type LibReference struct {
	dbengine.BaseModel

	AppID          uint64
	LibID          uint64
	LibName        string
	LibDesc        string
	ApprovalID     uint64
	ApprovalStatus apistructs.ApprovalStatus
	Creator        string
}

LibReference 库引用

func (LibReference) TableName

func (LibReference) TableName() string

TableName 表名

type MemberActiveRank

type MemberActiveRank struct {
	ID            string `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	OrgID         string
	UserID        string
	IssueScore    uint64
	CommitScore   uint64
	QualityScore  uint64
	TotalScore    uint64
	SoftDeletedAt uint64
}

func (MemberActiveRank) TableName

func (MemberActiveRank) TableName() string

type MemberActiveScore

type MemberActiveScore struct {
	OrgID        string
	UserID       string
	IssueScore   uint64
	CommitScore  uint64
	QualityScore int64
	TotalScore   uint64
}

type NexusRepository

type NexusRepository struct {
	dbengine.BaseModel

	OrgID       *uint64 `json:"orgID"`       // 所属 org ID
	PublisherID *uint64 `json:"publisherID"` // 所属 publisher ID
	ClusterName string  `json:"clusterName"` // 所属集群

	Name   string                 `json:"name"`   // unique name
	Format nexus.RepositoryFormat `json:"format"` // maven2 / npm / ...
	Type   nexus.RepositoryType   `json:"type"`   // group / proxy / hosted
	Config NexusRepositoryConfig  `json:"config"` // repo config
}

func (NexusRepository) TableName

func (NexusRepository) TableName() string

type NexusRepositoryConfig

type NexusRepositoryConfig nexus.Repository

func (*NexusRepositoryConfig) Scan

func (config *NexusRepositoryConfig) Scan(value interface{}) error

func (NexusRepositoryConfig) Value

func (config NexusRepositoryConfig) Value() (driver.Value, error)

type NexusUser

type NexusUser struct {
	dbengine.BaseModel

	RepoID      *uint64 `json:"repoID"`      // 所属 repo,可以为空
	PublisherID *uint64 `json:"publisherID"` // 所属 publisher,可以为空
	OrgID       *uint64 `json:"orgID"`       // 所属 org,可以为空
	ClusterName string  `json:"clusterName"` // 所属集群

	Name     string          `json:"name"`
	Password string          `json:"password"` // 加密存储
	Config   NexusUserConfig `json:"config"`
}

func (NexusUser) TableName

func (NexusUser) TableName() string

type NexusUserConfig

type NexusUserConfig nexus.User

func (*NexusUserConfig) Scan

func (config *NexusUserConfig) Scan(value interface{}) error

func (NexusUserConfig) Value

func (config NexusUserConfig) Value() (driver.Value, error)

type OSSSnapshot

type OSSSnapshot struct {
	OSSEndpoint string `json:"ossEndpoint,omitempty"`
	OSSBucket   string `json:"ossBucket,omitempty"`
}

type PartnerIDs

type PartnerIDs []string

func (*PartnerIDs) Scan

func (ids *PartnerIDs) Scan(value interface{}) error

func (PartnerIDs) Value

func (ids PartnerIDs) Value() (driver.Value, error)

type ProjectHome

type ProjectHome struct {
	ID            string `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	ProjectID     string
	Readme        string
	Links         string
	UpdaterID     string
	SoftDeletedAt uint64
}

func (ProjectHome) TableName

func (ProjectHome) TableName() string

type QASonarMetricRules

type QASonarMetricRules struct {
	ID        int64     `gorm:"primary_key" json:"id"`
	CreatedAt time.Time `gorm:"created_at" json:"createdAt"`
	UpdatedAt time.Time `gorm:"updated_at" json:"updatedAt"`

	Description string `gorm:"description" json:"description"`
	ScopeType   string `gorm:"scope_type" json:"scopeType"`
	ScopeID     string `gorm:"scope_id" json:"scopeId"`
	MetricKeyID int64  `gorm:"metric_key_id" json:"metricKeyId"`
	MetricValue string `gorm:"metric_value" json:"metricValue"`
}

func (QASonarMetricRules) TableName

func (QASonarMetricRules) TableName() string

TableName QASonar对应的数据库表qa_sonar

func (*QASonarMetricRules) ToApi

type SceneSet

type SceneSet struct {
	dbengine.BaseModel
	Name        string
	Description string
	SpaceID     uint64
	PreID       uint64
	CreatorID   string
	UpdaterID   string
}

func (SceneSet) TableName

func (SceneSet) TableName() string

Test TableName

type TX

type TX struct {
	*gorm.DB
}

func (*TX) Sq

func (tx *TX) Sq() *gorm.DB

type TestCase

type TestCase struct {
	dbengine.BaseModel
	Name           string
	ProjectID      uint64
	TestSetID      uint64
	Priority       apistructs.TestCasePriority
	PreCondition   string
	StepAndResults TestCaseStepAndResults
	Desc           string
	Recycled       *bool
	From           apistructs.TestCaseFrom
	CreatorID      string
	UpdaterID      string
}

TestCase 测试用例

func (TestCase) TableName

func (TestCase) TableName() string

TableName 设置模型对应数据库表名称

type TestCaseStepAndResults

type TestCaseStepAndResults []apistructs.TestCaseStepAndResult

func (*TestCaseStepAndResults) Scan

func (sr *TestCaseStepAndResults) Scan(value interface{}) error

func (TestCaseStepAndResults) Value

func (sr TestCaseStepAndResults) Value() (driver.Value, error)

type TestFileExtra

type TestFileExtra apistructs.TestFileExtra

func (*TestFileExtra) Scan

func (ex *TestFileExtra) Scan(value interface{}) error

func (TestFileExtra) Value

func (ex TestFileExtra) Value() (driver.Value, error)

type TestFileRecord

type TestFileRecord struct {
	dbengine.BaseModel
	FileName    string
	Description string
	ApiFileUUID string
	ProjectID   uint64
	OrgID       uint64
	SpaceID     uint64
	Type        apistructs.FileActionType
	State       apistructs.FileRecordState
	OperatorID  string
	Extra       TestFileExtra
	ErrorInfo   string

	SoftDeletedAt uint
}

func (TestFileRecord) TableName

func (TestFileRecord) TableName() string

Test TableName

type TestPlan

type TestPlan struct {
	dbengine.BaseModel
	Name        string
	Status      apistructs.TPStatus // DOING/PAUSE/DONE
	ProjectID   uint64
	CreatorID   string
	IterationID uint64
	UpdaterID   string
	Summary     string
	StartedAt   *time.Time
	EndedAt     *time.Time
	Type        apistructs.TestPlanType
	IsArchived  bool
	Inode       string
}

TestPlan 测试计划

func (TestPlan) TableName

func (TestPlan) TableName() string

TableName 表名

type TestPlanCaseRel

type TestPlanCaseRel struct {
	dbengine.BaseModel
	TestPlanID uint64
	TestSetID  uint64
	TestCaseID uint64
	ExecStatus apistructs.TestCaseExecStatus
	CreatorID  string
	UpdaterID  string
	ExecutorID string
}

TestPlanCaseRel

func (TestPlanCaseRel) TableName

func (TestPlanCaseRel) TableName() string

TableName 表名

type TestPlanCaseRelDetail

type TestPlanCaseRelDetail struct {
	TestPlanCaseRel
	Name           string
	ProjectID      uint64
	Priority       apistructs.TestCasePriority
	PreCondition   string
	StepAndResults TestCaseStepAndResults
	Desc           string
	Recycled       *bool
	From           apistructs.TestCaseFrom
}

func (TestPlanCaseRelDetail) ConvertForPaging

func (rel TestPlanCaseRelDetail) ConvertForPaging() apistructs.TestPlanCaseRel

type TestPlanMember

type TestPlanMember struct {
	dbengine.BaseModel
	TestPlanID uint64                        `json:"testPlanID"`
	Role       apistructs.TestPlanMemberRole `json:"role"`
	UserID     string                        `json:"userID"`
}

TestPlanMember 测试计划成员表

func (TestPlanMember) TableName

func (TestPlanMember) TableName() string

type TestPlanV2

type TestPlanV2 struct {
	dbengine.BaseModel
	Name          string
	Desc          string
	CreatorID     string
	UpdaterID     string
	ProjectID     uint64
	IterationID   uint64
	SpaceID       uint64
	IsArchived    bool
	ExecuteApiNum int64
	PassRate      float64
	ExecuteTime   *time.Time
	SuccessApiNum int64
	TotalApiNum   int64
	ExecuteRate   float64
	CostTimeSec   int64
}

TestPlanV2 测试计划V2

func (*TestPlanV2) Convert2DTO

func (tp *TestPlanV2) Convert2DTO() apistructs.TestPlanV2

Convert2DTO convert DAO to DTO

func (TestPlanV2) TableName

func (TestPlanV2) TableName() string

TableName table name

type TestPlanV2Join

type TestPlanV2Join struct {
	TestPlanV2
	SpaceName     string
	IterationName string
}

TestPlanV2Join join dice_autotest_space

func (TestPlanV2Join) Convert2DTO

func (tp TestPlanV2Join) Convert2DTO() *apistructs.TestPlanV2

Convert2DTO convert DAO to DTO

type TestPlanV2Step

type TestPlanV2Step struct {
	dbengine.BaseModel
	PlanID     uint64
	SceneSetID uint64
	PreID      uint64
	GroupID    uint64
}

TestPlanV2Step 测试计划V2步骤

func (TestPlanV2Step) Convert2DTO

func (tps TestPlanV2Step) Convert2DTO() *apistructs.TestPlanV2Step

Convert2DTO Convert to apistructs

func (TestPlanV2Step) TableName

func (TestPlanV2Step) TableName() string

TableName table name

type TestPlanV2StepJoin

type TestPlanV2StepJoin struct {
	TestPlanV2Step
	SceneSetName string `gorm:"column:name"`
}

TestPlanV2StepJoin 测试计划V2步骤join测试集表

func (TestPlanV2StepJoin) Convert2DTO

func (tps TestPlanV2StepJoin) Convert2DTO() *apistructs.TestPlanV2Step

Convert2DTO Convert to apistructs

type TestReportData

type TestReportData apistructs.TestReportData

func (*TestReportData) Scan

func (dat *TestReportData) Scan(value interface{}) error

func (TestReportData) Value

func (dat TestReportData) Value() (driver.Value, error)

type TestReportRecord

type TestReportRecord struct {
	dbengine.BaseModel

	Name         string         `json:"name"`          // report name
	ProjectID    uint64         `json:"project_id"`    // project id
	IterationID  uint64         `json:"iteration_id"`  // belong iteration id
	CreatorID    string         `json:"creator_id"`    // creator id
	QualityScore float64        `json:"quality_score"` // total quality score
	ReportData   TestReportData `json:"report_data"`   // issue and test dashboard component protocol
	Summary      string         `json:"summary"`       // test report summary
}

func (*TestReportRecord) Convert

func (TestReportRecord) TableName

func (TestReportRecord) TableName() string

type TestSet

type TestSet struct {
	dbengine.BaseModel
	// 测试集的中文名,可重名
	Name string
	// 上一级的所属测试集id,顶级时为0
	ParentID uint64
	// 是否回收
	Recycled bool
	// 项目ID
	ProjectID uint64
	// 路径地址
	Directory string
	// 排序编号
	OrderNum int
	// 创建人ID
	CreatorID string
	// 更新人ID
	UpdaterID string
}

TestSet 测试集

func FakeRootTestSet

func FakeRootTestSet(projectID uint64, recycled bool) TestSet

func (TestSet) TableName

func (TestSet) TableName() string

TableName 数据库表名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL