dao

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const BULK_INSERT_CHUNK_SIZE = 3000

Variables

Functions

This section is empty.

Types

type ChildrenCount

type ChildrenCount struct {
	IssueID uint64
	Count   int
}

type Counter

type Counter struct {
	Count uint64
}

type DBClient

type DBClient struct {
	*dbengine.DBEngine
}

func Open

func Open() (*DBClient, error)

func (*DBClient) BatchCleanIssueRelation

func (client *DBClient) BatchCleanIssueRelation(issueIDs []uint64) error

BatchCleanIssueRelation 批量清理所有的issue关联关系

func (*DBClient) BatchCreateIssueAppRelation

func (client *DBClient) BatchCreateIssueAppRelation(issueAppRel []IssueAppRelation) error

func (*DBClient) BatchCreateIssueRelations

func (client *DBClient) BatchCreateIssueRelations(issueRels []IssueRelation) error

func (*DBClient) BatchCreateIssueStream

func (client *DBClient) BatchCreateIssueStream(issueStreams []IssueStream) error

func (*DBClient) BatchCreateIssueSubscribers

func (client *DBClient) BatchCreateIssueSubscribers(is []IssueSubscriber) error

BatchCreateIssueSubscribers batch create issue subscriber

func (*DBClient) BatchCreateIssueTestCaseRelations

func (client *DBClient) BatchCreateIssueTestCaseRelations(rels []IssueTestCaseRelation) error

BatchCreateIssueTestCaseRelations 批量创建关联关系

func (*DBClient) BatchCreateIssueTransition

func (client *DBClient) BatchCreateIssueTransition(statesTrans []IssueStateTransition) error

func (*DBClient) BatchCreateLabelRelations

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

func (*DBClient) BatchDeleteIssueByIterationID

func (client *DBClient) BatchDeleteIssueByIterationID(iterationID uint64) error

func (*DBClient) BatchDeleteIssueLabelRelations

func (client *DBClient) BatchDeleteIssueLabelRelations(issueIDs []uint64) error

BatchDeleteIssueLabelRelations 批量删除 issue label 关联关系

func (*DBClient) BatchDeleteIssueSubscribers

func (client *DBClient) BatchDeleteIssueSubscribers(issueID int64, userIDs []string) error

BatchDeleteIssueSubscribers batch delete issue subscriber

func (*DBClient) BatchDeleteIssues

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

BatchDeleteIssues 批量删除

func (*DBClient) BatchDeleteIssuesStateTransition

func (client *DBClient) BatchDeleteIssuesStateTransition(issueIDs []uint64) error

func (*DBClient) BatchDeletePropertyRelationByIssueID

func (client *DBClient) BatchDeletePropertyRelationByIssueID(issueIDs []int64) error

func (*DBClient) BatchQueryIssueLabelIDMap

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

BatchGetIssueLabelIDMap 批量查询 issue label id

func (*DBClient) BatchUpdateIssueExpiryStatus

func (client *DBClient) BatchUpdateIssueExpiryStatus(states []apistructs.IssueStateBelong) error

func (*DBClient) BatchUpdateIssueIterationIDByIterationID

func (client *DBClient) BatchUpdateIssueIterationIDByIterationID(iterationID uint64, ID int64) error

func (*DBClient) BatchUpdateIssues

func (client *DBClient) BatchUpdateIssues(req *pb.BatchUpdateIssueRequest) error

BatchUpdateIssues 批量更新 issue

func (*DBClient) BugReopenCount

func (client *DBClient) BugReopenCount(projectID uint64, iterationIDs []uint64) (reopenCount, totalCount uint64, ids []uint64, err error)

func (*DBClient) BulkInsert

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

func (*DBClient) CleanIssueRelation

func (client *DBClient) CleanIssueRelation(issueID uint64) error

ClearIssueRelation 清理所有的issue关联关系

func (*DBClient) Close

func (db *DBClient) Close() error

func (*DBClient) CountBugBySeverity

func (client *DBClient) CountBugBySeverity(projectID uint64, iterationIDs []uint64, onlyUnclosed bool) (map[apistructs.IssueSeverity]uint64, error)

func (*DBClient) CreateIssue

func (client *DBClient) CreateIssue(issue *Issue) error

CreateIssue 创建

func (*DBClient) CreateIssueAppRelation

func (client *DBClient) CreateIssueAppRelation(issueAppRel *IssueAppRelation) error

CreateIssueAppRelation 创建事件应用关联关系

func (*DBClient) CreateIssueProperty

func (client *DBClient) CreateIssueProperty(property *IssueProperty) error

func (*DBClient) CreateIssuePropertyValue

