```
/**
 * 申请 towerpro key
 */
public function keyAction(){
    $appid      = "test9_appid";
    $env        = 0;
    $version    = "124441";
    $os         = 1;
    $creator    = "subway";
    $keyTag     = "test";

    $res = Towerpro::create($appid, $env, $version, $os, $creator, $keyTag, $note=null);
    $data = [
        "keyInfo"   => null,
        'data'      => null
    ];
    if($res && isset($res["result"]) && $res["result"]){
        if (isset($res["result"]["data"])){
            $data["data"] = $res["result"]["data"];
            unset($res["result"]["data"]);
        }
        $data["keyInfo"] = $res["result"];
    }

    echo json_encode($res);
    return;
}


/**
 * 用 key 配置信息
 */
public function setAction(){
    $res = Towerpro::set("df436947f7e0d4ad7cc4a9cefdc0a708",[
    ]);
    if($res["code"] == 0){
        $this->success();
        return;
    }
    echo json_encode($res);
    return;
}

/**
 * 用 key 获取信息
 */
public function getAction(){
    $res = Towerpro::get("df436947f7e0d4ad7cc4a9cefdc0a708", 1);
    echo json_encode($res);
    return;
}
```