package client import ( "git.sxidc.com/service-supports/dps-sdk/pb/v1/response" "time" ) type EventInfo struct { Key string Version string Operation string Value string CreatorID string CreateTime time.Time } func FormEventInfo(info *response.EventInfo) *EventInfo { if info == nil { return &EventInfo{} } return &EventInfo{ Key: info.Key, Version: info.Version, Operation: info.Operation, Value: info.Value, CreatorID: info.CreatorID, CreateTime: time.UnixMicro(info.CreateTimeUnix).Local(), } } func FormEventInfoBatch(infos []*response.EventInfo) []EventInfo { retInfos := make([]EventInfo, 0) if infos == nil || len(infos) == 0 { return retInfos } for _, info := range infos { retInfos = append(retInfos, *FormEventInfo(info)) } return retInfos }