66 * Time: 6:12 PM
77 */
88
9- class Api_Friend_ApplyListController extends BaseController
9+ class Api_Friend_ApplyListController extends BaseController
1010{
11- private $ classNameForRequest = '\Zaly\Proto\Site\ApiFriendApplyListRequest ' ;
11+ private $ classNameForRequest = '\Zaly\Proto\Site\ApiFriendApplyListRequest ' ;
1212 private $ classNameForResponse = '\Zaly\Proto\Site\ApiFriendApplyListResponse ' ;
1313
1414 public function rpcRequestClassName ()
@@ -23,24 +23,25 @@ public function rpcRequestClassName()
2323 public function rpc (\Google \Protobuf \Internal \Message $ request , \Google \Protobuf \Internal \Message $ transportData )
2424 {
2525 ///处理request,
26- $ tag = __CLASS__ .'- ' . __FUNCTION__ ;
27- try {
26+ $ tag = __CLASS__ . '- ' . __FUNCTION__ ;
27+ try {
2828 $ offset = $ request ->getOffset () ? $ request ->getOffset () : 0 ;
29- $ count = $ request ->getCount () && $ request ->getCount ()< $ this ->defaultPageSize ? $ request ->getCount () : $ this ->defaultPageSize ;
29+ $ count = $ request ->getCount () && $ request ->getCount () < $ this ->defaultPageSize ? $ request ->getCount () : $ this ->defaultPageSize ;
3030 $ list = $ this ->getApplyList ($ offset , $ count );
3131 $ totalCount = $ this ->getApplyListCount ();
3232 $ response = $ this ->getApiFriendApplyListResponse ($ list , $ totalCount );
3333 $ this ->setRpcError ($ this ->defaultErrorCode , "" );
3434 $ this ->rpcReturn ($ transportData ->getAction (), $ response );
35- }catch (Exception $ ex ) {
36- $ this ->ctx ->Wpf_Logger ->error ($ tag , "error_msg= " .$ ex ->getMessage ());
35+ } catch (Exception $ ex ) {
36+ $ this ->ctx ->Wpf_Logger ->error ($ tag , "error_msg= " . $ ex ->getMessage ());
37+ $ this ->setRpcError ("error.alert " , $ ex ->getMessage ());
3738 $ this ->rpcReturn ($ transportData ->getAction (), new $ this ->classNameForResponse ());
3839 }
3940 }
4041
4142 private function getApplyList ($ offset , $ count )
4243 {
43- $ list = $ this ->ctx ->SiteFriendApplyTable ->getApplyList ( $ this ->userId , $ offset , $ count );
44+ $ list = $ this ->ctx ->SiteFriendApplyTable ->getApplyList ($ this ->userId , $ offset , $ count );
4445 return $ list ;
4546 }
4647
@@ -55,7 +56,7 @@ private function getApiFriendApplyListResponse($list, $count)
5556 $ response = new \Zaly \Proto \Site \ApiFriendApplyListResponse ();
5657 $ applyUserProfileList = [];
5758
58- if ($ list ) {
59+ if ($ list ) {
5960 foreach ($ list as $ user ) {
6061 $ publicUser = $ this ->getPublicUserProfile ($ user );
6162 $ applyUserProfile = new \Zaly \Proto \Core \ApplyUserProfile ();
0 commit comments