projectDB

package
v0.0.0-...-cee649a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBInfo

type DBInfo struct {
	TheDB     *sqlx.DB
	TableName string
}

type ProjectDB

type ProjectDB interface {
	ProjectReadOnlyDB
	///////////////////////////////////////////////////////////////////////////////
	Insert(project.Info) (projectID int, err error)

	UpdateBasicInfo(bi project.BasicInfo) (err error)
	UpdateCodeInfo(pc project.CodeInfo) (err error)
	UpdateStatusInfo(si project.StatusInfo) (err error)
	UpdateApplyInfo(ai project.ApplyInfo) (err error)
	UpdateAllocNum(ali project.AllocNum) (err error)
	UpdateAllocInfo(ali project.AllocInfo) (err error)

	// 同一数据库内归档
	InnerArchiveProject(historyTableName string, projectID int) (err error)
}

type ProjectPg

type ProjectPg struct {
	DBInfo
}

func NewProjectPg

func NewProjectPg(sqlxdb *sqlx.DB, tn string) ProjectPg

func (ProjectPg) Close

func (ppg ProjectPg) Close()

func (ProjectPg) InnerArchiveProject

func (ppg ProjectPg) InnerArchiveProject(historyTableName string, projectID int) (err error)

func (ProjectPg) Insert

func (ppg ProjectPg) Insert(pi project.Info) (projectID int, err error)

func (ProjectPg) QueryAllInfo

func (ppg ProjectPg) QueryAllInfo() (pis []project.Info, err error)

func (ProjectPg) QueryByDepartmentCode

func (ppg ProjectPg) QueryByDepartmentCode(dc string) (pis []project.Info, err error)

func (ProjectPg) QueryByID

func (ppg ProjectPg) QueryByID(projectID int) (pi project.Info, err error)

func (ProjectPg) QueryByOwner

func (ppg ProjectPg) QueryByOwner(userID int) (pis []project.Info, err error)

func (ProjectPg) UpdateAllocInfo

func (ppg ProjectPg) UpdateAllocInfo(ali project.AllocInfo) (err error)

func (ProjectPg) UpdateAllocNum

func (ppg ProjectPg) UpdateAllocNum(ali project.AllocNum) (err error)

func (ProjectPg) UpdateApplyInfo

func (ppg ProjectPg) UpdateApplyInfo(ai project.ApplyInfo) (err error)

func (ProjectPg) UpdateBasicInfo

func (ppg ProjectPg) UpdateBasicInfo(bi project.BasicInfo) (err error)

func (ProjectPg) UpdateCodeInfo

func (ppg ProjectPg) UpdateCodeInfo(pc project.CodeInfo) (err error)

func (ProjectPg) UpdateStatusInfo

func (ppg ProjectPg) UpdateStatusInfo(si project.StatusInfo) (err error)

type ProjectReadOnlyDB

type ProjectReadOnlyDB interface {
	QueryByID(projectID int) (project.Info, error)
	QueryByOwner(userID int) ([]project.Info, error)
	QueryByDepartmentCode(dc string) ([]project.Info, error)
	QueryAllInfo() ([]project.Info, error)

	Close()
}

Jump to

Keyboard shortcuts

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