Back to godoc.org

Package api

v2.2.0
Latest Go to latest

The highest tagged major version is v2.

Published: Nov 23, 2019 | License: MIT | Module: github.com/andyTsing/BEService/v2

Index

type AccountAPI

type AccountAPI struct {
	DB AccountDatabase
}

The AccountAPI provides handlers for managing Account.

func (*AccountAPI) Add

func (sAPI *AccountAPI) Add(ctx *gin.Context)

Add creates a Account.

func (*AccountAPI) Delete

func (sAPI *AccountAPI) Delete(ctx *gin.Context)

Delete deletes the Account by id

func (*AccountAPI) Get

func (sAPI *AccountAPI) Get(ctx *gin.Context)

Get returns all the Accounts

func (*AccountAPI) LoginAccount

func (sAPI *AccountAPI) LoginAccount(ctx *gin.Context)

LoginAccount returns the Account by the given account and password or nil.

func (*AccountAPI) Update

func (sAPI *AccountAPI) Update(ctx *gin.Context)

Update is updates a Account

func (*AccountAPI) UpdatePassword

func (sAPI *AccountAPI) UpdatePassword(ctx *gin.Context)

UpdatePassword is updates a Account's Password

type AccountDatabase

type AccountDatabase interface {
	AddAccount(lT *model.Account) *model.Account
	CountAccount() string
	DeleteAccount(uid primitive.ObjectID) error
	GetAccount() []*model.Account
	LoginAccount(account string, password string) *model.Account
	InitAccount() error
	UpdateAccount(lT *model.Account) *model.Account
	UpdateAccountPassword(lT *model.Account) *model.Account
}

The AccountDatabase interface for encapsulating database access.

type AuxFunAPI

type AuxFunAPI struct {
	DB AuxFunDatabase
}

The AuxFunAPI provides handlers for managing AuxFun.

func (*AuxFunAPI) Add

func (sAPI *AuxFunAPI) Add(ctx *gin.Context)

Add creates a AuxFun.

func (*AuxFunAPI) Delete

func (sAPI *AuxFunAPI) Delete(ctx *gin.Context)

Delete deletes a AuxFun by uid

func (*AuxFunAPI) Get

func (sAPI *AuxFunAPI) Get(ctx *gin.Context)

Get returns all the AuxFun

func (*AuxFunAPI) Update

func (sAPI *AuxFunAPI) Update(ctx *gin.Context)

Update is updates the AuxFun

type AuxFunDatabase

type AuxFunDatabase interface {
	AddAuxFun(lA *model.AuxFun) *model.AuxFun
	CountAuxFun() string
	DeleteAuxFun(uid primitive.ObjectID) error
	GetAuxFun() []*model.AuxFun
	InitAuxFun() error
	UpdateAuxFun(lA *model.AuxFun) *model.AuxFun
}

The AuxFunDatabase interface for encapsulating database access.

type ClientAPI

type ClientAPI struct {
	DB ClientDatabase
}

The ClientAPI provides handlers for managing Client.

func (*ClientAPI) Add

func (sAPI *ClientAPI) Add(ctx *gin.Context)

Add creates a Client.

func (*ClientAPI) Delete

func (sAPI *ClientAPI) Delete(ctx *gin.Context)

Delete deletes a Client by uid

func (*ClientAPI) Get

func (sAPI *ClientAPI) Get(ctx *gin.Context)

Get returns all the Client

func (*ClientAPI) Update

func (sAPI *ClientAPI) Update(ctx *gin.Context)

Update is updates the Client

type ClientDatabase

type ClientDatabase interface {
	AddClient(lA *model.Client) *model.Client
	CountClient() string
	DeleteClient(uid primitive.ObjectID) error
	GetClient() []*model.Client
	UpdateClient(lA *model.Client) *model.Client
}

The ClientDatabase interface for encapsulating database access.

type DiagnosisAPI

type DiagnosisAPI struct {
	DB DiagnosisDatabase
}

The DiagnosisAPI provides handlers for managing Diagnosis.

func (*DiagnosisAPI) Add

func (sAPI *DiagnosisAPI) Add(ctx *gin.Context)

Add creates a Diagnosis.