func (client *DBClient) CreateIssuePropertyValue(value *IssuePropertyValue) error

func (*DBClient) CreateIssuePropertyValues

func (client *DBClient) CreateIssuePropertyValues(values []IssuePropertyValue) error

func (*DBClient) CreateIssueRelations

func (client *DBClient) CreateIssueRelations(issueRelation *IssueRelation) error

CreateIssueRelations 创建事件与事件的关联关系

func (*DBClient) CreateIssueStage

func (client *DBClient) CreateIssueStage(stages []IssueStage) error

func (*DBClient) CreateIssueStateTransition

func (client *DBClient) CreateIssueStateTransition(statesTrans *IssueStateTransition) error

func (*DBClient) CreateIssueStream

func (client *DBClient) CreateIssueStream(is *IssueStream) error

CreateIssueStream 创建 issue 事件流

func (*DBClient) CreateIssueSubscriber

func (client *DBClient) CreateIssueSubscriber(issueSubscriber *IssueSubscriber) error

CreateIssueSubscriber Create relationship between issue and subscriber

func (*DBClient) CreateIssuesState

func (client *DBClient) CreateIssuesState(state *IssueState) 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) CreatePropertyRelation

func (client *DBClient) CreatePropertyRelation(relation *IssuePropertyRelation) error

func (*DBClient) CreatePropertyRelations

func (client *DBClient) CreatePropertyRelations(relations []IssuePropertyRelation) error

func (*DBClient) DeleteIssue

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

DeleteIssue 删除

func (*DBClient) DeleteIssueAppRelationsByApp

func (client *DBClient) DeleteIssueAppRelationsByApp(appID int64) error

DeleteIssueAppRelationsByApp 根据 appID 删除关联关系

func (*DBClient) DeleteIssueAppRelationsByComment

func (client *DBClient) DeleteIssueAppRelationsByComment(commentID int64) error

DeleteIssueAppRelationsByComment 根据 commentID 删除关联关系

func (*DBClient) DeleteIssueProperty

func (client *DBClient) DeleteIssueProperty(orgId int64, propertyIssueType string, id int64, index int64) error

func (*DBClient) DeleteIssuePropertyValue

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

func (*DBClient) DeleteIssuePropertyValuesByPropertyID

func (client *DBClient) DeleteIssuePropertyValuesByPropertyID(propertyID int64) error

func (*DBClient) DeleteIssueRelation

func (client *DBClient) DeleteIssueRelation(issueID, relatedIssueID uint64, relationTypes []string) error

DeleteIssueRelation 删除两条issue之间的关联关系

func (*DBClient) DeleteIssueSubscriber

func (client *DBClient) DeleteIssueSubscriber(issueID int64, userID string) error

DeleteIssueSubscriber Delete issue subscriber

func (*DBClient) DeleteIssueTestCaseRelationsByIDs

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

DeleteIssueTestCaseRelationsByIDs 根据关联关系 id 删除

func (*DBClient) DeleteIssueTestCaseRelationsByIssueID

func (client *DBClient) DeleteIssueTestCaseRelationsByIssueID(issueID uint64) error

DeleteIssueTestCaseRelationsByIssueID 根据 issue id 删除关联关系

func (*DBClient) DeleteIssueTestCaseRelationsByIssueIDs

func (client *DBClient) DeleteIssueTestCaseRelationsByIssueIDs(issueIDs []uint64) error

DeleteIssueTestCaseRelationsByIssueIDs 根据 issue ids 删除关联关系

func (*DBClient) DeleteIssueTestCaseRelationsByTestCaseIDs

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

DeleteIssueTestCaseRelationsByCaseIDs 根据 test case id 删除关联关系

func (*DBClient) DeleteIssueTestCaseRelationsByTestPlanCaseRelIDs

func (client *DBClient) DeleteIssueTestCaseRelationsByTestPlanCaseRelIDs(testPlanCaseRelIDs []uint64) error

DeleteIssueTestCaseRelationsByTestPlanCaseRelIDs 根据 测试计划用例 ids 删除

func (*DBClient) DeleteIssuesByRequirement

func (client *DBClient) DeleteIssuesByRequirement(requirementID uint64) error

DeleteIssuesByRequirement .

func (*DBClient) DeleteIssuesStage

func (client *DBClient) DeleteIssuesStage(orgID int64, issueType string) error

func (*DBClient) DeleteIssuesState

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

func (*DBClient) DeleteIssuesStateByProjectID

func (client *DBClient) DeleteIssuesStateByProjectID(projectID int64) error

func (*DBClient) DeleteIssuesStateRelationByStartID

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

