repositories

package
v0.0.0-...-6192489 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentRepository

type CommentRepository struct {
	DB infrastructures.ISQLConnection
}

CommentRepository is

func (*CommentRepository) GetCommentByDocID

func (r *CommentRepository) GetCommentByDocID(ctx context.Context, conditon map[string]interface{}) (comments []models.Comment, err error)

GetCommentByDocID get document spesific user

func (*CommentRepository) StoreComment

func (r *CommentRepository) StoreComment(ctx context.Context, db *dbr.Tx, doc models.Comment) (idComment int64, err error)

StoreComment store agent type data to database

func (*CommentRepository) Tx

func (r *CommentRepository) Tx() (tx *dbr.Tx, err error)

Tx init a new transaction

type DocumentActivityRepository

type DocumentActivityRepository struct {
	DB infrastructures.ISQLConnection
}

DocumentActivityRepository is

func (*DocumentActivityRepository) GetActivityByDocID

func (r *DocumentActivityRepository) GetActivityByDocID(ctx context.Context, documentID int) (activity []models.DocumentActivity, err error)

GetActivityByDocID get document spesific user

func (*DocumentActivityRepository) StoreDocumentActivity

func (r *DocumentActivityRepository) StoreDocumentActivity(ctx context.Context, db *dbr.Tx, doc models.DocumentActivity) (idDocUser int64, err error)

StoreDocumentActivity store agent type data to database

type DocumentUserRepository

type DocumentUserRepository struct {
	DB infrastructures.ISQLConnection
}

DocumentUserRepository is

func (*DocumentUserRepository) CountDocByUser

func (r *DocumentUserRepository) CountDocByUser(ctx context.Context, userID int) (count models.CountDocUser, err error)

CountDocByUser get document spesific user

func (*DocumentUserRepository) GetDocByUser

func (r *DocumentUserRepository) GetDocByUser(ctx context.Context, conditon map[string]interface{}, paging helpers.PageReq, sorting string) (dataDocs []models.DocumentUserJoinDoc, total int, err error)

GetDocByUser get document spesific user

func (*DocumentUserRepository) GetSingleDocByUser

func (r *DocumentUserRepository) GetSingleDocByUser(ctx context.Context, userID int, documentID int) (dataDoc models.DocumentUserJoinDoc, err error)

GetSingleDocByUser get document spesific user

func (*DocumentUserRepository) StoreDocumentUser

func (r *DocumentUserRepository) StoreDocumentUser(ctx context.Context, db *dbr.Tx, doc models.DocumentUser) (idDocUser int64, err error)

StoreDocumentUser store agent type data to database

func (*DocumentUserRepository) UpdateDocUsers

func (r *DocumentUserRepository) UpdateDocUsers(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)

UpdateDocUsers func

type DocumentsRepository

type DocumentsRepository struct {
	DB infrastructures.ISQLConnection
}

DocumentsRepository is

func (*DocumentsRepository) CountNameByUserID

func (r *DocumentsRepository) CountNameByUserID(ctx context.Context, doc models.Documents) (totalID int64, err error)

CountNameByUserID count same filename by user ID

func (*DocumentsRepository) GetDoc

func (r *DocumentsRepository) GetDoc(ctx context.Context, conditon map[string]interface{}) (doc models.Documents, err error)

GetDoc get document

func (*DocumentsRepository) StoreDocuments

func (r *DocumentsRepository) StoreDocuments(ctx context.Context, db *dbr.Tx, doc models.Documents) (idDoc int64, err error)

StoreDocuments store agent type data to database

func (*DocumentsRepository) Tx

func (r *DocumentsRepository) Tx() (tx *dbr.Tx, err error)

Tx init a new transaction

func (*DocumentsRepository) UpdateDoc

func (r *DocumentsRepository) UpdateDoc(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)

UpdateDoc func

type EsignRepository

type EsignRepository struct {
	DB infrastructures.ISQLConnection
}

EsignRepository is

func (*EsignRepository) PostEsign

func (r *EsignRepository) PostEsign(ctx context.Context, dataSign models.EsignReq) (result models.EsignResp, err error)

PostEsign post to bsre

type ICommentRepository

type ICommentRepository interface {
	Tx() (tx *dbr.Tx, err error)
	StoreComment(ctx context.Context, db *dbr.Tx, doc models.Comment) (idComment int64, err error)
	GetCommentByDocID(ctx context.Context, conditon map[string]interface{}) (comments []models.Comment, err error)
}

ICommentRepository is

type IDocumentActivityRepository

type IDocumentActivityRepository interface {
	StoreDocumentActivity(ctx context.Context, db *dbr.Tx, doc models.DocumentActivity) (idDocUser int64, err error)
	GetActivityByDocID(ctx context.Context, documentID int) (activity []models.DocumentActivity, err error)
}

IDocumentActivityRepository is

type IDocumentUserRepository