func (*DiagnosisAPI) Delete

func (sAPI *DiagnosisAPI) Delete(ctx *gin.Context)

Delete deletes a Diagnosis by uid

func (*DiagnosisAPI) Get

func (sAPI *DiagnosisAPI) Get(ctx *gin.Context)

Get returns all the Diagnosis

func (*DiagnosisAPI) Update

func (sAPI *DiagnosisAPI) Update(ctx *gin.Context)

Update is updates the Diagnosis

type DiagnosisDatabase

type DiagnosisDatabase interface {
	AddDiagnosis(lA *model.Diagnosis) *model.Diagnosis
	CountDiagnosis() string
	DeleteDiagnosis(uid primitive.ObjectID) error
	GetDiagnosis() []*model.Diagnosis
	InitDiagnosis() error
	UpdateDiagnosis(lA *model.Diagnosis) *model.Diagnosis
}

The DiagnosisDatabase interface for encapsulating database access.

type FaultAPI

type FaultAPI struct {
	DB FaultDatabase
}

The FaultAPI provides handlers for managing Fault.

func (*FaultAPI) Add

func (sAPI *FaultAPI) Add(ctx *gin.Context)

Add creates a Fault.

func (*FaultAPI) Delete

func (sAPI *FaultAPI) Delete(ctx *gin.Context)

Delete deletes a Fault by uid

func (*FaultAPI) Get

func (sAPI *FaultAPI) Get(ctx *gin.Context)

Get returns all the Fault

func (*FaultAPI) Update

func (sAPI *FaultAPI) Update(ctx *gin.Context)

Update is updates the Fault

type FaultDatabase

type FaultDatabase interface {
	AddFault(lA *model.Fault) *model.Fault
	CountFault() string
	DeleteFault(uid primitive.ObjectID) error
	GetFault() []*model.Fault
	UpdateFault(lA *model.Fault) *model.Fault
}

The FaultDatabase interface for encapsulating database access.

type HostAPI

type HostAPI struct {
	DB HostDatabase
}

The HostAPI provides handlers for managing Host.

func (*HostAPI) Add

func (sAPI *HostAPI) Add(ctx *gin.Context)

Add creates a Host.

func (*HostAPI) Delete

func (sAPI *HostAPI) Delete(ctx *gin.Context)

Delete deletes a Host by uid

func (*HostAPI) Get

func (sAPI *HostAPI) Get(ctx *gin.Context)

Get returns all the Host

func (*HostAPI) Update

func (sAPI *HostAPI) Update(ctx *gin.Context)

Update is updates the Host

type HostDatabase

type HostDatabase interface {
	AddHost(lA *model.Host) *model.Host
	CountHost() string
	DeleteHost(uid primitive.ObjectID) error
	GetHost() []*model.Host
	InitHost() error
	UpdateHost(lA *model.Host) *model.Host
}

The HostDatabase interface for encapsulating database access.

type IssueAPI

type IssueAPI struct {
	DB IssueDatabase
}

The IssueAPI provides handlers for managing Issue.

func (*IssueAPI) Add

func (sAPI *IssueAPI) Add(ctx *gin.Context)

Add creates a Issue.

func (*IssueAPI) Delete

func (sAPI *IssueAPI) Delete(ctx *gin.Context)

Delete deletes a Issue by uid

func (*IssueAPI) Get

func (sAPI *IssueAPI) Get(ctx *gin.Context)

Get returns all the Issue

func (*IssueAPI) Update

func (sAPI *IssueAPI) Update(ctx *gin.Context)

Update is updates the Issue

type IssueDatabase

type IssueDatabase interface {
	AddIssue(lA *model.Issue) *model.Issue
	CountIssue() string
	DeleteIssue(uid primitive.ObjectID) error
	GetIssue() []*model.Issue
	InitIssue() error
	UpdateIssue(lA *model.Issue) *model.Issue
}

The IssueDatabase interface for encapsulating database access.

type LayoutAPI

type LayoutAPI struct {
	DB LayoutDatabase
}

The LayoutAPI provides handlers for managing Layout.

func (*LayoutAPI) Add

func (sAPI *LayoutAPI) Add(ctx *gin.Context)

Add creates a Layout.

