diff --git a/webapi/deprecated.go b/webapi/deprecated.go index b127e9f..1e7bc89 100644 --- a/webapi/deprecated.go +++ b/webapi/deprecated.go @@ -256,3 +256,21 @@ type PlatfromGameLoginRsp struct { Message string `json:"message"` Success bool `json:"success"` } + +// 上分请求 +type PlatfromUpScoreReq struct { + Username string `json:"username"` + Channel string `json:"channel"` + Timestamp int64 `json:"timestamp"` + Count string `json:"count"` +} + +// 上分返回 +type PlatfromUpScoreRsp struct { + Code int `json:"code"` + Data struct { + Count int64 `json:"count"` + } `json:"data"` + Message string `json:"message"` + Success bool `json:"success"` +} diff --git a/worldsrv/trascate_webapi.go b/worldsrv/trascate_webapi.go index 7e54b5a..427fd72 100644 --- a/worldsrv/trascate_webapi.go +++ b/worldsrv/trascate_webapi.go @@ -2962,6 +2962,152 @@ func init() { return common.ResponseTag_TransactYield, jsonDataRsp })) + WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/platform/upscore", WebAPIHandlerWrapper( + func(tNode *transact.TransNode, params []byte) (int, interface{}) { + + var AccountInfo *webapi.PlatfromCreateAccountReq + err := json.Unmarshal(params, &AccountInfo) + if err != nil { + logger.Logger.Error("Unmarshal webapi.PlatfromCreateAccountReq error:", err) + } + + pack := &webapi.PlatfromGameLoginRsp{ + Success: false, + Code: 200, + Message: "未知错误", + } + + logger.Logger.Tracef("/api/platform/upscore %v", pack) + + var jsonDataRsp []byte + + task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { + pack.Success = true + pack.Message = "返回成功" + + return nil + }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { + + jsonDataRsp, err = json.Marshal(pack) + if err != nil { + logger.Logger.Errorf("/api/platform/createUser err: %v", err) + } + + tNode.TransRep.RetFiels = jsonDataRsp + tNode.Resume() + }), "/api/platform/upscore").Start() + return common.ResponseTag_TransactYield, jsonDataRsp + })) + + WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/platform/downscore", WebAPIHandlerWrapper( + func(tNode *transact.TransNode, params []byte) (int, interface{}) { + + var AccountInfo *webapi.PlatfromCreateAccountReq + err := json.Unmarshal(params, &AccountInfo) + if err != nil { + logger.Logger.Error("Unmarshal webapi.PlatfromCreateAccountReq error:", err) + } + + pack := &webapi.PlatfromGameLoginRsp{ + Success: false, + Code: 200, + Message: "未知错误", + } + + logger.Logger.Tracef("/api/platform/downscore %v", pack) + + var jsonDataRsp []byte + + task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { + + pack.Success = true + pack.Message = "返回成功" + return nil + }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { + + jsonDataRsp, err = json.Marshal(pack) + if err != nil { + logger.Logger.Errorf("/api/platform/downscore err: %v", err) + } + + tNode.TransRep.RetFiels = jsonDataRsp + tNode.Resume() + }), "/api/platform/downscore").Start() + return common.ResponseTag_TransactYield, jsonDataRsp + })) + + WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/platform/getstatus", WebAPIHandlerWrapper( + func(tNode *transact.TransNode, params []byte) (int, interface{}) { + + var AccountInfo *webapi.PlatfromCreateAccountReq + err := json.Unmarshal(params, &AccountInfo) + if err != nil { + logger.Logger.Error("Unmarshal webapi.PlatfromCreateAccountReq error:", err) + } + + pack := &webapi.PlatfromGameLoginRsp{ + Success: false, + Code: 200, + Message: "未知错误", + } + + logger.Logger.Tracef("/api/platform/getstatus %v", pack) + + var jsonDataRsp []byte + task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { + pack.Success = true + pack.Message = "返回成功" + + return nil + }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { + + jsonDataRsp, err = json.Marshal(pack) + if err != nil { + logger.Logger.Errorf("/api/platform/getstatus err: %v", err) + } + + tNode.TransRep.RetFiels = jsonDataRsp + tNode.Resume() + }), "/api/platform/getstatus").Start() + return common.ResponseTag_TransactYield, jsonDataRsp + })) + + WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/platform/getgamedetailed", WebAPIHandlerWrapper( + func(tNode *transact.TransNode, params []byte) (int, interface{}) { + + var AccountInfo *webapi.PlatfromCreateAccountReq + err := json.Unmarshal(params, &AccountInfo) + if err != nil { + logger.Logger.Error("Unmarshal webapi.PlatfromCreateAccountReq error:", err) + } + + pack := &webapi.PlatfromGameLoginRsp{ + Success: false, + Code: 200, + Message: "未知错误", + } + + logger.Logger.Tracef("/api/platform/getgamedetailed %v", pack) + + var jsonDataRsp []byte + task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { + pack.Success = true + pack.Message = "返回成功" + + return nil + }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { + + jsonDataRsp, err = json.Marshal(pack) + if err != nil { + logger.Logger.Errorf("/api/platform/getgamedetailed err: %v", err) + } + + tNode.TransRep.RetFiels = jsonDataRsp + tNode.Resume() + }), "/api/platform/getgamedetailed").Start() + return common.ResponseTag_TransactYield, jsonDataRsp + })) + WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/game/exchange_order", WebAPIHandlerWrapper( func(tNode *transact.TransNode, params []byte) (int, interface{}) { pack := &webapiproto.SAGetExchangeOrder{