| 123456789101112131415161718192021222324 |
- package service
- import (
- "context"
- "lims_zju/common"
- "lims_zju/model"
- )
- type DeviceStatistics struct{}
- // GetDeviceStatistics 获取实验设备数据使用信息
- func (d *DeviceStatistics) GetDeviceStatistics(ctx context.Context, req *model.BaseModel) (*model.DeviceStatistics, error) {
- list := make([]model.DeviceStatistics, 0)
- err := common.ReadJson(&list, "/home/desdemo/wp/code/lims_zju/common/data1.json")
- if err != nil {
- return nil, err
- }
- for _, v := range list {
- if v.LaboratoryId == req.LaboratoryId {
- return &v, nil
- }
- }
- return nil, nil
- }
|