From c77ff819d0b43555f104e48b7ff576162b0697c3 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 25 Sep 2023 15:43:54 +0800 Subject: [PATCH] add avatar --- doc/Avatar.py | 3 +++ webapp/controller/AvatarController.class.php | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/Avatar.py b/doc/Avatar.py index 6e1a6a41..62ef3855 100644 --- a/doc/Avatar.py +++ b/doc/Avatar.py @@ -42,6 +42,7 @@ class Avatar(object): ], 'response': [ _common.RspHead(), + ['property_chg', _common.PropertyChg(), '属性变更'], ] },{ 'name': 'buyAvatar', @@ -66,6 +67,7 @@ class Avatar(object): ], 'response': [ _common.RspHead(), + ['property_chg', _common.PropertyChg(), '属性变更'], ] },{ 'name': 'clearAvatar', @@ -78,6 +80,7 @@ class Avatar(object): ], 'response': [ _common.RspHead(), + ['property_chg', _common.PropertyChg(), '属性变更'], ] }, ] diff --git a/webapp/controller/AvatarController.class.php b/webapp/controller/AvatarController.class.php index 3062a41e..1f873185 100644 --- a/webapp/controller/AvatarController.class.php +++ b/webapp/controller/AvatarController.class.php @@ -74,7 +74,11 @@ class AvatarController extends BaseAuthedController { } Avatar::equipUpdate($avatarDb,$heroUniid); - $this->_rspOk(); + $propertyChgService = new services\PropertyChgService(); + $propertyChgService->addHeroChg(); + $this->_rspData(array( + 'property_chg' => $propertyChgService->toDto(), + )); } public function remove(){ @@ -89,7 +93,11 @@ class AvatarController extends BaseAuthedController { 'status' => 0, 'modifytime' => myself()->_getNowTime(), )); - $this->_rspOk(); + $propertyChgService = new services\PropertyChgService(); + $propertyChgService->addHeroChg(); + $this->_rspData(array( + 'property_chg' => $propertyChgService->toDto(), + )); } public function clearAvatar(){ @@ -111,7 +119,11 @@ class AvatarController extends BaseAuthedController { 'modifytime' => myself()->_getNowTime(), )); } - $this->_rspOk(); + $propertyChgService = new services\PropertyChgService(); + $propertyChgService->addHeroChg(); + $this->_rspData(array( + 'property_chg' => $propertyChgService->toDto(), + )); }