diff --git a/sls/producer_test.go b/sls/producer_test.go index c480592..aac4c85 100644 --- a/sls/producer_test.go +++ b/sls/producer_test.go @@ -32,9 +32,43 @@ func TestProducer(t *testing.T) { HttpTraceId: "0121", XAppId: "LtEolTiV", XUserData: &UserData{ - ID: "1075", + ID: 1075, Username: "用户名_IDdXdk4xSU", - OrganizeID: "223", + OrganizeID: 223, + OrganizeName: "新数据-机构06-权限", + Email: "", + Phone: "17800000051", + }, + XDsmData: &DSMData{ + AppKey: "ce2f8bcc2f64466d", + PageType: "LIST", + DataCount: 1, + DBData: make([]*DBCount, 0), + }, + XCustomData: nil, + ResponseData: nil, + }) + if err != nil { + t.Fail() + } + + err = pd.SendRequestLog(enum.Env_preview, &Request{ + Time: time.Now(), + RemoteAddr: "118.112.98.208", + QueryString: "test001", + RequestMethod: "POST", + RequestUri: "/dc/analyse/senior_aggregation", + Host: "intsynth-server.drugeyes.vip", + RequestBody: "{}", + HttpUserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0", + HttpFinger: "59246b1e1639f4753bcd010bac2ddb01", + HttpReferrer: "http://intsynth-web.drugeyes.vip:7031/", + HttpTraceId: "0121", + XAppId: "LtEolTiV", + XUserData: &UserData{ + ID: 1075, + Username: "用户名_IDdXdk4xSU", + OrganizeID: 223, OrganizeName: "新数据-机构06-权限", Email: "", Phone: "17800000051", diff --git a/sls/types.go b/sls/types.go index 47b4fcd..a1cc7ce 100644 --- a/sls/types.go +++ b/sls/types.go @@ -24,9 +24,9 @@ type Request struct { // UserData 用户数据 type UserData struct { - ID string `json:"id"` // 用户ID + ID int32 `json:"id"` // 用户ID Username string `json:"username"` // 用户名称 - OrganizeID string `json:"organize_id"` // 组织ID + OrganizeID int32 `json:"organize_id"` // 组织ID OrganizeName string `json:"organize_name"` // 组织名称 Phone string `json:"phone"` // 手机号 Email string `json:"email"` // 邮箱