<?php
/**
 * 礼物相关
 */
defined( 'IN_WEB') or die( 'Include Error!');
class Gift{

    /**
     *	礼物商城
     */
    public function mall($param)
    {
        $type = oo::functions()->uint($param['type']);
        //$data = oo::commonOprModel('gift')->getMall($type);
        $data = ['code' => -1, 'msg' => 'api not exists'];
        return json_encode($data);
    }

    /**
     * 设置礼物
     * @return string
     */
    public function set($param){
        $data = array('code' => -1);
        $uid = oo::functions()->uint($param['uid']);
        $gid = oo::functions()->uint($param['gid']);
        if (!$uid || !$gid) {
            return json_encode($data);
        }
        //$ret = oo::commonOprModel('gift')->setGift($uid, $gid);
        //$data['code'] = $ret;
        $data = ['code' => -1, 'msg' => 'api not exists'];
        return json_encode($data);
    }

    /**
     * 拉取自己的礼物列表
     */
    public function listFunction($param){
        $data = array( 'code' => -1, 'list' => array() );
        $uid = oo::functions()->uint($param['uid']);

        if ( empty($uid) ) {
            return json_encode($data);
        }
      	//oo::commonOprRedis('common')->delete("sendPropToFriends:{$uid}");
        //$data   = oo::commonOprModel('gift')->getUserGiftList($uid);
        $data = ['code' => -1, 'msg' => 'api not exists'];
        return json_encode($data,JSON_NUMERIC_CHECK);
    }
}