func (*DBClient) DeleteIssuesStateTransition

func (client *DBClient) DeleteIssuesStateTransition(issueID uint64) 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) DeletePropertyRelationByIssueID

func (client *DBClient) DeletePropertyRelationByIssueID(issueID int64) error

func (*DBClient) DeletePropertyRelationsByPropertyID

func (client *DBClient) DeletePropertyRelationsByPropertyID(issueID int64, propertyID int64) error

func (*DBClient) FindIssueChildren

func (client *DBClient) FindIssueChildren(id uint64, req pb.PagingIssueRequest) ([]IssueItem, uint64, error)

func (*DBClient) FindIssueChildrenTimeRange

func (client *DBClient) FindIssueChildrenTimeRange(id uint64) (*time.Time, *time.Time, error)

func (*DBClient) FindIssueRoot

func (client *DBClient) FindIssueRoot(req pb.PagingIssueRequest) ([]IssueItem, []IssueItem, uint64, error)

func (*DBClient) FindIssueStream

func (client *DBClient) FindIssueStream(issueId int) ([]IssueStream, error)

func (*DBClient) FindIterations

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

func (*DBClient) GetBatchUpdateIssues

func (client *DBClient) GetBatchUpdateIssues(req *pb.BatchUpdateIssueRequest) ([]Issue, error)

GetBatchUpdateIssues 获取待批量更新记录,生成活动记录

func (*DBClient) GetBugCountByUserID

func (client *DBClient) GetBugCountByUserID(userID uint64, projectID uint64, wontfixStateIDS []uint64, stages []string, severities []string, withReopened bool, creator uint64) (uint64, []uint64, error)

func (*DBClient) GetClosedBugState

func (client *DBClient) GetClosedBugState(projectID int64) ([]IssueState, error)

GetClosedBugState 获取一个项目下已关闭的bug状态id

func (*DBClient) GetDemandDesignBugNum

func (client *DBClient) GetDemandDesignBugNum(iterationID uint64) (issueIDsCount uint64, issueIDsUint64 []uint64, err error)

func (*DBClient) GetHaveUndoneTaskAssigneeNum

func (client *DBClient) GetHaveUndoneTaskAssigneeNum(iterationID uint64, projectID uint64, doneStateIDS []int64) ([]string, error)

GetHaveUndoneTaskAssigneeNum get the number of people with unfinished tasks under the iteration or project

func (*DBClient) GetIssue

func (client *DBClient) GetIssue(id int64) (Issue, error)

GetIssue 查询事件

func (*DBClient) GetIssueBugByRange

func (client *DBClient) GetIssueBugByRange(req apistructs.IssuesStageRequest) ([]Issue, float32, error)

GetIssueByRange 通过迭代或项目获取issue Bug

func (*DBClient) GetIssueByIssueIDs

func (client *DBClient) GetIssueByIssueIDs(issueIDs []uint64) ([]Issue, error)

GetIssueByIssueIDs 通过issueid获取issue

func (*DBClient) GetIssueByState

func (client *DBClient) GetIssueByState(state int64) (*Issue, error)

GetIssueByState 通过状态获取issue

func (*DBClient) GetIssueExpiryStatusByProjects

func (client *DBClient) GetIssueExpiryStatusByProjects(req apistructs.WorkbenchRequest) ([]IssueExpiryStatus, error)

func (*DBClient) GetIssueItem

func (client *DBClient) GetIssueItem(id uint64) (IssueItem, error)

func (*DBClient) GetIssueLabelsByProjectID

func (client *DBClient) GetIssueLabelsByProjectID(projectID uint64) ([]IssueLabel, error)

func (*DBClient) GetIssueNumByPros

func (client *DBClient) GetIssueNumByPros(projectIDS []uint64, req apistructs.IssuePagingRequest) ([]apistructs.IssueNum, error)

GetIssueNumByPros query by IssuePagingRequest and group by project_id to get special issue num

func (*DBClient) GetIssueNumByStates

func (client *DBClient) GetIssueNumByStates(iterationID uint64, issueType apistructs.IssueType, states []uint64) (issueIDsCount uint64, issueIDsUint64 []uint64, err error)

func (*DBClient) GetIssueNumByStatesAndUserID

func (client *DBClient) GetIssueNumByStatesAndUserID(ownerID, assigneeID, projectID uint64, issueType apistructs.IssueType, states, statesNotIn []uint64) (uint64, []uint64, error)

func (*DBClient) GetIssueParents

func (client *DBClient) GetIssueParents(issueID uint64, relationType []string) ([]IssueItem, error)

func (*DBClient) GetIssueProperties

