Compare commits
	
		
			6 Commits
		
	
	
		
			c753415404
			...
			c81fa6be2c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					c81fa6be2c | ||
| 
						 | 
					07bdfcb7b3 | ||
| 
						 | 
					353e07b984 | ||
| 
						 | 
					743883792d | ||
| 
						 | 
					ab3c9f33d0 | ||
| 
						 | 
					90c2b1213a | 
@ -116,5 +116,6 @@ func Unmarshal(response AcsResponse, httpResponse *http.Response, format string)
 | 
				
			|||||||
			return errors.New("json Unmarshal:" + err.Error())
 | 
								return errors.New("json Unmarshal:" + err.Error())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -154,3 +154,9 @@ func (client *Client) ClearHotFaqCache(req *ClearHotFaqCacheRequest) (resp *Clea
 | 
				
			|||||||
	err = client.DoAction(req, resp)
 | 
						err = client.DoAction(req, resp)
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (client *Client) GetLinkGameConfig(req *GetLinkGameConfigRequest) (resp *GetLinkGameConfigResponse, err error) {
 | 
				
			||||||
 | 
						resp = CreateGetLinkGameConfigResponse()
 | 
				
			||||||
 | 
						err = client.DoAction(req, resp)
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -456,3 +456,23 @@ func TestClearHotFaqCache(t *testing.T) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	fmt.Printf(fmt.Sprintf("%v", res))
 | 
						fmt.Printf(fmt.Sprintf("%v", res))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获取人工客服链接,主体与游戏参数配置详情
 | 
				
			||||||
 | 
					func TestGetLinkGameConfigDetail(t *testing.T) {
 | 
				
			||||||
 | 
						client, newErr := NewClient()
 | 
				
			||||||
 | 
						if newErr != nil {
 | 
				
			||||||
 | 
							panic(newErr)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						req := CreateGetLinkGameConfigRequest(LinkGameConfigRequest{
 | 
				
			||||||
 | 
							Company: "JJW",
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						res, err := client.GetLinkGameConfig(req)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Error(err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if res.Code != 0 || res.Data.SubjectSign == "" {
 | 
				
			||||||
 | 
							t.Error("获取人工客服链接,主体与游戏参数配置详情失败")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						fmt.Printf(fmt.Sprintf("%v", res.Data))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										45
									
								
								services/cs/config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								services/cs/config.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
				
			|||||||
 | 
					package cs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
 | 
				
			||||||
 | 
						"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 中旭人工客服链接,主体与游戏配置
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type LinkGameConfig struct {
 | 
				
			||||||
 | 
						SubjectSign string `json:"subject_sign"`
 | 
				
			||||||
 | 
						SubjectName string `json:"subject_name"`
 | 
				
			||||||
 | 
						LinkGameId  int64  `json:"link_game_id"`
 | 
				
			||||||
 | 
						CreatedAt   string `json:"created_at"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					type GetLinkGameConfigRequest struct {
 | 
				
			||||||
 | 
						*requests.JsonRequest
 | 
				
			||||||
 | 
						Company string `position:"Json" field:"company"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					type GetLinkGameConfigResponse struct {
 | 
				
			||||||
 | 
						*responses.BaseResponse
 | 
				
			||||||
 | 
						Code int             `json:"code"`
 | 
				
			||||||
 | 
						Msg  string          `json:"msg"`
 | 
				
			||||||
 | 
						Data *LinkGameConfig `json:"data"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					type LinkGameConfigRequest struct {
 | 
				
			||||||
 | 
						Company string `json:"company"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func CreateGetLinkGameConfigRequest(param LinkGameConfigRequest) (req *GetLinkGameConfigRequest) {
 | 
				
			||||||
 | 
						req = &GetLinkGameConfigRequest{
 | 
				
			||||||
 | 
							JsonRequest: &requests.JsonRequest{},
 | 
				
			||||||
 | 
							Company:     param.Company,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						req.InitWithApiInfo(HOST, VERSION, "/v1/config/get_link_game_config")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req.Method = requests.POST
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func CreateGetLinkGameConfigResponse() (response *GetLinkGameConfigResponse) {
 | 
				
			||||||
 | 
						response = &GetLinkGameConfigResponse{
 | 
				
			||||||
 | 
							BaseResponse: &responses.BaseResponse{},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -93,6 +93,8 @@ func CreateGetFaqDetailResponse() (response *GetFaqDetailResponse) {
 | 
				
			|||||||
type HotFaq struct {
 | 
					type HotFaq struct {
 | 
				
			||||||
	Id          int64  `json:"id"`
 | 
						Id          int64  `json:"id"`
 | 
				
			||||||
	Title       string `json:"title"`
 | 
						Title       string `json:"title"`
 | 
				
			||||||
 | 
						ParentId    int64  `json:"parent_id"`
 | 
				
			||||||
 | 
						ParentTitle string `json:"parent_title"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
type GetHotFaqRequest struct {
 | 
					type GetHotFaqRequest struct {
 | 
				
			||||||
	*requests.JsonRequest
 | 
						*requests.JsonRequest
 | 
				
			||||||
 | 
				
			|||||||
@ -63,3 +63,11 @@ func (c *Client) GetUserGameSign(req *GetUserGameSignRequest) (response *GetUser
 | 
				
			|||||||
	err = c.DoAction(req, response)
 | 
						err = c.DoAction(req, response)
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ChangePassword
 | 
				
			||||||
 | 
					// 用户修改密码
 | 
				
			||||||
 | 
					func (c *Client) ChangePassword(req *ChangePasswordRequest) (response *ChangePasswordResponse, err error) {
 | 
				
			||||||
 | 
						response = CreateChangePasswordResponse()
 | 
				
			||||||
 | 
						err = c.DoAction(req, response)
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -78,3 +78,19 @@ func TestGetUserGameSign(t *testing.T) {
 | 
				
			|||||||
	t.Logf("resp code:%+v", resp.Code)
 | 
						t.Logf("resp code:%+v", resp.Code)
 | 
				
			||||||
	t.Logf("resp data:%+v", resp.Data)
 | 
						t.Logf("resp data:%+v", resp.Data)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 测试用户修改密码
 | 
				
			||||||
 | 
					func TestChangePassword(t *testing.T) {
 | 
				
			||||||
 | 
						client, err := NewClient()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Error(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						req := CreateChangePasswordRequest("rz35990497", "7654321")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						resp, err := client.ChangePassword(req)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Error(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						// 记录文本结果
 | 
				
			||||||
 | 
						t.Logf("resp code:%+v, msg:%s", resp.Code, resp.Msg)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										43
									
								
								services/passport/getpwd.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								services/passport/getpwd.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					package passport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
 | 
				
			||||||
 | 
						"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type ChangePasswordRequest struct {
 | 
				
			||||||
 | 
						*requests.RpcRequest
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func CreateChangePasswordRequest(userName string, newPwd string) (req *ChangePasswordRequest) {
 | 
				
			||||||
 | 
						ts, sign := GetSign()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req = &ChangePasswordRequest{
 | 
				
			||||||
 | 
							RpcRequest: &requests.RpcRequest{},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
 | 
				
			||||||
 | 
						req.FormParams = map[string]string{
 | 
				
			||||||
 | 
							"act":      "getpwd",
 | 
				
			||||||
 | 
							"do":       "passwd",
 | 
				
			||||||
 | 
							"username": userName,
 | 
				
			||||||
 | 
							"newpwd":   newPwd,
 | 
				
			||||||
 | 
							"time":     fmt.Sprintf("%v", ts),
 | 
				
			||||||
 | 
							"sign":     sign,
 | 
				
			||||||
 | 
							"format":   "json",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						req.Method = requests.POST
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func CreateChangePasswordResponse() (response *ChangePasswordResponse) {
 | 
				
			||||||
 | 
						response = &ChangePasswordResponse{
 | 
				
			||||||
 | 
							BaseResponse: &responses.BaseResponse{},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type ChangePasswordResponse struct {
 | 
				
			||||||
 | 
						*responses.BaseResponse
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user