chance.go 1.2 KB
package repository

import "opp/models"

type IChanceRepository interface {
	GetChanceById(id int64) (v *models.Chance, err error)
}

var _ IChanceRepository = (*ChanceRepository)(nil)

type ChanceRepository struct{}

func (r *ChanceRepository) GetChanceById(id int64) (v *models.Chance, err error) {
	return models.GetChanceById(id)
}

type IChanceFavoriteRepository interface {
	GetChanceFavorites(userId, companyId int64, objectType, chanceType int, lastId int64, pageSize int) (v []*models.ChanceFavorite, total int, err error)
	ExitsChanceFavorite(userId, companyId int64, sourceId int64, objectType int) (exits bool, err error)
}

var _ IChanceFavoriteRepository = (*ChanceFavoriteRepository)(nil)

type ChanceFavoriteRepository struct{}

func (r *ChanceFavoriteRepository) GetChanceFavorites(userId, companyId int64, objectType, chanceType int, lastId int64, pageSize int) (v []*models.ChanceFavorite, total int, err error) {
	return models.GetChanceFavorites(userId, companyId, objectType, chanceType, lastId, pageSize)
}
func (r *ChanceFavoriteRepository) ExitsChanceFavorite(userId, companyId int64, sourceId int64, objectType int) (exits bool, err error) {
	return models.ExitsChanceFavorite(userId, companyId, sourceId, objectType)
}