Documentation ¶
Overview ¶
Package bill is a generated GoMock package.
Index ¶
- func NewMysqlRepo(dsn string) (*mysqlRepo, error)
- type CreateBillOptions
- type CreateBillParams
- type GetUserBillsByCreateTimeOptions
- type MockRepository
- func (m *MockRepository) CreateBillAndUpdateUserBalance(userID uint, amount float64, category string, opts ...CreateBillOptions) (*models.Bill, error)
- func (m *MockRepository) CreateBillsAndUpdateUserBalance(userID uint, bills []CreateBillParams) error
- func (m *MockRepository) DeleteBillAndUpdateUserBalance(billID uint) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetUserBillsByCreateTime(userID uint, opts ...GetUserBillsByCreateTimeOptions) ([]*models.Bill, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) CreateBillAndUpdateUserBalance(userID, amount, category interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) CreateBillsAndUpdateUserBalance(userID, bills interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteBillAndUpdateUserBalance(billID interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetUserBillsByCreateTime(userID interface{}, opts ...interface{}) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMysqlRepo ¶
Types ¶
type CreateBillOptions ¶
type CreateBillParams ¶
type CreateBillParams struct { UserID uint Amount float64 Category string CreateBillOptions }
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) CreateBillAndUpdateUserBalance ¶
func (m *MockRepository) CreateBillAndUpdateUserBalance(userID uint, amount float64, category string, opts ...CreateBillOptions) (*models.Bill, error)
CreateBillAndUpdateUserBalance mocks base method.
func (*MockRepository) CreateBillsAndUpdateUserBalance ¶
func (m *MockRepository) CreateBillsAndUpdateUserBalance(userID uint, bills []CreateBillParams) error
CreateBillsAndUpdateUserBalance mocks base method.
func (*MockRepository) DeleteBillAndUpdateUserBalance ¶
func (m *MockRepository) DeleteBillAndUpdateUserBalance(billID uint) error
DeleteBillAndUpdateUserBalance mocks base method.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) GetUserBillsByCreateTime ¶
func (m *MockRepository) GetUserBillsByCreateTime(userID uint, opts ...GetUserBillsByCreateTimeOptions) ([]*models.Bill, error)
GetUserBillsByCreateTime mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) CreateBillAndUpdateUserBalance ¶
func (mr *MockRepositoryMockRecorder) CreateBillAndUpdateUserBalance(userID, amount, category interface{}, opts ...interface{}) *gomock.Call
CreateBillAndUpdateUserBalance indicates an expected call of CreateBillAndUpdateUserBalance.
func (*MockRepositoryMockRecorder) CreateBillsAndUpdateUserBalance ¶
func (mr *MockRepositoryMockRecorder) CreateBillsAndUpdateUserBalance(userID, bills interface{}) *gomock.Call
CreateBillsAndUpdateUserBalance indicates an expected call of CreateBillsAndUpdateUserBalance.
func (*MockRepositoryMockRecorder) DeleteBillAndUpdateUserBalance ¶
func (mr *MockRepositoryMockRecorder) DeleteBillAndUpdateUserBalance(billID interface{}) *gomock.Call
DeleteBillAndUpdateUserBalance indicates an expected call of DeleteBillAndUpdateUserBalance.
func (*MockRepositoryMockRecorder) GetUserBillsByCreateTime ¶
func (mr *MockRepositoryMockRecorder) GetUserBillsByCreateTime(userID interface{}, opts ...interface{}) *gomock.Call
GetUserBillsByCreateTime indicates an expected call of GetUserBillsByCreateTime.
type Repository ¶
type Repository interface { // CreateBillAndUpdateUserBalance 为用户创建一个账单,并更新用户余额(若用户余额不为空) CreateBillAndUpdateUserBalance(userID uint, amount float64, category string, opts ...CreateBillOptions) (*models.Bill, error) // CreateBillsAndUpdateUserBalance 为用户创建多个账单,并更新用户余额(若用户余额不为空) CreateBillsAndUpdateUserBalance(userID uint, bills []CreateBillParams) error // GetUserBillsByCreateTime 获取用户在指定时间范围内的账单列表,若 opts 为空,则返回账单(opts 只取列表第一个作为查询参数) GetUserBillsByCreateTime(userID uint, opts ...GetUserBillsByCreateTimeOptions) ([]*models.Bill, error) // DeleteBillAndUpdateUserBalance 删除订单并更新用户余额 DeleteBillAndUpdateUserBalance(billID uint) error }