ListMedicationLogs

This commit is contained in:
2025-10-18 16:22:59 +08:00
parent 4c6843afb4
commit e150969ee3
4 changed files with 212 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ type MonitorService struct {
pendingCollectionRepo repository.PendingCollectionRepository
userActionLogRepo repository.UserActionLogRepository
rawMaterialRepo repository.RawMaterialRepository
medicationRepo repository.MedicationRepository
// 在这里可以添加其他超表模型的仓库依赖
}
@@ -24,6 +25,7 @@ func NewMonitorService(
pendingCollectionRepo repository.PendingCollectionRepository,
userActionLogRepo repository.UserActionLogRepository,
rawMaterialRepo repository.RawMaterialRepository,
medicationRepo repository.MedicationRepository,
) *MonitorService {
return &MonitorService{
sensorDataRepo: sensorDataRepo,
@@ -32,6 +34,7 @@ func NewMonitorService(
pendingCollectionRepo: pendingCollectionRepo,
userActionLogRepo: userActionLogRepo,
rawMaterialRepo: rawMaterialRepo,
medicationRepo: medicationRepo,
}
}
@@ -79,3 +82,8 @@ func (s *MonitorService) ListRawMaterialStockLogs(opts repository.RawMaterialSto
func (s *MonitorService) ListFeedUsageRecords(opts repository.FeedUsageRecordListOptions, page, pageSize int) ([]models.FeedUsageRecord, int64, error) {
return s.rawMaterialRepo.ListFeedUsageRecords(opts, page, pageSize)
}
// ListMedicationLogs 负责处理查询用药记录列表的业务逻辑
func (s *MonitorService) ListMedicationLogs(opts repository.MedicationLogListOptions, page, pageSize int) ([]models.MedicationLog, int64, error) {
return s.medicationRepo.ListMedicationLogs(opts, page, pageSize)
}