-
Notifications
You must be signed in to change notification settings - Fork 0
/
marketDataJob.go
46 lines (40 loc) · 1.29 KB
/
marketDataJob.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package marketdatajob
import (
"database/sql/driver"
"encoding/json"
"errors"
"time"
)
// Asset
type MarketDataJob struct {
MarketDataID *int `json:"marketDataId"`
JobID *int `json:"jobId"`
UUID string `json:"uuid"`
Name string `json:"name"`
AlternateName string `json:"alternateName"`
StartDate time.Time `json:"startDate"`
EndDate time.Time `json:"endDate"`
Description string `json:"description"`
StatusID *int `json:"statusId"`
ResponseStatus string `json:"responseStatus"`
RequestUrl string `json:"requestUrl"`
RequestBody string `json:"requestBody"`
RequestMethod string `json:"requestMethod"`
ResponseData string `json:"responseData"`
ResponseDataJson Attrs `json:"responseDataJson"`
CreatedBy string `json:"createdBy"`
CreatedAt time.Time `json:"createdAt"`
UpdatedBy string `json:"updatedBy"`
UpdatedAt time.Time `json:"updatedAt"`
}
type Attrs map[string]interface{}
func (a Attrs) Value() (driver.Value, error) {
return json.Marshal(a)
}
func (a *Attrs) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return errors.New("type assertion to []byte failed")
}
return json.Unmarshal(b, &a)
}