Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-queue-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a764050e
authored
Jan 02, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整json
parent
3808dcb6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
logs/orderSendPurchaseEmail.log
order/sendPurchaseEmail/sendEmail/sendEmail.go
logs/orderSendPurchaseEmail.log
View file @
a764050e
This diff is collapsed.
Click to expand it.
order/sendPurchaseEmail/sendEmail/sendEmail.go
View file @
a764050e
...
...
@@ -11,8 +11,8 @@ import (
)
type
JosnResp
struct
{
err_code
string
`json:"err_code"`
msg
string
`json:"msg"`
Errcode
int
`json:"err_code"`
Err
msg
string
`json:"msg"`
}
func
SendPurchaseEmail
(
data
string
)
(
err
error
)
{
...
...
@@ -20,9 +20,7 @@ func SendPurchaseEmail(data string) (err error) {
client
:=
&
http
.
Client
{}
byte
,
_
:=
json
.
Marshal
(
data
)
req
,
_
:=
http
.
NewRequest
(
"POST"
,
crm_url
,
strings
.
NewReader
(
string
(
byte
)))
req
,
_
:=
http
.
NewRequest
(
"POST"
,
crm_url
,
strings
.
NewReader
(
string
(
data
)))
req
.
Header
.
Set
(
"api-key"
,
"crm a1b2c3d4e5f6g7h8i9jk"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/json"
)
...
...
@@ -36,10 +34,10 @@ func SendPurchaseEmail(data string) (err error) {
}
body
,
_
:=
ioutil
.
ReadAll
(
resp
.
Body
)
fmt
.
Println
(
string
(
body
))
res
:=
&
JosnResp
{}
err1
:=
json
.
Unmarshal
(
body
,
res
)
res
:=
JosnResp
{}
err1
:=
json
.
Unmarshal
([]
byte
(
body
),
&
res
)
if
err1
!=
nil
{
fmt
.
Println
(
err1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment