* @version : HUOSDK 8.0 */ namespace api\wapapp\controller\v8; use api\common\controller\V2ApiBaseController; use huo\controller\posts\ShareAct; use huolib\constant\ShareConst; use huolib\status\CommonStatus; use huolib\status\MemberStatus; class ShareController extends V2ApiBaseController { public function _initialize() { parent::_initialize(); } /** * 分享上报 * http://doc.1tsdk.com/138?page_id=3360 * 【域名】/share/add */ public function add() { $_mem_id = $this->mem_id; if (empty($_mem_id)) { $_code = MemberStatus::NO_ERROR; $this->success(lang(MemberStatus::getMsg($_code)), [], $_code); } $_game_rq = $this->setGameData(); $_channel_rq = $this->setChannelData(); $_device_rq = $this->setDeviceData(); $_mem_rq = $this->setMemData(); $_share_type = $this->request->param('share_type/s', ''); if (empty($_share_type)) { $_code = CommonStatus::INVALID_PARAMS; $this->error(lang(CommonStatus::getMsg($_code)), [], $_code); } if (ShareConst::SHARE_TYPE_POSTS == $_share_type) { $_param = $this->request->param(); $_act_id = $this->request->param('share_id/d', 0); if (empty($_act_id)) { $_code = CommonStatus::INVALID_PARAMS; $this->error(lang(CommonStatus::getMsg($_code)), [], $_code); } //分享成功回调处理 $_rs = (new ShareAct())->callback($_game_rq, $_channel_rq, $_device_rq, $_mem_rq, $_param); return $this->returnData($_rs); } else { // TODO: liuhongliang 2018/5/28 其他分享类型 $_code = MemberStatus::NO_ERROR; $this->success(lang(MemberStatus::getMsg($_code)), [], $_code); } } }