chance.go
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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)
AddChanceFavorite(m *models.ChanceFavorite) (id int64, err error)
UpdateChanceFavorite(userId, companyId int64,sourceId int64,objectType int)error
GetChanceFavorite(userId, companyId int64,sourceId int64,sourceType int)(v *models.ChanceFavorite,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)
}
func (r *ChanceFavoriteRepository) AddChanceFavorite(m *models.ChanceFavorite) (id int64, err error) {
return models.AddChanceFavorite(m)
}
func (r *ChanceFavoriteRepository) UpdateChanceFavorite(userId, companyId int64,sourceId int64,objectType int) error{
return models.UpdateChanceFavorite(userId,companyId,sourceId,objectType)
}
func (r *ChanceFavoriteRepository) GetChanceFavorite(userId, companyId int64,sourceId int64,sourceType int)(v *models.ChanceFavorite,err error){
return models.GetChanceFavorite(userId,companyId,sourceId,sourceType)
}