func (*LayoutAPI) Delete

func (sAPI *LayoutAPI) Delete(ctx *gin.Context)

Delete deletes a Layout by uid

func (*LayoutAPI) Get

func (sAPI *LayoutAPI) Get(ctx *gin.Context)

Get returns all the Layout

func (*LayoutAPI) Update

func (sAPI *LayoutAPI) Update(ctx *gin.Context)

Update is updates the Layout

type LayoutDatabase

type LayoutDatabase interface {
	AddLayout(lA *model.Layout) *model.Layout
	CountLayout() string
	DeleteLayout(uid primitive.ObjectID) error
	GetLayout() []*model.Layout
	InitLayout() error
	UpdateLayout(lA *model.Layout) *model.Layout
}

The LayoutDatabase interface for encapsulating database access.

type LocationAPI

type LocationAPI struct {
	DB LocationDatabase
}

The LocationAPI provides handlers for managing Location.

func (*LocationAPI) Add

func (sAPI *LocationAPI) Add(ctx *gin.Context)

Add creates a Location.

func (*LocationAPI) Delete

func (sAPI *LocationAPI) Delete(ctx *gin.Context)

Delete deletes a Location by uid

func (*LocationAPI) Get

func (sAPI *LocationAPI) Get(ctx *gin.Context)

Get returns all the Location

func (*LocationAPI) Update

func (sAPI *LocationAPI) Update(ctx *gin.Context)

Update is updates the Location

type LocationDatabase

type LocationDatabase interface {
	AddLocation(lA *model.Location) *model.Location
	CountLocation() string
	DeleteLocation(uid primitive.ObjectID) error
	GetLocation() []*model.Location
	UpdateLocation(lA *model.Location) *model.Location
}

The LocationDatabase interface for encapsulating database access.

type MoldAPI

type MoldAPI struct {
	DB MoldDatabase
}

The MoldAPI provides handlers for managing Mold.

func (*MoldAPI) Add

func (sAPI *MoldAPI) Add(ctx *gin.Context)

Add creates a Mold.

func (*MoldAPI) Delete

func (sAPI *MoldAPI) Delete(ctx *gin.Context)

Delete deletes a Mold by uid

func (*MoldAPI) Get

func (sAPI *MoldAPI) Get(ctx *gin.Context)

Get returns all the Mold

func (*MoldAPI) Update

func (sAPI *MoldAPI) Update(ctx *gin.Context)

Update is updates the Mold

type MoldDatabase

type MoldDatabase interface {
	AddMold(lA *model.Mold) *model.Mold
	CountMold() string
	DeleteMold(uid primitive.ObjectID) error
	GetMold() []*model.Mold
	InitMold() error
	UpdateMold(lA *model.Mold) *model.Mold
}

The MoldDatabase interface for encapsulating database access.

type MoldFunAPI

type MoldFunAPI struct {
	DB MoldFunDatabase
}

The MoldFunAPI provides handlers for managing MoldFun.

func (*MoldFunAPI) Add

func (sAPI *MoldFunAPI) Add(ctx *gin.Context)

Add creates a MoldFun.

func (*MoldFunAPI) Delete

func (sAPI *MoldFunAPI) Delete(ctx *gin.Context)

Delete deletes a MoldFun by uid

func (*MoldFunAPI) Get

func (sAPI *MoldFunAPI) Get(ctx *gin.Context)

Get returns all the MoldFun

func (*MoldFunAPI) Update

func (sAPI *MoldFunAPI) Update(ctx *gin.Context)

Update is updates the MoldFun

type MoldFunDatabase

type MoldFunDatabase interface {
	AddMoldFun(lA *model.MoldFun) *model.MoldFun
	CountMoldFun() string
	DeleteMoldFun(uid primitive.ObjectID) error
	GetMoldFun() []*model.MoldFun
	InitMoldFun() error
	UpdateMoldFun(lA *model.MoldFun) *model.MoldFun
}

The MoldFunDatabase interface for encapsulating database access.

type MonitorAPI

type MonitorAPI struct {
	DB MonitorDatabase
}

The MonitorAPI provides handlers for managing Monitor.

func (*MonitorAPI) Add