type IDocumentUserRepository interface {
	StoreDocumentUser(ctx context.Context, db *dbr.Tx, doc models.DocumentUser) (idDocUser int64, err error)
	GetDocByUser(ctx context.Context, conditon map[string]interface{}, paging helpers.PageReq, sorting string) (dataDocs []models.DocumentUserJoinDoc, total int, err error)
	UpdateDocUsers(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)
	GetSingleDocByUser(ctx context.Context, userID int, documentID int) (dataDoc models.DocumentUserJoinDoc, err error)
	CountDocByUser(ctx context.Context, userID int) (count models.CountDocUser, err error)
}

IDocumentUserRepository is

type IDocumentsRepository

type IDocumentsRepository interface {
	Tx() (tx *dbr.Tx, err error)
	StoreDocuments(ctx context.Context, db *dbr.Tx, doc models.Documents) (idDoc int64, err error)
	CountNameByUserID(ctx context.Context, doc models.Documents) (totalID int64, err error)
	UpdateDoc(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)
	GetDoc(ctx context.Context, conditon map[string]interface{}) (doc models.Documents, err error)
}

IDocumentsRepository is

type IEsignRepository

type IEsignRepository interface {
	PostEsign(ctx context.Context, dataSign models.EsignReq) (result models.EsignResp, err error)
}

IEsignRepository is

type IPlayerRepository

type IPlayerRepository interface {
	StorePlayer(data models.Player) (models.Player, error)
}

IPlayerRepository is

type ISniperRepository

type ISniperRepository interface {
	LoginMehong(ctx context.Context, c models.EncryptedCookies) (response models.ResponseSniper, err error)
}

ISniperRepository is

type IUserRepository

type IUserRepository interface {
	GetUserByIDDPR(IDDpr int) (user models.User, err error)
	StoreUser(user models.User) (count int64, err error)
	UpdateUserByID(id int, user models.User) (err error)
	Login(l models.Login) (auth bool, user models.User, err error)
	GetUserByNIPstore(nip string) (user models.User, err error)
	FindOneUser(ctx context.Context, Condition map[string]interface{}) (User models.User, err error)
	UpdateUserCond(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)
	Tx() (tx *dbr.Tx, err error)
	GetAll(ctx context.Context) (user []models.ListUser, err error)
	LoginMehongUser(ctx context.Context, c models.EncryptedCookies) (response models.ResponseSniper, err error)
}

IUserRepository is

type PlayerRepository

type PlayerRepository struct {
	DB infrastructures.ISQLConnection
}

PlayerRepository is

func (*PlayerRepository) StorePlayer

func (r *PlayerRepository) StorePlayer(data models.Player) (models.Player, error)

StorePlayer store agent type data to database

type SniperRepository

type SniperRepository struct {
	Redis infrastructures.IRedis
}

SniperRepository is

func (*SniperRepository) LoginMehong

func (r *SniperRepository) LoginMehong(ctx context.Context, c models.EncryptedCookies) (response models.ResponseSniper, err error)

LoginMehong store agent type data to database

type UserRepository

type UserRepository struct {
	DB    infrastructures.ISQLConnection
	Redis infrastructures.IRedis
}

UserRepository is

func (*UserRepository) FindOneUser

func (r *UserRepository) FindOneUser(ctx context.Context, Condition map[string]interface{}) (User models.User, err error)

FindOneUser func

func (*UserRepository) GetAll

func (r *UserRepository) GetAll(ctx context.Context) (user []models.ListUser, err error)

GetAll agent type data to database

func (*UserRepository) GetUserByIDDPR

func (r *UserRepository) GetUserByIDDPR(IDDpr int) (user models.User, err error)

GetUserByIDDPR store agent type data to database

func (*UserRepository) GetUserByNIPstore

func (r *UserRepository) GetUserByNIPstore(nip string) (user models.User, err error)

GetUserByNIPstore agent type data to database

func (*UserRepository) Login

func (r *UserRepository) Login(l models.Login) (auth bool, user models.User, err error)

Login find match username and password

func (*UserRepository) LoginMehongUser

func (r *UserRepository) LoginMehongUser(ctx context.Context, c models.EncryptedCookies) (response models.ResponseSniper, err error)

LoginMehongUser store agent type data to database

func (*UserRepository) StoreUser

func (r *UserRepository) StoreUser(user models.User) (count int64, err error)

StoreUser store user data to database

func (*UserRepository) Tx

func (r *UserRepository) Tx() (tx *dbr.Tx, err error)

Tx init a new transaction

func (*UserRepository) UpdateUserByID

func (r *UserRepository) UpdateUserByID(id int, user models.User) (err error)

UpdateUserByID store agent type data to database

func (*UserRepository) UpdateUserCond

func (r *UserRepository) UpdateUserCond(ctx context.Context, db *dbr.Tx, Condition map[string]interface{}, Payload map[string]interface{}) (affect int64, err error)

UpdateUserCond func

Jump to

Keyboard shortcuts

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