mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-02-28 05:02:59 +00:00
23 lines
431 B
Go
23 lines
431 B
Go
|
|
package service
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/mhsanaei/3x-ui/v2/database"
|
||
|
|
"github.com/mhsanaei/3x-ui/v2/database/model"
|
||
|
|
)
|
||
|
|
|
||
|
|
type ReportService interface {
|
||
|
|
SaveReport(report *model.ConnectionReport) error
|
||
|
|
}
|
||
|
|
|
||
|
|
type reportService struct {
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewReportService() ReportService {
|
||
|
|
return &reportService{}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *reportService) SaveReport(report *model.ConnectionReport) error {
|
||
|
|
db := database.GetDB()
|
||
|
|
return db.Save(report).Error
|
||
|
|
}
|