資源簡介
在線會議室預定,使用php+MySQL實現,能滿足簡單的會議室預定功能
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Net;
using?System.IO;
namespace?PhalApiClientSDK
{
????/**
?????*?PhalApi客戶端SDK包(JAVA版)
?????*
?????*?-?以接口查詢語言(ASQL)的方式來實現接口請求
?????*?-?出于簡明客戶端,將全部的類都歸于同一個文件,避免過多的加載
?????*?
?????*?
使用示例:
?????‘‘‘
?????*?PhalApiClientResponse?response?=?PhalApiClient.create()
?????*???.withHost(“http://demo.phalapi.net/“)
?????*???.withService(“Default.Index“)
?????*???.withparamsList(“name“?“dogstar“)
?????*???.withTimeout(3000)
?????*???.request();
?????*
?????*?Log.v(“response?ret“?response.getRet()?+?““);
?????*?Log.v(“response?data“?response.getData());
?????*?Log.v(“response?msg“?response.getMsg());
????‘‘‘
????????*
????????*?@package?????PhalApi\Response
????????*?@license?????http://www.phalapi.net/license?GPL?協議
????????*?@link????????http://www.phalapi.net/
????????*?@author??????dogstar??2015-10-16
?????*/
????public?class?PhalApiClient?{
????????protected?String?host;
????????protected?PhalApiClientFilter?filter;
????????protected?PhalApiClientParser?parser;
????????protected?String?service;
????????protected?int?timeoutMs;
????????protected?Dictionary?paramsList;
????????/**
?????????*?創建一個接口實例,注意:不是單例模式
?????????*?@return?PhalApiClient
?????????*/
????????public?static?PhalApiClient?create()?{
????????????return?new?PhalApiClient();
????????}
????????protected?PhalApiClient()?{
???? ????this.host?=?““;
????????????this.parser?=?new?PhalApiClientParserJson();
????????????this.reset();
????????}
????????/**
?????????*?設置接口域名
?????????*?@param?String?host
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withHost(String?host)?{
????????????this.host?=?host;
????????????return?this;
????????}
????????/**
?????????*?設置過濾器,與服務器的DI().filter對應
?????????*?@param?PhalApiClientFilter?filter?過濾器
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withFilter(PhalApiClientFilter?filter)?{
????????????this.filter?=?filter;
????????????return?this;
????????}
????????/**
?????????*?設置結果解析器,僅當不是JSON返回格式時才需要設置
?????????*?@param?PhalApiClientParser?parser?結果解析器
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withParser(PhalApiClientParser?parser)?{
????????????this.parser?=?parser;
????????????return?this;
????????}
????????/**
?????????*?重置,將接口服務名稱、接口參數、請求超時進行重置,便于重復請求
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?reset()?{
????????????this.service?=?““;
????????????this.timeoutMs?=?3000;
????????????this.paramsList?=?new?Dictionary();
????????
????????????return?this;
????????}
????????/**
?????????*?設置將在調用的接口服務名稱,如:Default.Index
?????????*?@param?String?service?接口服務名稱
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withService(String?service)?{
????????????this.service?=?service;
????????????return?this;
????????}
????????/**
?????????*?設置接口參數,此方法是唯一一個可以多次調用并累加參數的操作
?????????*?@pa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\
?????文件?????????165??2017-08-27?04:28??Phalapi_MRBS-master\.gitignore
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Book\
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Book\Api\
?????文件????????5193??2017-08-27?04:28??Phalapi_MRBS-master\Book\Api\Book.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Book\Domain\
?????文件????????1947??2017-08-27?04:28??Phalapi_MRBS-master\Book\Domain\Book.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Book\Model\
?????文件????????2834??2017-08-27?04:28??Phalapi_MRBS-master\Book\Model\Book.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Config\
?????文件?????????242??2017-08-27?04:28??Phalapi_MRBS-master\Config\app.php
?????文件????????1707??2017-08-27?04:28??Phalapi_MRBS-master\Config\dbs.php
?????文件?????????397??2017-08-27?04:28??Phalapi_MRBS-master\Config\sys.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Data\
?????文件?????????255??2017-08-27?04:28??Phalapi_MRBS-master\Data\phalapi_test.sql
?????文件??????????62??2017-08-27?04:28??Phalapi_MRBS-master\Data\user.sql
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Api\
?????文件?????????819??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Api\Default.php
?????文件????????2011??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Api\User.php
?????文件?????????248??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Api\Welcome.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Domain\
?????文件?????????694??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Domain\User.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Model\
?????文件?????????589??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Model\User.php
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\ModelProxy\
?????文件?????????386??2017-08-27?04:28??Phalapi_MRBS-master\Demo\ModelProxy\Userba
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Tests\
?????目錄???????????0??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Tests\Api\
?????文件????????1311??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Tests\Api\Api_Default_Test.php
?????文件????????1978??2017-08-27?04:28??Phalapi_MRBS-master\Demo\Tests\Api\Api_User_Test.php
............此處省略395個文件信息
評論
共有 條評論