func (client *DBClient) GetIssueProperties(req pb.GetIssuePropertyRequest) ([]IssueProperty, error)

func (*DBClient) GetIssuePropertiesByRelation

func (client *DBClient) GetIssuePropertiesByRelation(ID int64) (*IssueProperty, error)

func (*DBClient) GetIssuePropertiesByTime

func (client *DBClient) GetIssuePropertiesByTime(orgID int64) ([]IssueProperty, error)

func (*DBClient) GetIssuePropertyByID

func (client *DBClient) GetIssuePropertyByID(id int64) (*IssueProperty, error)

func (*DBClient) GetIssuePropertyByName

func (client *DBClient) GetIssuePropertyByName(orgID int64, Name string, PropertyIssueType string, scopeType string, scopeID int64) (*IssueProperty, error)

GetIssuePropertyByName 根据 name 获取 property 信息

func (*DBClient) GetIssuePropertyValue

func (client *DBClient) GetIssuePropertyValue(id int64) (*IssuePropertyValue, error)

func (*DBClient) GetIssuePropertyValues

func (client *DBClient) GetIssuePropertyValues(propertyID int64) ([]IssuePropertyValue, error)

func (*DBClient) GetIssueRelationsByIDs

func (client *DBClient) GetIssueRelationsByIDs(issueIDs []uint64, relationTypes []string) ([]IssueRelation, error)

func (*DBClient) GetIssueStateByID

func (client *DBClient) GetIssueStateByID(ID int64) (*IssueState, error)

func (*DBClient) GetIssueStateByIDs

func (client *DBClient) GetIssueStateByIDs(ID []int64) ([]IssueState, error)

func (*DBClient) GetIssueStatePermission

func (client *DBClient) GetIssueStatePermission(role string, st int64, ed int64) (*IssueStateRelation, error)

func (*DBClient) GetIssueSubscriber

func (client *DBClient) GetIssueSubscriber(issueID int64, userID string) (*IssueSubscriber, error)

GetIssueSubscriber get subscribers of an issue

func (*DBClient) GetIssueSubscribersByIssueID

func (client *DBClient) GetIssueSubscribersByIssueID(issueID int64) ([]IssueSubscriber, error)

GetIssueSubscribersByIssueID get subscribers by issueID

func (*DBClient) GetIssueSubscribersSliceByIssueID

func (client *DBClient) GetIssueSubscribersSliceByIssueID(issueID int64) ([]string, error)

GetIssueSubscribersSliceByIssueID get a slice of issue subscribers by issueID

func (*DBClient) GetIssueSummary

func (client *DBClient) GetIssueSummary(iterationID int64, task, bug, requirement []int64) apistructs.ISummary

GetIssueSummary 获取迭代相关的issue统计信息

func (*DBClient) GetIssueWithOutDelete

func (client *DBClient) GetIssueWithOutDelete(id int64) (Issue, error)

GetIssue 查询事件

func (*DBClient) GetIssuesByProject

func (client *DBClient) GetIssuesByProject(req apistructs.IssuePagingRequest) ([]Issue, uint64, error)

func (*DBClient) GetIssuesIDByIterationID

func (client *DBClient) GetIssuesIDByIterationID(iterationID uint64) (ids []uint64, err error)

func (*DBClient) GetIssuesManHour

GetIssuesManHour get issues mam hour

func (*DBClient) GetIssuesStage

func (client *DBClient) GetIssuesStage(orgID int64, issueType string) ([]IssueStage, error)

func (*DBClient) GetIssuesStageByOrgID

func (client *DBClient) GetIssuesStageByOrgID(orgID int64) ([]IssueStage, error)

GetIssuesStageByOrgID get issuesStage by orgID

func (*DBClient) GetIssuesStateRelations

func (client *DBClient) GetIssuesStateRelations(projectID uint64, issueType string) ([]IssueStateJoinSQL, error)

func (*DBClient) GetIssuesStates

func (client *DBClient) GetIssuesStates(req *pb.GetIssueStatesRequest) ([]IssueState, error)

func (*DBClient) GetIssuesStatesByProjectID

func (client *DBClient) GetIssuesStatesByProjectID(projectID uint64, issueType string) ([]IssueState, error)

func (*DBClient) GetIssuesStatesByProjectIDList

func (client *DBClient) GetIssuesStatesByProjectIDList(projectIDList []uint64) ([]IssueState, error)

get all state by projectID list

func (*DBClient) GetIssuesStatesByTypes

func (client *DBClient) GetIssuesStatesByTypes(req *apistructs.IssueStatesRequest) ([]IssueState, 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 string, refID string) ([]LabelRelation, error)

