bill

package
v0.0.0-...-b52a236 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bill is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlRepo

func NewMysqlRepo(dsn string) (*mysqlRepo, error)

Types

type CreateBillOptions

type CreateBillOptions struct {
	Name      *string
	CreatedAt *time.Time
}

type CreateBillParams

type CreateBillParams struct {
	UserID   uint
	Amount   float64
	Category string
	CreateBillOptions
}

type GetUserBillsByCreateTimeOptions

type GetUserBillsByCreateTimeOptions struct {
	GreaterThan    time.Time // 时间范围区间左侧
	GreaterOrEqual bool      // 是否为闭区间
	LessThan       time.Time // 时间范围区间右侧
	LessOrEqual    bool      // 是否为闭区间
}

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

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
}

Jump to

Keyboard shortcuts

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