資源簡(jiǎn)介
在線會(huì)議室預(yù)定,使用php+MySQL實(shí)現(xiàn),能滿足簡(jiǎn)單的會(huì)議室預(yù)定功能
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Net;
using?System.IO;
namespace?PhalApiClientSDK
{
????/**
?????*?PhalApi客戶端SDK包(JAVA版)
?????*
?????*?-?以接口查詢語(yǔ)言(ASQL)的方式來(lái)實(shí)現(xiàn)接口請(qǐng)求
?????*?-?出于簡(jiǎn)明客戶端,將全部的類(lèi)都?xì)w于同一個(gè)文件,避免過(guò)多的加載
?????*?
?????*?
使用示例:
?????‘‘‘
?????*?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?協(xié)議
????????*?@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;
????????/**
?????????*?創(chuàng)建一個(gè)接口實(shí)例,注意:不是單例模式
?????????*?@return?PhalApiClient
?????????*/
????????public?static?PhalApiClient?create()?{
????????????return?new?PhalApiClient();
????????}
????????protected?PhalApiClient()?{
???? ????this.host?=?““;
????????????this.parser?=?new?PhalApiClientParserJson();
????????????this.reset();
????????}
????????/**
?????????*?設(shè)置接口域名
?????????*?@param?String?host
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withHost(String?host)?{
????????????this.host?=?host;
????????????return?this;
????????}
????????/**
?????????*?設(shè)置過(guò)濾器,與服務(wù)器的DI().filter對(duì)應(yīng)
?????????*?@param?PhalApiClientFilter?filter?過(guò)濾器
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withFilter(PhalApiClientFilter?filter)?{
????????????this.filter?=?filter;
????????????return?this;
????????}
????????/**
?????????*?設(shè)置結(jié)果解析器,僅當(dāng)不是JSON返回格式時(shí)才需要設(shè)置
?????????*?@param?PhalApiClientParser?parser?結(jié)果解析器
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withParser(PhalApiClientParser?parser)?{
????????????this.parser?=?parser;
????????????return?this;
????????}
????????/**
?????????*?重置,將接口服務(wù)名稱(chēng)、接口參數(shù)、請(qǐng)求超時(shí)進(jìn)行重置,便于重復(fù)請(qǐng)求
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?reset()?{
????????????this.service?=?““;
????????????this.timeoutMs?=?3000;
????????????this.paramsList?=?new?Dictionary();
????????
????????????return?this;
????????}
????????/**
?????????*?設(shè)置將在調(diào)用的接口服務(wù)名稱(chēng),如:Default.Index
?????????*?@param?String?service?接口服務(wù)名稱(chēng)
?????????*?@return?PhalApiClient
?????????*/
????????public?PhalApiClient?withService(String?service)?{
????????????this.service?=?service;
????????????return?this;
????????}
????????/**
?????????*?設(shè)置接口參數(shù),此方法是唯一一個(gè)可以多次調(diào)用并累加參數(shù)的操作
?????????*?@pa
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????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個(gè)文件信息
評(píng)論
共有 條評(píng)論