12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace mini\sdk\controller;
- use huomp\controller\share\QrCodeOut;
- use huomp\controller\share\ShareOut;
- use mini\common\controller\V2ApiBaseController;
- use think\Log;
- class ShareController extends V2ApiBaseController {
- public function _initialize() {
- parent::_initialize();
- }
-
- public function getInfo() {
- $this->checkLogin();
- $_game_rq = $this->setGameData();
- $_device_rq = $this->setDeviceData();
- $_path = $this->request->param('path/s', '');
- $_rdata = (new ShareOut())->getShareInfo($this->mem_id, $_game_rq->getHAppId(), $_path, $_device_rq);
- $this->returnData($_rdata);
- }
-
- public function add() {
- $_share_id = get_val($this->rq_data, 'share_id', 0);
- $_to_target = get_val($this->rq_data, 'to_target', '');
- $_more = get_val($this->rq_data, 'more', '');
- $_rdata = (new ShareOut())->upShare($_share_id, $_to_target, $_more);
- $this->returnData($_rdata);
- }
-
- public function getQrCode() {
- $_game_rq = $this->setGameData();
- $_path = get_val($this->rq_data, 'path', '');
- $_width = get_val($this->rq_data, 'width', 430);
- $_a_color = get_val($this->rq_data, 'auto_color', 1);
- $_line_color = get_val($this->rq_data, 'line_color', '{"r":"0","g":"0","b":"0"}');
- $_hyaline = get_val($this->rq_data, 'is_hyaline', 1);
- $_auto_color = false;
- $_is_hyaline = false;
- if (2 == $_a_color) {
- $_auto_color = true;
- }
- if (2 == $_hyaline) {
- $_is_hyaline = true;
- }
- $_rdata = (new QrCodeOut())->getQrCode(
- $this->mem_id, $_game_rq->getHAppId(), $_path, $_width, $_auto_color, $_line_color, $_is_hyaline
- );
- $this->returnData($_rdata);
- }
- }
|