GetLabelRelationsByRef 获取标签关联关系列表

func (*DBClient) GetPropertyRelationByID

func (client *DBClient) GetPropertyRelationByID(issueID int64) ([]*IssuePropertyRelation, error)

func (*DBClient) GetPropertyRelationByIssueID

func (client *DBClient) GetPropertyRelationByIssueID(issueID int64, propertyID int64) (*IssuePropertyRelation, error)

func (*DBClient) GetPropertyRelationByPropertyID

func (client *DBClient) GetPropertyRelationByPropertyID(propertyID int64) (*IssuePropertyRelation, error)

func (*DBClient) GetReceiversByIssueID

func (client *DBClient) GetReceiversByIssueID(issueID int64) ([]string, error)

GetReceiversByIssueID get receivers of issue event

func (*DBClient) GetRelatedIssues

func (client *DBClient) GetRelatedIssues(issueID uint64, relationType []string) ([]uint64, error)

GetRelatedIssues 获取该事件被哪些事件关联了

func (*DBClient) GetRelatingIssues

func (client *DBClient) GetRelatingIssues(issueID uint64, relationType []string) ([]uint64, error)

GetRelatingIssues 获取该事件关联了哪些事件

func (*DBClient) GetRequirementInclusionTaskNum

func (client *DBClient) GetRequirementInclusionTaskNum(iterationID uint64) (issueRelationIDsCount uint64, issueRelationIDsUint64 []uint64, err error)

GetRequirementInclusionTaskNum get the number of requirements associated with the task in this iteration

func (*DBClient) GetSeriousBugNum

func (client *DBClient) GetSeriousBugNum(iterationID uint64) (issueIDsCount uint64, issueIDsUint64 []uint64, err error)

func (*DBClient) GetTaskConnRequirementNum

func (client *DBClient) GetTaskConnRequirementNum(iterationID uint64) (issueRelationIDsCount uint64, issueRelationIDsUint64 []uint64, err error)

GetTaskConnRequirementNum get the number of tasks associated with the requirement in this iteration

func (*DBClient) IssueChildrenCount

func (client *DBClient) IssueChildrenCount(issueIDs []uint64, relationType []string) ([]ChildrenCount, error)

func (*DBClient) IssueRelationsExist

func (client *DBClient) IssueRelationsExist(issueRelation *IssueRelation, relatedIssues []uint64) (bool, error)

func (*DBClient) IssueStateCount

func (client *DBClient) IssueStateCount(requirementIDs []int64) ([]apistructs.RequirementGroupResult, error)

IssueStateCount 需求下任务统计

func (*DBClient) IssueStateCount2

func (client *DBClient) IssueStateCount2(issueIDs []uint64) ([]apistructs.RequirementGroupResult, error)

IssueStateCount2 需求关联的任务状态统计

func (*DBClient) ListIssue

func (client *DBClient) ListIssue(req pb.IssueListRequest) ([]Issue, error)

ListIssue 查询事件列表

func (*DBClient) ListIssueByIDs

func (client *DBClient) ListIssueByIDs(issueIDs []int64) ([]Issue, error)

func (*DBClient) ListIssueForIssueStateTransMigration

func (client *DBClient) ListIssueForIssueStateTransMigration() ([]IssueForIssueStateTransMigration, error)

func (*DBClient) ListIssueItems

func (client *DBClient) ListIssueItems(req pb.IssueListRequest) ([]IssueItem, error)

func (*DBClient) ListIssueStreamExtraForIssueStateTransMigration

func (client *DBClient) ListIssueStreamExtraForIssueStateTransMigration() ([]IssueStreamExtra, error)

func (*DBClient) ListIssueSummaryStates

func (client *DBClient) ListIssueSummaryStates(projectID uint64, iterationIDS []int64) ([]IssueSummary, error)

func (*DBClient) ListIssueTestCaseRelations

func (client *DBClient) ListIssueTestCaseRelations(req apistructs.IssueTestCaseRelationsListRequest) ([]IssueTestCaseRelation, error)

ListIssueTestCaseRelations 查询事件用例关联关系列表

func (*DBClient) ListPropertyRelationsByIssueIDs

func (client *DBClient) ListPropertyRelationsByIssueIDs(issueIDs []uint64) ([]*IssuePropertyRelation, error)

func (*DBClient) ListStatesTransByProjectID

func (client *DBClient) ListStatesTransByProjectID(projectID uint64) ([]IssueStateTransition, error)

func (*DBClient) MigrateOrgCustomFileds

func (client *DBClient) MigrateOrgCustomFileds(orgID int64, propertyNames []string) error