func (sAPI *MonitorAPI) Add(ctx *gin.Context)

Add creates a Monitor.

func (*MonitorAPI) Delete

func (sAPI *MonitorAPI) Delete(ctx *gin.Context)

Delete deletes a Monitor by uid

func (*MonitorAPI) Get

func (sAPI *MonitorAPI) Get(ctx *gin.Context)

Get returns all the Monitor

func (*MonitorAPI) Update

func (sAPI *MonitorAPI) Update(ctx *gin.Context)

Update is updates the Monitor

type MonitorDatabase

type MonitorDatabase interface {
	AddMonitor(lA *model.Monitor) *model.Monitor
	CountMonitor() string
	DeleteMonitor(uid primitive.ObjectID) error
	GetMonitor() []*model.Monitor
	UpdateMonitor(lA *model.Monitor) *model.Monitor
}

The MonitorDatabase interface for encapsulating database access.

type NoticeAPI

type NoticeAPI struct {
	DB NoticeDatabase
}

The NoticeAPI provides handlers for managing Notice.

func (*NoticeAPI) Add

func (sAPI *NoticeAPI) Add(ctx *gin.Context)

Add creates a Notice.

func (*NoticeAPI) Delete

func (sAPI *NoticeAPI) Delete(ctx *gin.Context)

Delete deletes a Notice by uid

func (*NoticeAPI) Get

func (sAPI *NoticeAPI) Get(ctx *gin.Context)

Get returns all the Notice

func (*NoticeAPI) Update

func (sAPI *NoticeAPI) Update(ctx *gin.Context)

Update is updates the Notice

type NoticeDatabase

type NoticeDatabase interface {
	AddNotice(lA *model.Notice) *model.Notice
	CountNotice() string
	DeleteNotice(uid primitive.ObjectID) error
	GetNotice() []*model.Notice
	InitNotice() error
	UpdateNotice(lA *model.Notice) *model.Notice
}

The NoticeDatabase interface for encapsulating database access.

type NoticeFunAPI

type NoticeFunAPI struct {
	DB NoticeFunDatabase
}

The NoticeFunAPI provides handlers for managing NoticeFun.

func (*NoticeFunAPI) Add

func (sAPI *NoticeFunAPI) Add(ctx *gin.Context)

Add creates a NoticeFun.

func (*NoticeFunAPI) Delete

func (sAPI *NoticeFunAPI) Delete(ctx *gin.Context)

Delete deletes a NoticeFun by uid

func (*NoticeFunAPI) Get

func (sAPI *NoticeFunAPI) Get(ctx *gin.Context)

Get returns all the NoticeFun

func (*NoticeFunAPI) Update

func (sAPI *NoticeFunAPI) Update(ctx *gin.Context)

Update is updates the NoticeFun

type NoticeFunDatabase

type NoticeFunDatabase interface {
	AddNoticeFun(lA *model.NoticeFun) *model.NoticeFun
	CountNoticeFun() string
	DeleteNoticeFun(uid primitive.ObjectID) error
	GetNoticeFun() []*model.NoticeFun
	InitNoticeFun() error
	UpdateNoticeFun(lA *model.NoticeFun) *model.NoticeFun
}

The NoticeFunDatabase interface for encapsulating database access.

type PPLogsAPI

type PPLogsAPI struct {
	DB PPLogsDatabase
}

The PPLogsAPI provides handlers for managing PPLogs.

func (*PPLogsAPI) Add

func (sAPI *PPLogsAPI) Add(ctx *gin.Context)

Add creates a PPLogs.

func (*PPLogsAPI) Delete

func (sAPI *PPLogsAPI) Delete(ctx *gin.Context)

Delete deletes a PPLogs by uid

func (*PPLogsAPI) Get

func (sAPI *PPLogsAPI) Get(ctx *gin.Context)

Get returns all the PPLogs

func (*PPLogsAPI) Update

func (sAPI *PPLogsAPI) Update(ctx *gin.Context)

Update is updates the PPLogs

type PPLogsDatabase

type PPLogsDatabase interface {
	AddPPLogs(lA *model.PPLogs) *model.PPLogs
	CountPPLogs() string
	DeletePPLogs(uid primitive.ObjectID) error
	GetPPLogs() []*model.PPLogs
	UpdatePPLogs(lA *model.PPLogs) *model.PPLogs
}

