From a6b67282f3238b954075894c11611ddaf0390144 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Tue, 14 Feb 2023 15:57:22 +0800 Subject: [PATCH] 1 --- doc/Emoji.py | 3 ++- webapp/bootstrap/constant.php | 1 + webapp/controller/EmojiController.class.php | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/Emoji.py b/doc/Emoji.py index ff0bd6c6..d120d16f 100644 --- a/doc/Emoji.py +++ b/doc/Emoji.py @@ -14,7 +14,8 @@ class Emoji(object): ], 'response': [ _common.RspHead(), - ['!data', [_common.Emoji()], '表情列表'] + ['!data', [_common.Emoji()], '表情列表'], + ['!use_emoji', [], '已选择的表情列表'], ] },{ 'name': 'setEmoji', diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 3bdbd521..5fa3a7a3 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -95,3 +95,4 @@ const kWantedLockType = 3; const kMaxHeroUpLevelNum = 2; const kMaxHeroUpQualityNum = 2; +const kMaxEmojiNum = 6; diff --git a/webapp/controller/EmojiController.class.php b/webapp/controller/EmojiController.class.php index 611a6d0e..425a9f38 100644 --- a/webapp/controller/EmojiController.class.php +++ b/webapp/controller/EmojiController.class.php @@ -26,7 +26,8 @@ class EmojiController extends BaseAuthedController } } $this->_rspData(array( - 'data' => $data + 'data' => $data, + 'use_emoji' => $uses )); } @@ -41,7 +42,7 @@ class EmojiController extends BaseAuthedController $this->_rspErr(1, 'The emoji has been used'); return; } - if(count($uses) >= 6){ + if(count($uses) >= kMaxEmojiNum){ $this->_rspErr(1, 'To maximize'); return; }