func (*DBClient) PagingIssueStream

func (client *DBClient) PagingIssueStream(req *pb.PagingIssueStreamsRequest) (int64, []IssueStream, error)

PagingIssueStream issue 分页查询事件流

func (*DBClient) PagingIssues

func (client *DBClient) PagingIssues(req pb.PagingIssueRequest, queryIDs bool) ([]Issue, uint64, error)

PagingIssues 分页查询issue queryIDs = true 表示不管req.IDs是否为空都要根据ID查询

func (*DBClient) PagingIterations

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

PagingIterations 分页查询

func (*DBClient) PagingPropertyRelationByIDs

func (client *DBClient) PagingPropertyRelationByIDs(issueID []int64) ([]IssuePropertyRelation, error)

func (*DBClient) Transaction

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

Transaction Execute Transaction

func (*DBClient) UpdateIssue

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

UpdateIssue 更新

func (*DBClient) UpdateIssuePropertiesIndex

func (client *DBClient) UpdateIssuePropertiesIndex(properties []IssueProperty) error

func (*DBClient) UpdateIssueProperty

func (client *DBClient) UpdateIssueProperty(property *IssueProperty) error

func (*DBClient) UpdateIssuePropertyValue

func (client *DBClient) UpdateIssuePropertyValue(property *IssuePropertyValue) error

func (*DBClient) UpdateIssueState

func (client *DBClient) UpdateIssueState(state *IssueState) error

func (*DBClient) UpdateIssueStateRelations

func (client *DBClient) UpdateIssueStateRelations(projectID int64, issueType string, StateRelations []IssueStateRelation) error

func (*DBClient) UpdateIssueStream

func (client *DBClient) UpdateIssueStream(is *IssueStream) error

UpdateIssueStream 更新 issue 事件流

func (*DBClient) UpdateIssueType

func (client *DBClient) UpdateIssueType(issue *Issue) error

UpdateIssueType 转换issueType

func (*DBClient) UpdateIssues

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

UpdateIssues 批量更新 issue

func (*DBClient) UpdateIssuesStateBelong

func (client *DBClient) UpdateIssuesStateBelong(id int64, belong apistructs.IssueStateBelong) error

func (*DBClient) UpdateIssuesStateIndex

func (client *DBClient) UpdateIssuesStateIndex(id int64, index int64) error

func (*DBClient) UpdateIteration

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

UpdateIteration 更新

func (*DBClient) UpdatePropertyRelationArbitraryValue

func (client *DBClient) UpdatePropertyRelationArbitraryValue(issueID int64, propertyID int64, value string) error

type ExpireType

type ExpireType string
const (
	ExpireTypeUndefined      ExpireType = "Undefined"
	ExpireTypeExpired        ExpireType = "Expired"
	ExpireTypeExpireIn1Day   ExpireType = "ExpireIn1Day"
	ExpireTypeExpireIn2Days  ExpireType = "ExpireIn2Days"
	ExpireTypeExpireIn7Days  ExpireType = "ExpireIn7Days"
	ExpireTypeExpireIn30Days ExpireType = "ExpireIn30Days"
	ExpireTypeExpireInFuture ExpireType = "ExpireInFuture"
	ExpireTypeUnfinished     ExpireType = "Unfinished"
)

func GetExpiryStatus

func GetExpiryStatus(planFinishedAt *time.Time, timeBase time.Time) ExpireType

func (ExpireType) String

func (e ExpireType) String() string

type Issue

type Issue struct {
	dbengine.BaseModel

	PlanStartedAt  *time.Time // 计划开始时间
	PlanFinishedAt *time.Time // 计划结束时间
	ProjectID      uint64     // 所属项目 ID
	IterationID    int64      // 所属迭代 ID
	AppID          *uint64    // deprecated, 所属应用 ID
	RequirementID  *int64     // deprecated, 所属需求 ID
	Type           string     // issue 类型
	Title          string     // 标题
	Content        string     // 内容
	State          int64      // 状态
	Priority       string     // 优先级
	Complexity     string     // 复杂度
	Severity       string     // 严重程度
	Creator        string     // issue 创建者 ID
	Assignee       string     // 分配到 issue 的人,即当前处理人
	Source         string     // issue创建的来源,目前只有工单使用
	ManHour        string     // 工时信息
	External       bool       // Deprecated. 用来区分是通过ui还是bundle创建的 // 2023-05-30 Deprecated. Always true now
	Deleted        bool       // 是否已删除
	Stage          string     // bug阶段 or 任务类型 的值
	Owner          string     // 负责人

	FinishTime   *time.Time // 实际结束时间
	ExpiryStatus ExpireType
	ReopenCount  int
	StartTime    *time.Time
}

