-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e113a70
commit 038ff11
Showing
11 changed files
with
140 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
) | ||
|
||
type OriginateReq struct { | ||
rpBase | ||
Caller string `json:"Caller" alias:"Caller"` | ||
Called string `json:"DestNumber" alias:"DestNumber"` | ||
CalledDisplay string `json:"SpNumber" alias:"SpNumber"` | ||
AgentId string `json:"AgentId" alias:"AgentId"` | ||
AppId string `json:"app_id" alias:"app_id"` | ||
} | ||
|
||
func newOriginate(rpb rpBase, params map[string]interface{}) (retRp *OriginateReq, retErr error) { | ||
defer func() { | ||
if r := recover(); r != nil { | ||
fmt.Errorf("recover: %+v", r) | ||
retErr = fmt.Errorf("recover : %+v", r) | ||
retRp = nil | ||
} | ||
}() | ||
rp := OriginateReq{ | ||
rpBase: rpb, | ||
AgentId: params["agent_id"].(string), | ||
CalledDisplay: params["called_display"].(string), | ||
Called: params["called"].(string), | ||
Caller: params["caller"].(string), | ||
AppId: params["app_id"].(string), | ||
} | ||
return &rp, nil | ||
} | ||
|
||
// GetPayload : 返回需要发送的字符串 | ||
func (rp *OriginateReq) GetPayload() ([]byte, error) { | ||
return json.Marshal(rp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
) | ||
|
||
// SetStateReq 登录请求 | ||
type SetStateReq struct { | ||
rpBase | ||
AgentId string `json:"agent_id,omitempty"` | ||
AppID string `json:"app_id,omitempty"` | ||
State string `json:"state,omitempty"` | ||
Token string `json:"token"` | ||
} | ||
|
||
func newSetState(rpb rpBase, params map[string]interface{}) (retRp *SetStateReq, retErr error) { | ||
defer func() { | ||
if r := recover(); r != nil { | ||
fmt.Errorf("recover: %+v", r) | ||
retErr = fmt.Errorf("recover : %+v", r) | ||
retRp = nil | ||
} | ||
}() | ||
rp := SetStateReq{ | ||
rpBase: rpb, | ||
AgentId: params["agent_id"].(string), | ||
AppID: params["app_id"].(string), | ||
State: params["state"].(string), | ||
Token: params["token"].(string), | ||
} | ||
return &rp, nil | ||
} | ||
|
||
// GetPayload : 返回需要发送的字符串 | ||
func (rp *SetStateReq) GetPayload() ([]byte, error) { | ||
return json.Marshal(rp) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.