From cba7e7616a1db26a13343034b730f9b37524a694 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 18 Nov 2021 19:33:03 +0800 Subject: [PATCH] NPlayer merge to NPlayerInfo --- doc/NPlayer.py | 31 ------------------- doc/NPlayerInfo.py | 22 +++++++++++++ webapp/controller/NPlayerController.class.php | 31 ------------------- .../NPlayerInfoController.class.php | 28 +++++++++++++++++ webapp/index.php | 1 + 5 files changed, 51 insertions(+), 62 deletions(-) delete mode 100644 doc/NPlayer.py delete mode 100644 webapp/controller/NPlayerController.class.php diff --git a/doc/NPlayer.py b/doc/NPlayer.py deleted file mode 100644 index 0c46ad5..0000000 --- a/doc/NPlayer.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -import _common - -class NPlayer(object): - - def __init__(self): - self.apis = [ - { - 'desc': 'getGunInfo', - 'group': 'NPlayer', - 'url': 'webapp/index.php?c=NPlayer&a=getGunInfo', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'getPlayerLv', - 'group': 'NPlayer', - 'url': 'webapp/index.php?c=NPlayer&a=getPlayerLv', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - ] diff --git a/doc/NPlayerInfo.py b/doc/NPlayerInfo.py index c55fcab..88516af 100644 --- a/doc/NPlayerInfo.py +++ b/doc/NPlayerInfo.py @@ -61,4 +61,26 @@ class NPlayerInfo(object): _common.RspHead(), ] }, + { + 'desc': 'getGunInfo', + 'group': 'NPlayer', + 'url': 'webapp/index.php?c=NPlayer&a=getGunInfo', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ] + }, + { + 'desc': 'getPlayerLv', + 'group': 'NPlayer', + 'url': 'webapp/index.php?c=NPlayer&a=getPlayerLv', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ] + }, ] diff --git a/webapp/controller/NPlayerController.class.php b/webapp/controller/NPlayerController.class.php deleted file mode 100644 index 936a21d..0000000 --- a/webapp/controller/NPlayerController.class.php +++ /dev/null @@ -1,31 +0,0 @@ -getMysql($account_id); - - // $row = $conn->execQueryOne('SELECT guildcoin_num FROM user WHERE accountid=:accountid;', - // array( - // ':accountid' => $account_id - // )); - $sqlStr = "SELECT * FROM gun_intensify WHERE accountid=:accountid; "; - $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); - - $this->sendDataToClient(0,"test02",$row); - } - public function getPlayerLv() - { - $account_id = $_REQUEST['account_id']; - $conn = $this->getMysql($account_id); - - - $sqlStr = "SELECT lv,lv_exp,money_of_week FROM user WHERE accountid=:accountid; "; - $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); - if($row) { - - } - $this->sendDataToClient(100,"getPlayerLv",$row); - } -} \ No newline at end of file diff --git a/webapp/controller/NPlayerInfoController.class.php b/webapp/controller/NPlayerInfoController.class.php index 32fd834..dbda218 100644 --- a/webapp/controller/NPlayerInfoController.class.php +++ b/webapp/controller/NPlayerInfoController.class.php @@ -229,4 +229,32 @@ class NPlayerInfoController extends BaseAuthedController { // $sqlStr = "SELECT * FROM user WHERE accountid=:accountid; "; // $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); } + public function getGunInfo() + { + $account_id = $_REQUEST['account_id']; + $conn = $this->getMysql($account_id); + + // $row = $conn->execQueryOne('SELECT guildcoin_num FROM user WHERE accountid=:accountid;', + // array( + // ':accountid' => $account_id + // )); + $sqlStr = "SELECT * FROM gun_intensify WHERE accountid=:accountid; "; + $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); + + $this->sendDataToClient(0,"test02",$row); + } + public function getPlayerLv() + { + $account_id = $_REQUEST['account_id']; + $conn = $this->getMysql($account_id); + + + $sqlStr = "SELECT lv,lv_exp,money_of_week FROM user WHERE accountid=:accountid; "; + $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); + if($row) { + + } + $this->sendDataToClient(100,"getPlayerLv",$row); + } + } diff --git a/webapp/index.php b/webapp/index.php index c5f8da5..058b65f 100644 --- a/webapp/index.php +++ b/webapp/index.php @@ -28,6 +28,7 @@ $rewriteRule = array( 'Property' => 'Role', 'NBag' => 'Bag', 'NHero' => 'Hero', + 'NPlayer' => 'NPlayerInfo', ); function getRewriteClass($oldC)