Issue .

func (*Issue) GetCanUpdateFields

func (i *Issue) GetCanUpdateFields() map[string]interface{}

GetCanUpdateFields 获取所有可以被主动更新的字段

func (Issue) TableName

func (Issue) TableName() string

type IssueAppRelation

type IssueAppRelation struct {
	dbengine.BaseModel

	IssueID   int64
	CommentID int64
	AppID     int64
	MRID      int64
}

IssueAppRelation 事件应用关联

func (IssueAppRelation) TableName

func (IssueAppRelation) TableName() string

TableName 表名

type IssueExpiryStatus

type IssueExpiryStatus struct {
	IssueNum     uint64
	ProjectID    uint64
	ExpiryStatus ExpireType
}

type IssueForIssueStateTransMigration

type IssueForIssueStateTransMigration struct {
	dbengine.BaseModel

	ProjectID uint64
	Type      apistructs.IssueType
	Creator   string
}

IssueForIssueStateTransMigration the type of state is string

type IssueItem

type IssueItem struct {
	dbengine.BaseModel

	PlanStartedAt  *time.Time                 // 计划开始时间
	PlanFinishedAt *time.Time                 // 计划结束时间
	ProjectID      uint64                     // 所属项目 ID
	IterationID    int64                      // 所属迭代 ID
	AppID          *uint64                    // 所属应用 ID
	RequirementID  *int64                     // 所属需求 ID
	Type           string                     // issue 类型
	Title          string                     // 标题
	Content        string                     // 内容
	State          int64                      // 状态
	Priority       apistructs.IssuePriority   // 优先级
	Complexity     apistructs.IssueComplexity // 复杂度
	Severity       apistructs.IssueSeverity   // 严重程度
	Creator        string                     // issue 创建者 ID
	Assignee       string                     // 分配到 issue 的人,即当前处理人
	Source         string                     // issue创建的来源,目前只有工单使用
	ManHour        string                     // 工时信息
	External       bool                       // 用来区分是通过ui还是bundle创建的
	Deleted        bool                       // 是否已删除
	Stage          string                     // bug阶段 or 任务类型 的值
	Owner          string                     // 负责人

	FinishTime   *time.Time // 实际结束时间
	ExpiryStatus ExpireType
	ReopenCount  int
	StartTime    *time.Time

	Name           string
	Belong         string
	ChildrenLength int
}

func (*IssueItem) FilterPropertyRetriever

func (i *IssueItem) FilterPropertyRetriever(condition string) string

type IssueLabel

type IssueLabel struct {
	dbengine.BaseModel
	LabelID uint64                      // 标签 id
	RefType apistructs.ProjectLabelType // 标签作用类型, eg: issue
	RefID   string                      // 标签关联目标 id
	Name    string                      // 标签名称
	Type    apistructs.ProjectLabelType // 标签作用类型
}

type IssueProperty

type IssueProperty struct {
	dbengine.BaseModel

	ScopeType         string `gorm:"column:scope_type"`          // 系统管理员(sys)/企业(org)/项目(project)/应用(app)
	ScopeID           int64  `gorm:"column:scope_id"`            // 企业ID/项目ID/应用ID
	OrgID             int64  `gorm:"column:org_id"`              // 冗余 OrgID,方便删除企业时删除所有相关issue
	Required          bool   `gorm:"column:required"`            // 是否是必填项
	PropertyType      string `gorm:"column:property_type"`       // 属性的的类型(单选,多选,文本)
	PropertyName      string `gorm:"column:property_name"`       // 属性的名称
	DisplayName       string `gorm:"column:display_name"`        // 属性的展示名称
	PropertyIssueType string `gorm:"column:property_issue_type"` // 事件类型
	Relation          int64  `gorm:"column:relation"`            // 关联公用事件
	Index             int64  `gorm:"column:index"`               // 字段排序级
}

IssueProperty 事件属性表

func (IssueProperty) TableName

func (IssueProperty) TableName() string

type IssuePropertyRelation

type IssuePropertyRelation struct {
	dbengine.BaseModel

	OrgID           int64  `gorm:"column:org_id"` // 冗余 OrgID,方便删除企业时删除所有相关issue
	ProjectID       int64  `gorm:"column:project_id"`
	IssueID         int64  `gorm:"column:issue_id"`          // 事件ID
	PropertyID      int64  `gorm:"column:property_id"`       // 字段ID
	PropertyValueID int64  `gorm:"column:property_value_id"` // 枚举值ID
	ArbitraryValue  string `gorm:"column:arbitrary_value"`   // 字段自定义输入值
}

