feat: site count

This commit is contained in:
ferdiansyah783
2024-07-27 15:26:00 +07:00
parent dfed117d90
commit 4013b12ac9
8 changed files with 94 additions and 6 deletions
+26 -4
View File
@@ -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 = &currentTime
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,
}
}