(ctx context.Context, serviceId string, start int64, end int64, page int, size int)
| 205 | } |
| 206 | |
| 207 | func (i *imlServiceModule) RestLogs(ctx context.Context, serviceId string, start int64, end int64, page int, size int) ([]*service_dto.RestLogItem, int64, error) { |
| 208 | list, total, err := i.logService.LogRecordsByService(ctx, serviceId, time.Unix(start, 0), time.Unix(end, 0), page, size) |
| 209 | if err != nil { |
| 210 | return nil, 0, err |
| 211 | } |
| 212 | return utils.SliceToSlice(list, func(s *log_service.Item) *service_dto.RestLogItem { |
| 213 | item := &service_dto.RestLogItem{ |
| 214 | Id: s.ID, |
| 215 | API: auto.UUID(s.API), |
| 216 | Status: s.StatusCode, |
| 217 | LogTime: auto.TimeLabel(s.RecordTime), |
| 218 | Ip: s.RemoteIP, |
| 219 | Consumer: auto.UUID(s.Consumer), |
| 220 | ResponseTime: common.FormatTime(s.ResponseTime), |
| 221 | Traffic: common.FormatByte(s.Traffic), |
| 222 | } |
| 223 | if s.Consumer == "apipark-global" { |
| 224 | item.Consumer = auto.Label{ |
| 225 | Id: s.Consumer, |
| 226 | Name: "System Consumer", |
| 227 | } |
| 228 | } |
| 229 | return item |
| 230 | }), total, nil |
| 231 | } |
| 232 | |
| 233 | func (i *imlServiceModule) AILogs(ctx context.Context, serviceId string, start int64, end int64, page int, size int) ([]*service_dto.AILogItem, int64, error) { |
| 234 | list, total, err := i.logService.LogRecordsByService(ctx, serviceId, time.Unix(start, 0), time.Unix(end, 0), page, size) |
nothing calls this directly
no test coverage detected