The PPLogsDatabase interface for encapsulating database access.

type PermissionsAPI

type PermissionsAPI struct {
	DB PermissionsDatabase
}

The PermissionsAPI provides handlers for managing Permissions.

func (*PermissionsAPI) Add

func (sAPI *PermissionsAPI) Add(ctx *gin.Context)

Add creates a Permissions.

func (*PermissionsAPI) Delete

func (sAPI *PermissionsAPI) Delete(ctx *gin.Context)

Delete deletes a Permissions by uid

func (*PermissionsAPI) Get

func (sAPI *PermissionsAPI) Get(ctx *gin.Context)

Get returns all the Permissions

func (*PermissionsAPI) Update

func (sAPI *PermissionsAPI) Update(ctx *gin.Context)

Update is updates the Permissions

type PermissionsDatabase

type PermissionsDatabase interface {
	AddPermissions(lA *model.Permissions) *model.Permissions
	CountPermissions() string
	DeletePermissions(uid primitive.ObjectID) error
	GetPermissions() []*model.Permissions
	InitPermissions() error
	UpdatePermissions(lA *model.Permissions) *model.Permissions
}

The PermissionsDatabase interface for encapsulating database access.

type RoleAPI

type RoleAPI struct {
	DB RoleDatabase
}

The RoleAPI provides handlers for managing Role.

func (*RoleAPI) Add

func (sAPI *RoleAPI) Add(ctx *gin.Context)

Add creates a Role.

func (*RoleAPI) Delete

func (sAPI *RoleAPI) Delete(ctx *gin.Context)

Delete deletes a Role by uid

func (*RoleAPI) FindRole

func (sAPI *RoleAPI) FindRole(ctx *gin.Context)

FindRole returns the Role by the given by Auth or nil.

func (*RoleAPI) Get

func (sAPI *RoleAPI) Get(ctx *gin.Context)

Get returns all the Role

func (*RoleAPI) Update

func (sAPI *RoleAPI) Update(ctx *gin.Context)

Update is updates the Role

type RoleDatabase

type RoleDatabase interface {
	AddRole(lA *model.Role) *model.Role
	CountRole() string
	DeleteRole(uid primitive.ObjectID) error
	GetRole() []*model.Role
	FindRole(Auth uint) *model.Role
	InitRole() error
	UpdateRole(lA *model.Role) *model.Role
}

The RoleDatabase interface for encapsulating database access.

type SigninAPI

type SigninAPI struct {
	DB SigninDatabase
}

The SigninAPI provides handlers for managing Signin.

func (*SigninAPI) Add

func (sAPI *SigninAPI) Add(ctx *gin.Context)

Add creates a Signin.

func (*SigninAPI) Delete

func (sAPI *SigninAPI) Delete(ctx *gin.Context)

Delete deletes a Signin by uid

func (*SigninAPI) Get

func (sAPI *SigninAPI) Get(ctx *gin.Context)

Get returns all the Signin

func (*SigninAPI) Signout

func (sAPI *SigninAPI) Signout(ctx *gin.Context)

Signout updates a Signin by uid

type SigninDatabase

type SigninDatabase interface {
	AddSignin(lA *model.Signin) *model.Signin
	CountSignin() string
	DeleteSignin(uid primitive.ObjectID) error
	GetSignin() []*model.Signin
	Signout(uid primitive.ObjectID) error
}

The SigninDatabase interface for encapsulating database access.

type StudentAPI

type StudentAPI struct {
	DB StudentDatabase
}

The StudentAPI provides handlers for managing Student.

func (*StudentAPI) Add

func (sAPI *StudentAPI) Add(ctx *gin.Context)

Add creates a Student.

func (*StudentAPI) Delete

func (sAPI *StudentAPI) Delete(ctx *gin.Context)

Delete deletes a Student by uid

func (*StudentAPI) Get

func (sAPI *StudentAPI) Get(ctx *gin.Context)

Get returns all the Student

func (*StudentAPI) Import

func (sAPI *StudentAPI) Import(ctx *gin.Context)

Import all the Student

