This commit is contained in:
Владимир Фёдоров 2026-03-02 03:06:54 +07:00
parent ccc4f126f6
commit 1c63cc1747
3 changed files with 225 additions and 0 deletions

1
go.mod
View File

@ -12,6 +12,7 @@ require (
require ( require (
github.com/ghodss/yaml v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect
github.com/golang/glog v1.2.5 // indirect github.com/golang/glog v1.2.5 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect github.com/golang/protobuf v1.5.4 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect

View File

@ -1,3 +1,4 @@
//go:generate mockgen -source=interface.go -destination=mocks/mock.go -package=mocks
package db package db
import ( import (

View File

@ -0,0 +1,223 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: interface.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
models "evening_detective/internal/models"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockIDBService is a mock of IDBService interface.
type MockIDBService struct {
ctrl *gomock.Controller
recorder *MockIDBServiceMockRecorder
}
// MockIDBServiceMockRecorder is the mock recorder for MockIDBService.
type MockIDBServiceMockRecorder struct {
mock *MockIDBService
}
// NewMockIDBService creates a new mock instance.
func NewMockIDBService(ctrl *gomock.Controller) *MockIDBService {
mock := &MockIDBService{ctrl: ctrl}
mock.recorder = &MockIDBServiceMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockIDBService) EXPECT() *MockIDBServiceMockRecorder {
return m.recorder
}
// AddActions mocks base method.
func (m *MockIDBService) AddActions(ctx context.Context, teamId int64, actions []*models.Action) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddActions", ctx, teamId, actions)
ret0, _ := ret[0].(error)
return ret0
}
// AddActions indicates an expected call of AddActions.
func (mr *MockIDBServiceMockRecorder) AddActions(ctx, teamId, actions interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddActions", reflect.TypeOf((*MockIDBService)(nil).AddActions), ctx, teamId, actions)
}
// AddApplications mocks base method.
func (m *MockIDBService) AddApplications(ctx context.Context, teamId int64, applications []*models.Application) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddApplications", ctx, teamId, applications)
ret0, _ := ret[0].(error)
return ret0
}
// AddApplications indicates an expected call of AddApplications.
func (mr *MockIDBServiceMockRecorder) AddApplications(ctx, teamId, applications interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddApplications", reflect.TypeOf((*MockIDBService)(nil).AddApplications), ctx, teamId, applications)
}
// AddTeams mocks base method.
func (m *MockIDBService) AddTeams(ctx context.Context, teams []*models.Team) ([]*models.Team, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AddTeams", ctx, teams)
ret0, _ := ret[0].([]*models.Team)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AddTeams indicates an expected call of AddTeams.
func (mr *MockIDBServiceMockRecorder) AddTeams(ctx, teams interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTeams", reflect.TypeOf((*MockIDBService)(nil).AddTeams), ctx, teams)
}
// Close mocks base method.
func (m *MockIDBService) Close() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Close")
}
// Close indicates an expected call of Close.
func (mr *MockIDBServiceMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockIDBService)(nil).Close))
}
// DeleteAllTeams mocks base method.
func (m *MockIDBService) DeleteAllTeams(ctx context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteAllTeams", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteAllTeams indicates an expected call of DeleteAllTeams.
func (mr *MockIDBServiceMockRecorder) DeleteAllTeams(ctx interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllTeams", reflect.TypeOf((*MockIDBService)(nil).DeleteAllTeams), ctx)
}
// GetActions mocks base method.
func (m *MockIDBService) GetActions(ctx context.Context, teamId int64) ([]*models.Action, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetActions", ctx, teamId)
ret0, _ := ret[0].([]*models.Action)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetActions indicates an expected call of GetActions.
func (mr *MockIDBServiceMockRecorder) GetActions(ctx, teamId interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetActions", reflect.TypeOf((*MockIDBService)(nil).GetActions), ctx, teamId)
}
// GetApplications mocks base method.
func (m *MockIDBService) GetApplications(ctx context.Context, teamId int64) ([]*models.Application, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetApplications", ctx, teamId)
ret0, _ := ret[0].([]*models.Application)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetApplications indicates an expected call of GetApplications.
func (mr *MockIDBServiceMockRecorder) GetApplications(ctx, teamId interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplications", reflect.TypeOf((*MockIDBService)(nil).GetApplications), ctx, teamId)
}
// GetApplicationsByState mocks base method.
func (m *MockIDBService) GetApplicationsByState(ctx context.Context, teamId int64, state string) ([]*models.Application, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetApplicationsByState", ctx, teamId, state)
ret0, _ := ret[0].([]*models.Application)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetApplicationsByState indicates an expected call of GetApplicationsByState.
func (mr *MockIDBServiceMockRecorder) GetApplicationsByState(ctx, teamId, state interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplicationsByState", reflect.TypeOf((*MockIDBService)(nil).GetApplicationsByState), ctx, teamId, state)
}
// GetGame mocks base method.
func (m *MockIDBService) GetGame(ctx context.Context) (*models.Game, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetGame", ctx)
ret0, _ := ret[0].(*models.Game)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetGame indicates an expected call of GetGame.
func (mr *MockIDBServiceMockRecorder) GetGame(ctx interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGame", reflect.TypeOf((*MockIDBService)(nil).GetGame), ctx)
}
// GetTeam mocks base method.
func (m *MockIDBService) GetTeam(ctx context.Context, teamId, password any) (*models.Team, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTeam", ctx, teamId, password)
ret0, _ := ret[0].(*models.Team)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetTeam indicates an expected call of GetTeam.
func (mr *MockIDBServiceMockRecorder) GetTeam(ctx, teamId, password interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeam", reflect.TypeOf((*MockIDBService)(nil).GetTeam), ctx, teamId, password)
}
// GetTeams mocks base method.
func (m *MockIDBService) GetTeams(ctx context.Context) ([]*models.Team, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTeams", ctx)
ret0, _ := ret[0].([]*models.Team)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetTeams indicates an expected call of GetTeams.
func (mr *MockIDBServiceMockRecorder) GetTeams(ctx interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeams", reflect.TypeOf((*MockIDBService)(nil).GetTeams), ctx)
}
// GiveApplications mocks base method.
func (m *MockIDBService) GiveApplications(ctx context.Context, teamId int64, applications []*models.Application) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GiveApplications", ctx, teamId, applications)
ret0, _ := ret[0].(error)
return ret0
}
// GiveApplications indicates an expected call of GiveApplications.
func (mr *MockIDBServiceMockRecorder) GiveApplications(ctx, teamId, applications interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GiveApplications", reflect.TypeOf((*MockIDBService)(nil).GiveApplications), ctx, teamId, applications)
}
// UpdateGameState mocks base method.
func (m *MockIDBService) UpdateGameState(ctx context.Context, state string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateGameState", ctx, state)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateGameState indicates an expected call of UpdateGameState.
func (mr *MockIDBServiceMockRecorder) UpdateGameState(ctx, state interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGameState", reflect.TypeOf((*MockIDBService)(nil).UpdateGameState), ctx, state)
}