refactor(msdk): 将 ts 和 sign 字段名改为大写 Ts 和 Sign
This commit is contained in:
parent
84c58c3756
commit
063071bed0
@ -17,15 +17,15 @@ type UpdateAdjustIdRequest struct {
|
|||||||
RegTime int64 `position:"Body" field:"reg_time" default:"0"`
|
RegTime int64 `position:"Body" field:"reg_time" default:"0"`
|
||||||
Os string `position:"Body" field:"os" default:""`
|
Os string `position:"Body" field:"os" default:""`
|
||||||
AdjustId string `position:"Body" field:"adjust_id" default:""`
|
AdjustId string `position:"Body" field:"adjust_id" default:""`
|
||||||
ts int64 `position:"Body" field:"ts" default:"0"`
|
Ts int64 `position:"Body" field:"ts" default:"0"`
|
||||||
sign string `position:"Body" field:"sign" default:""`
|
Sign string `position:"Body" field:"sign" default:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UpdateAdjustIdRequest) MakeSign() {
|
func (u *UpdateAdjustIdRequest) MakeSign() {
|
||||||
u.ts = time.Now().Unix()
|
u.Ts = time.Now().Unix()
|
||||||
rawStr := fmt.Sprintf("%d%s%s%d%s", u.GameId, u.LongId, u.Username, u.ts, KEY)
|
rawStr := fmt.Sprintf("%d%s%s%d%s", u.GameId, u.LongId, u.Username, u.Ts, KEY)
|
||||||
sign := md5.Sum([]byte(rawStr))
|
sign := md5.Sum([]byte(rawStr))
|
||||||
u.sign = fmt.Sprintf("%x", sign)
|
u.Sign = fmt.Sprintf("%x", sign)
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateAdjustIdResponse struct {
|
type UpdateAdjustIdResponse struct {
|
||||||
@ -38,7 +38,7 @@ func CreateUpdateAdjustIdRequest() (req *UpdateAdjustIdRequest) {
|
|||||||
req = &UpdateAdjustIdRequest{
|
req = &UpdateAdjustIdRequest{
|
||||||
RpcRequest: &requests.RpcRequest{},
|
RpcRequest: &requests.RpcRequest{},
|
||||||
}
|
}
|
||||||
req.ts = time.Now().Unix()
|
req.Ts = time.Now().Unix()
|
||||||
req.InitWithApiInfo(Host, VERSION, "/updateAdjustId.php")
|
req.InitWithApiInfo(Host, VERSION, "/updateAdjustId.php")
|
||||||
req.Method = requests.POST
|
req.Method = requests.POST
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user