func (*StudentAPI) LoginStudent

func (sAPI *StudentAPI) LoginStudent(ctx *gin.Context)

LoginStudent returns the Student by the given SNo and Password or nil.

func (*StudentAPI) Update

func (sAPI *StudentAPI) Update(ctx *gin.Context)

Update is updates the Student

type StudentDatabase

type StudentDatabase interface {
	AddStudent(lA *model.Student) *model.Student
	CountStudent() string
	DeleteStudent(uid primitive.ObjectID) error
	GetStudent() []*model.Student
	ImportStudent(lA []model.Student) []*model.Student
	LoginStudent(SNo string, Password string) *model.Student
	UpdateStudent(lA *model.Student) *model.Student
}

The StudentDatabase interface for encapsulating database access.

type SurveyAPI

type SurveyAPI struct {
	DB SurveyDatabase
}

The SurveyAPI provides handlers for managing Survey.

func (*SurveyAPI) Add

func (sAPI *SurveyAPI) Add(ctx *gin.Context)

Add creates a Survey.

func (*SurveyAPI) Delete

func (sAPI *SurveyAPI) Delete(ctx *gin.Context)

Delete deletes a Survey by uid

func (*SurveyAPI) Get

func (sAPI *SurveyAPI) Get(ctx *gin.Context)

Get returns all the Survey

func (*SurveyAPI) Update

func (sAPI *SurveyAPI) Update(ctx *gin.Context)

Update is updates the Survey

type SurveyDatabase

type SurveyDatabase interface {
	AddSurvey(lA *model.Survey) *model.Survey
	CountSurvey() string
	DeleteSurvey(uid primitive.ObjectID) error
	GetSurvey() []*model.Survey
	InitSurvey() error
	UpdateSurvey(lA *model.Survey) *model.Survey
}

The SurveyDatabase interface for encapsulating database access.

type TerminalAPI

type TerminalAPI struct {
	DB TerminalDatabase
}

The TerminalAPI provides handlers for managing Terminal.

func (*TerminalAPI) Add

func (sAPI *TerminalAPI) Add(ctx *gin.Context)

Add creates a Terminal.

func (*TerminalAPI) Delete

func (sAPI *TerminalAPI) Delete(ctx *gin.Context)

Delete deletes a Terminal by uid

func (*TerminalAPI) Get

func (sAPI *TerminalAPI) Get(ctx *gin.Context)

Get returns all the Terminal

func (*TerminalAPI) LoginTerminal

func (sAPI *TerminalAPI) LoginTerminal(ctx *gin.Context)

LoginTerminal returns the Terminal by the given label and ip or nil.

func (*TerminalAPI) Update

func (sAPI *TerminalAPI) Update(ctx *gin.Context)

Update is updates the Terminal

type TerminalDatabase

type TerminalDatabase interface {
	AddTerminal(lA *model.Terminal) *model.Terminal
	CountTerminal() string
	DeleteTerminal(uid primitive.ObjectID) error
	GetTerminal() []*model.Terminal
	LoginTerminal(label string, ip string) *model.Terminal
	UpdateTerminal(lA *model.Terminal) *model.Terminal
}

The TerminalDatabase interface for encapsulating database access.

type UniversityAPI

type UniversityAPI struct {
	DB UniversityDatabase
}

The UniversityAPI provides handlers for managing University.

func (*UniversityAPI) Add

func (sAPI *UniversityAPI) Add(ctx *gin.Context)

Add creates a University.

func (*UniversityAPI) Delete

func (sAPI *UniversityAPI) Delete(ctx *gin.Context)

Delete deletes a University by uid

func (*UniversityAPI) Get

func (sAPI *UniversityAPI) Get(ctx *gin.Context)

Get returns all the University

func (*UniversityAPI) Update

func (sAPI *UniversityAPI) Update(ctx *gin.Context)

Update is updates the University

type UniversityDatabase

type UniversityDatabase interface {
	AddUniversity(lA *model.University) *model.University
	CountUniversity() string
	DeleteUniversity(uid primitive.ObjectID) error
	GetUniversity() []*model.University
	UpdateUniversity(lA *model.University) *model.University
}

The UniversityDatabase interface for encapsulating database access.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier