feat: site count
This commit is contained in:
@@ -28,10 +28,12 @@ type Site struct {
|
||||
}
|
||||
|
||||
type SiteSearch struct {
|
||||
Search string
|
||||
Name string
|
||||
Limit int
|
||||
Offset int
|
||||
PartnerID *int64
|
||||
IsAdmin bool
|
||||
Search string
|
||||
Name string
|
||||
Limit int
|
||||
Offset int
|
||||
}
|
||||
|
||||
type SiteList []*SiteDB
|
||||
@@ -143,3 +145,23 @@ func (o *SiteDB) SetDeleted(updatedBy int64) {
|
||||
o.DeletedAt = ¤tTime
|
||||
o.UpdatedBy = updatedBy
|
||||
}
|
||||
|
||||
type SiteCount struct {
|
||||
Count int `gorm:"type:int;column:count"`
|
||||
}
|
||||
|
||||
type SiteCountDB struct {
|
||||
SiteCount
|
||||
}
|
||||
|
||||
func (b *SiteCount) ToSiteCountDB() *SiteCountDB {
|
||||
return &SiteCountDB{
|
||||
SiteCount: *b,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *SiteCountDB) ToSiteCount() *SiteCount {
|
||||
return &SiteCount{
|
||||
Count: e.Count,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user