IssuePropertyRelation 事件属性实例关联表

func (IssuePropertyRelation) TableName

func (IssuePropertyRelation) TableName() string

type IssuePropertyValue

type IssuePropertyValue struct {
	dbengine.BaseModel

	PropertyID int64  `gorm:"column:property_id"`
	Value      string `gorm:"column:value"`
	Name       string `gorm:"column:name"`
}

IssuePropertyValue 事件属性值表

func (IssuePropertyValue) TableName

func (IssuePropertyValue) TableName() string

type IssueRelation

type IssueRelation struct {
	dbengine.BaseModel

	IssueID      uint64
	RelatedIssue uint64
	Comment      string
	Type         string
}

IssueRelation 事件事件关联

func (IssueRelation) TableName

func (IssueRelation) TableName() string

TableName 表名

type IssueStage

type IssueStage struct {
	dbengine.BaseModel

	OrgID     int64  `gorm:"column:org_id"`
	IssueType string `gorm:"column:issue_type"`
	Name      string `gorm:"column:name"`
	Value     string `gorm:"column:value"`
}

func (IssueStage) TableName

func (i IssueStage) TableName() string

type IssueState

type IssueState struct {
	dbengine.BaseModel

	ProjectID uint64 `gorm:"column:project_id"`
	IssueType string `gorm:"column:issue_type"`
	Name      string `gorm:"column:name"`
	Belong    string `gorm:"column:belong"`
	Index     int64  `gorm:"column:index"`
	Role      string `gorm:"column:role"`
}

func (IssueState) TableName

func (IssueState) TableName() string

type IssueStateJoinSQL

type IssueStateJoinSQL struct {
	ID         int64  `gorm:"primary_key"`
	ProjectID  uint64 `gorm:"column:project_id"`
	IssueType  string `gorm:"column:issue_type"`
	Name       string `gorm:"column:name"`
	Belong     string `gorm:"column:belong"`
	Index      int64  `gorm:"column:index"`
	EndStateID int64  `gorm:"column:end_state_id"`
}

type IssueStateRelation

type IssueStateRelation struct {
	dbengine.BaseModel

	ProjectID    int64  `gorm:"column:project_id"`
	IssueType    string `gorm:"column:issue_type"`
	StartStateID int64  `gorm:"column:start_state_id"`
	EndStateID   int64  `gorm:"column:end_state_id"`
}

func (IssueStateRelation) TableName

func (IssueStateRelation) TableName() string

type IssueStateTransition

type IssueStateTransition struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	ProjectID uint64
	IssueID   uint64
	StateFrom uint64
	StateTo   uint64
	Creator   string
}

func (IssueStateTransition) TableName

func (IssueStateTransition) TableName() string

type IssueStream

type IssueStream struct {
	dbengine.BaseModel

	IssueID      int64           // issue id
	Operator     string          // 操作人
	StreamType   string          // 通过事件流类型找到对应模板
	StreamParams common.ISTParam // 事件流模板值, 参数取值范围见: apistructs.ISTParam
}

IssueStream 事件流水表

func (IssueStream) TableName

func (IssueStream) TableName() string

TableName 表名

type IssueStreamExtra

type IssueStreamExtra struct {
	IssueStream
	ProjectID uint64
	IssueType string
}

type IssueSubscriber

type IssueSubscriber struct {
	dbengine.BaseModel

	IssueID int64
	UserID  string
}

IssueSubscriber Issue's subscriber

func (IssueSubscriber) TableName

func (IssueSubscriber) TableName() string

type IssueSummary

type IssueSummary struct {
	Total       int                  `json:"total,omitempty"`
	IssueType   apistructs.IssueType `json:"issue_type,omitempty"`
	State       int64                `json:"state,omitempty"`
	IterationID int64                `json:"iteration_id,omitempty"`
}

type IssueTestCaseRelation

type IssueTestCaseRelation struct {
	dbengine.BaseModel

	IssueID           uint64 `json:"issueID"`
	TestPlanID        uint64 `json:"testPlanID"`
	TestPlanCaseRelID uint64 `json:"testPlanCaseRelID"`
	TestCaseID        uint64 `json:"testCaseID"`
	CreatorID         string `json:"creatorID"`
}

IssueTestCaseRelation 事件与用例关联

func (IssueTestCaseRelation) TableName

func (IssueTestCaseRelation) TableName() string

TableName 表名

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 // 归档状态
}

func (*Iteration) Convert

func (i *Iteration) Convert() 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 Line

type Line struct {
	ID uint64 `gorm:"column:id"`
}

Jump to

Keyboard shortcuts

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