├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── .gitignore ├── DelTemp.bat ├── LICENSE ├── OneClient ├── ClientDemo │ ├── OneCleintDemoAsync.dpr │ ├── OneCleintDemoAsync.dproj │ ├── OneCleintDemoAsync.res │ ├── OneCleintDemoCustTran.dpr │ ├── OneCleintDemoCustTran.dproj │ ├── OneCleintDemoCustTran.res │ ├── OneCleintDemoCustTranB.dpr │ ├── OneCleintDemoCustTranB.dproj │ ├── OneCleintDemoCustTranB.res │ ├── OneCleintDemoCustTranC.dpr │ ├── OneCleintDemoCustTranC.dproj │ ├── OneCleintDemoCustTranC.res │ ├── OneCleintDemoDatas.dpr │ ├── OneCleintDemoDatas.dproj │ ├── OneCleintDemoDatas.res │ ├── OneCleintDemoPostGet.dpr │ ├── OneCleintDemoPostGet.dproj │ ├── OneCleintDemoPostGet.res │ ├── OneClientDemo.dpr │ ├── OneClientDemo.dproj │ ├── OneClientDemo.res │ ├── OneClientDemo.skincfg │ ├── OneClientDemoBillLock.dpr │ ├── OneClientDemoBillLock.dproj │ ├── OneClientDemoBillLock.res │ ├── OneClientDemoFastApi.dpr │ ├── OneClientDemoFastApi.dproj │ ├── OneClientDemoFastApi.res │ ├── OneClientDemoFastApi.skincfg │ ├── OneClientDemoFastFile.dpr │ ├── OneClientDemoFastFile.dproj │ ├── OneClientDemoFastFile.res │ ├── OneClientDemoFastFile.skincfg │ ├── OneClientDemoHttpWaitHint.dpr │ ├── OneClientDemoHttpWaitHint.dproj │ ├── OneClientDemoHttpWaitHint.res │ ├── OneClientDemoHttpWaitHint.skincfg │ ├── OneClientDemoLsh.dpr │ ├── OneClientDemoLsh.dproj │ ├── OneClientDemoLsh.res │ ├── OneClientDemoLsh.skincfg │ ├── OneClientDemoMetaInfo.dpr │ ├── OneClientDemoMetaInfo.dproj │ ├── OneClientDemoMetaInfo.res │ ├── OneClientDemoMetaInfo.skincfg │ ├── OneClientDemoOpenIncCache.dpr │ ├── OneClientDemoOpenIncCache.dproj │ ├── OneClientDemoOpenIncCache.res │ ├── OneClientDemoRefreshSingle.dpr │ ├── OneClientDemoRefreshSingle.dproj │ ├── OneClientDemoRefreshSingle.res │ ├── OneClientDemoRefreshSingle.skincfg │ ├── OneClientDemoSQLToClass.dpr │ ├── OneClientDemoSQLToClass.dproj │ ├── OneClientDemoSQLToClass.res │ ├── OneClientDemoSQLToClass.skincfg │ ├── OneClientDemoScript.dpr │ ├── OneClientDemoScript.dproj │ ├── OneClientDemoScript.res │ ├── OneClientDemoScript.skincfg │ ├── OneClientDemoUUID.dpr │ ├── OneClientDemoUUID.dproj │ ├── OneClientDemoUUID.res │ ├── OneClientDemoUUID.skincfg │ ├── OneClientDemoUpDownChunt.dpr │ ├── OneClientDemoUpDownChunt.dproj │ ├── OneClientDemoUpDownChunt.res │ ├── OneClientDemoUpdate.dpr │ ├── OneClientDemoUpdate.dproj │ ├── OneClientDemoUpdate.res │ ├── OneClientDemoVirtualFile.dpr │ ├── OneClientDemoVirtualFile.dproj │ ├── OneClientDemoVirtualFile.res │ ├── OneClientDemoWebSocket.dpr │ ├── OneClientDemoWebSocket.dproj │ ├── OneClientDemoWebSocket.res │ ├── OneClientDemoWebSocket.skincfg │ ├── OneClientDemoWebSocketChat.dpr │ ├── OneClientDemoWebSocketChat.dproj │ ├── OneClientDemoWebSocketChat.res │ ├── OneClientDemoWebSocketChat.skincfg │ ├── frmDemoAsync.dfm │ ├── frmDemoAsync.pas │ ├── frmDemoBillLock.dfm │ ├── frmDemoBillLock.pas │ ├── frmDemoCustTran.dfm │ ├── frmDemoCustTran.pas │ ├── frmDemoCustTranB.dfm │ ├── frmDemoCustTranB.pas │ ├── frmDemoCustTranC.dfm │ ├── frmDemoCustTranC.pas │ ├── frmDemoDataRefreshSingle.dfm │ ├── frmDemoDataRefreshSingle.pas │ ├── frmDemoDatas.dfm │ ├── frmDemoDatas.pas │ ├── frmDemoFastApi.dfm │ ├── frmDemoFastApi.pas │ ├── frmDemoFastFile.dfm │ ├── frmDemoFastFile.pas │ ├── frmDemoHttpWaitHint.dfm │ ├── frmDemoHttpWaitHint.pas │ ├── frmDemoLsh.dfm │ ├── frmDemoLsh.pas │ ├── frmDemoMain.dfm │ ├── frmDemoMain.pas │ ├── frmDemoMetaInfo.dfm │ ├── frmDemoMetaInfo.pas │ ├── frmDemoOpenIncCache.dfm │ ├── frmDemoOpenIncCache.pas │ ├── frmDemoPostGet.dfm │ ├── frmDemoPostGet.pas │ ├── frmDemoSQLToClass.dfm │ ├── frmDemoSQLToClass.pas │ ├── frmDemoScript.dfm │ ├── frmDemoScript.pas │ ├── frmDemoUUID.dfm │ ├── frmDemoUUID.pas │ ├── frmDemoUpDownChunk.dfm │ ├── frmDemoUpDownChunk.pas │ ├── frmDemoUpdate.dfm │ ├── frmDemoUpdate.pas │ ├── frmDemoVirtualFile.dfm │ ├── frmDemoVirtualFile.pas │ ├── frmDemoWebSocket.dfm │ ├── frmDemoWebSocket.pas │ ├── frmDemoWebSocketChat.dfm │ ├── frmDemoWebSocketChat.pas │ ├── frmWait.dfm │ ├── frmWait.pas │ ├── frm_fastApiReport.dfm │ └── frm_fastApiReport.pas ├── OneClientProjectGroup.groupproj ├── OpenSSLDemo │ ├── FormOpenSSL.dfm │ ├── FormOpenSSL.pas │ ├── OneOpenSSLDemo.dpr │ ├── OneOpenSSLDemo.dproj │ ├── OneOpenSSLDemo.res │ ├── OpenSSL │ │ ├── .gitignore │ │ ├── ssl.inc │ │ ├── ssl_aes.pas │ │ ├── ssl_asn.pas │ │ ├── ssl_bf.pas │ │ ├── ssl_bio.pas │ │ ├── ssl_bn.pas │ │ ├── ssl_buffer.pas │ │ ├── ssl_camellia.pas │ │ ├── ssl_cast.pas │ │ ├── ssl_cmac.pas │ │ ├── ssl_cms.pas │ │ ├── ssl_comp.pas │ │ ├── ssl_conf.pas │ │ ├── ssl_const.pas │ │ ├── ssl_conver.pas │ │ ├── ssl_des.pas │ │ ├── ssl_dh.pas │ │ ├── ssl_dsa.pas │ │ ├── ssl_ec.pas │ │ ├── ssl_ecdh.pas │ │ ├── ssl_ecdsa.pas │ │ ├── ssl_encode.pas │ │ ├── ssl_engine.pas │ │ ├── ssl_err.pas │ │ ├── ssl_evp.pas │ │ ├── ssl_evphis.pas │ │ ├── ssl_evpmdctx.pas │ │ ├── ssl_evppkey.pas │ │ ├── ssl_hmac.pas │ │ ├── ssl_idea.pas │ │ ├── ssl_init.pas │ │ ├── ssl_lhash.pas │ │ ├── ssl_lib.pas │ │ ├── ssl_md4.pas │ │ ├── ssl_md5.pas │ │ ├── ssl_mdc2.pas │ │ ├── ssl_obj_id.pas │ │ ├── ssl_objects.pas │ │ ├── ssl_ocsp.pas │ │ ├── ssl_pem.pas │ │ ├── ssl_pkcs12.pas │ │ ├── ssl_pkcs7.pas │ │ ├── ssl_rand.pas │ │ ├── ssl_rc2.pas │ │ ├── ssl_rc4.pas │ │ ├── ssl_rc5.pas │ │ ├── ssl_ripemd.pas │ │ ├── ssl_rsa.pas │ │ ├── ssl_sha.pas │ │ ├── ssl_sk.pas │ │ ├── ssl_sm2.pas │ │ ├── ssl_sm3.pas │ │ ├── ssl_sm4.pas │ │ ├── ssl_typepointers.pas │ │ ├── ssl_types.pas │ │ ├── ssl_util.pas │ │ └── ssl_x509.pas │ ├── OpenSSLDLL │ │ └── README.txt │ └── 更新即使用说明.txt ├── Package │ ├── Neon.inc │ ├── NeonSerialization │ │ ├── Neon.Core.Attributes.pas │ │ ├── Neon.Core.DynamicTypes.pas │ │ ├── Neon.Core.Nullables.pas │ │ ├── Neon.Core.Persistence.JSON.Schema.pas │ │ ├── Neon.Core.Persistence.JSON.pas │ │ ├── Neon.Core.Persistence.pas │ │ ├── Neon.Core.Serializers.DB.pas │ │ ├── Neon.Core.Serializers.Nullables.pas │ │ ├── Neon.Core.Serializers.RTL.pas │ │ ├── Neon.Core.TypeInfo.pas │ │ ├── Neon.Core.Types.pas │ │ ├── Neon.Core.Utils.pas │ │ ├── Neon.inc │ │ └── OneNeonHelper.pas │ ├── OneClient.dpk │ ├── OneClient.dproj │ ├── OneClient.res │ ├── OneClient.skincfg │ ├── OneClientConnect.pas │ ├── OneClientConst.pas │ ├── OneClientDataSet.pas │ ├── OneClientHelper.pas │ ├── OneClientRegister.pas │ ├── OneClientResult.pas │ ├── OneClientUUID.pas │ ├── OneClientVirtualFile.pas │ ├── OneFast │ │ ├── OneClientFastBillLock.pas │ │ ├── OneClientFastFile.pas │ │ ├── OneClientFastLsh.pas │ │ ├── OneClientFastReport.pas │ │ └── OneClientFastUpdate.pas │ ├── baseLib │ │ ├── OneClientDataInfo.pas │ │ ├── OneCrypto.pas │ │ ├── OneDate.pas │ │ ├── OneFileHelper.pas │ │ ├── OneFunc.pas │ │ ├── OneILog.pas │ │ ├── OneLog.pas │ │ ├── OneSQLCrypto.pas │ │ ├── OneStreamString.pas │ │ └── OneThread.pas │ └── websocket │ │ └── OneWebSocketClient.pas └── 使用前说明.txt ├── OneServer ├── DBCenter │ ├── OneDataInfo.pas │ ├── OneIOrm.pas │ ├── OneOrm.pas │ ├── OneOrmRtti.pas │ └── OneZTManage.pas ├── Neon.inc ├── NeonSerialization │ ├── Neon.Core.Attributes.pas │ ├── Neon.Core.DynamicTypes.pas │ ├── Neon.Core.Nullables.pas │ ├── Neon.Core.Persistence.JSON.Schema.pas │ ├── Neon.Core.Persistence.JSON.pas │ ├── Neon.Core.Persistence.pas │ ├── Neon.Core.Serializers.DB.pas │ ├── Neon.Core.Serializers.Nullables.pas │ ├── Neon.Core.Serializers.RTL.pas │ ├── Neon.Core.Serializers.VCL.pas │ ├── Neon.Core.TypeInfo.pas │ ├── Neon.Core.Types.pas │ ├── Neon.Core.Utils.pas │ ├── Neon.inc │ └── OneNeonHelper.pas ├── One.inc ├── OneCompilerVersion.pas ├── OneFastApi │ ├── OneFastApiController.pas │ ├── OneFastApiDo.pas │ ├── OneFastApiManage.pas │ └── OneFastReportController.pas ├── OneFastBillLock │ ├── OneFastBillLockController.pas │ └── OneFastBillLockManage.pas ├── OneFastCleint │ ├── OneFastAdminController.pas │ ├── OneFastLoginController.pas │ ├── OneFastModuleController.pas │ ├── OneFastModuleManage.pas │ └── OneFastPlatManage.pas ├── OneFastFile │ ├── OneFastFileController.pas │ └── OneFastFileMange.pas ├── OneFastFlow.pas ├── OneFastFlow │ ├── OneFastFlowController.pas │ └── OneFastFlowManage.pas ├── OneFastLsh │ ├── OneFastLshController.pas │ └── OneFastLshManage.pas ├── OneFastUpload │ ├── OneFastUpdateController.pas │ └── OneFastUpdateManage.pas ├── OneFastWeiXin │ ├── WeiXinManage.pas │ ├── WeiXinMinApi.pas │ ├── WeixinAdminController.pas │ ├── WeixinApi.pas │ ├── WeixinApiPublic.pas │ └── WeixinAuthController.pas ├── OneGlobal.pas ├── OneService.dpr ├── OneService.dproj ├── OneService.res ├── OneService.skincfg ├── OneServiceConsole.dpr ├── OneServiceConsole.dproj ├── OneServiceConsole.res ├── OneServiceConsole.skincfg ├── OneUniDemo │ ├── UniBillSendController.pas │ ├── UniClass.pas │ ├── UniFileDownController.pas │ ├── UniGoodsController.pas │ ├── UniLoginController.pas │ └── UniSendReceivController.pas ├── WeixinAdminController.pas ├── basLib │ ├── OneDate.pas │ ├── TokenManage.pas │ ├── attribute │ │ └── OneAttribute.pas │ ├── crypto │ │ ├── OneCrypto.pas │ │ ├── OneSQLCrypto.pas │ │ └── OneStreamString.pas │ ├── func │ │ ├── OneDateTimeHelper.pas │ │ ├── OneFileHelper.pas │ │ ├── OneFunc.pas │ │ └── OneGUID.pas │ ├── logger │ │ ├── OneILog.pas │ │ └── OneLog.pas │ ├── multipart │ │ └── OneMultipart.pas │ ├── rtti │ │ └── OneRttiHelper.pas │ ├── thread │ │ └── OneThread.pas │ ├── token │ │ └── OneTokenManage.pas │ ├── uuid │ │ ├── Contract │ │ │ ├── uIIdGenerator.pas │ │ │ ├── uISnowWorker.pas │ │ │ ├── uIdGeneratorOptions.pas │ │ │ └── uTOverCostActionArg.pas │ │ ├── Core │ │ │ ├── uSnowWorkerM1.pas │ │ │ ├── uSnowWorkerM2.pas │ │ │ └── uSnowWorkerM3.pas │ │ ├── OneUUID.pas │ │ ├── uDefaultIdGenerator.pas │ │ └── uYitIdHelper.pas │ ├── virtualFile │ │ └── OneVirtualFile.pas │ └── winRegister │ │ └── OneWinReg.pas ├── frm_main.dfm ├── frm_main.pas ├── httpServer │ ├── Controller │ │ ├── DataController.pas │ │ ├── Demo │ │ │ ├── DemoAttributeController.pas │ │ │ ├── DemoAuthorController.pas │ │ │ ├── DemoBController.pas │ │ │ ├── DemoController.pas │ │ │ ├── DemoCustResult.pas │ │ │ ├── DemoDataController.pas │ │ │ ├── DemoEvenController.pas │ │ │ ├── DemoJsonController.pas │ │ │ ├── DemoLogController.pas │ │ │ ├── DemoMyController.pas │ │ │ ├── DemoOneWorkThread.pas │ │ │ ├── DemoOrmController.pas │ │ │ ├── DemoTestController.pas │ │ │ ├── DemoUrlPathController.pas │ │ │ ├── DemoVersionController.pas │ │ │ ├── DemoWebFileController.pas │ │ │ ├── DemoWorkCustErrResult.pas │ │ │ ├── DemoZTController.pas │ │ │ └── backup │ │ │ │ └── DemoDataController.pas.bak │ │ ├── DemoController.pas │ │ ├── OneWsChatController.pas │ │ ├── TestApiController.pas │ │ ├── TokenController.pas │ │ ├── UniDemoController.pas │ │ ├── VirtualFileController.pas │ │ └── ZTManageController.pas │ ├── OneControllerResult.pas │ ├── OneHttpConst.pas │ ├── OneHttpController.pas │ ├── OneHttpControllerRtti.pas │ ├── OneHttpCtxtResult.pas │ ├── OneHttpRouterManage.pas │ ├── OneHttpServer.pas │ ├── OneWebSocketConst.pas │ └── OneWebSocketServer.pas ├── 使用前说明.txt └── 相关脚本.txt ├── README.md ├── mORMot2-master.rar ├── 使用前说明.txt └── 更新说明.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pas linguist-language=Delphi 2 | *.dfm linguist-language=Pascal -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | 68 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 69 | modules/ 70 | -------------------------------------------------------------------------------- /DelTemp.bat: -------------------------------------------------------------------------------- 1 | Rem Delete Delphi tmp,*.db,*.mb, 2 | Rem **************************** 3 | @dir/w/s *.~*,*.dcu 4 | @echo The above is the current directory and subdirectory temporary files, please press any key to confirm deletion! 5 | @pause 6 | @for /r . %%a in (.) do @if exist "%%a\*.~*" del "%%a\*.~*" 7 | @for /r . %%a in (.) do @if exist "%%a\*.dcu" del "%%a\*.dcu" 8 | ::@for /r . %%a in (.) do @if exist "%%a\*.db" del "%%a\*.db" 9 | ::@for /r . %%a in (.) do @if exist "%%a\*.mb" del "%%a\*.mb" 10 | 11 | ::删除D10中临时文件 12 | @for /r . %%a in (__history) do @if exist "%%a" rd /s /q "%%a" 13 | @for /r . %%a in (__recovery) do @if exist "%%a" rd /s /q "%%a" 14 | @echo successfully delete! 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 李先森 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoAsync.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoAsync; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoAsync in 'frmDemoAsync.pas' {Form5}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm5, Form5); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoAsync.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoAsync.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTran.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoCustTran; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoCustTran in 'frmDemoCustTran.pas' {Form3}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm3, Form3); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTran.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoCustTran.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTranB.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoCustTranB; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoCustTranB in 'frmDemoCustTranB.pas' {Form8}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm8, Form8); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTranB.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoCustTranB.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTranC.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoCustTranC; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoCustTranC in 'frmDemoCustTranC.pas' {Form9}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm9, Form9); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoCustTranC.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoCustTranC.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoDatas.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoDatas; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoDatas in 'frmDemoDatas.pas' {Form2}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm2, Form2); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoDatas.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoDatas.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoPostGet.dpr: -------------------------------------------------------------------------------- 1 | program OneCleintDemoPostGet; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoPostGet in 'frmDemoPostGet.pas' {Form4}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm4, Form4); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneCleintDemoPostGet.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneCleintDemoPostGet.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemo.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemo; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoMain in 'frmDemoMain.pas' {frDemoMain}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | if DebugHook <> 0 then 12 | ReportMemoryLeaksOnShutdown := true; 13 | Application.MainFormOnTaskbar := true; 14 | Application.CreateForm(TfrDemoMain, frDemoMain); 15 | Application.Run; 16 | 17 | end. 18 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemo.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemo.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoBillLock.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoBillLock; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoBillLock in 'frmDemoBillLock.pas' {Form11}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm11, Form11); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoBillLock.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoBillLock.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastApi.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoFastApi; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoFastApi in 'frmDemoFastApi.pas' {frDemoFastApi}, 6 | frm_fastApiReport in 'frm_fastApiReport.pas' {frmFastApiReport}; 7 | 8 | {$R *.res} 9 | 10 | 11 | begin 12 | Application.Initialize; 13 | if DebugHook <> 0 then 14 | ReportMemoryLeaksOnShutdown := true; 15 | Application.MainFormOnTaskbar := true; 16 | Application.CreateForm(TfrDemoFastApi, frDemoFastApi); 17 | Application.Run; 18 | 19 | end. 20 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastApi.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoFastApi.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastApi.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastFile.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoFastFile; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoFastFile in 'frmDemoFastFile.pas' {frDemoFastFile}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TfrDemoFastFile, frDemoFastFile); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastFile.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoFastFile.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoFastFile.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoHttpWaitHint.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoHttpWaitHint; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoHttpWaitHint in 'frmDemoHttpWaitHint.pas' {frDemoHttpWaitHint}, 6 | frmWait in 'frmWait.pas' {frWaitHint}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.MainFormOnTaskbar := True; 13 | Application.CreateForm(TfrDemoHttpWaitHint, frDemoHttpWaitHint); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoHttpWaitHint.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoHttpWaitHint.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoHttpWaitHint.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoLsh.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoLsh; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoLsh in 'frmDemoLsh.pas' {frDemoLsh}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TfrDemoLsh, frDemoLsh); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoLsh.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoLsh.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoLsh.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoMetaInfo.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoMetaInfo; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoMetaInfo in 'frmDemoMetaInfo.pas' {frDemoMetaInfo}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TfrDemoMetaInfo, frDemoMetaInfo); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoMetaInfo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoMetaInfo.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoMetaInfo.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoOpenIncCache.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoOpenIncCache; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoOpenIncCache in 'frmDemoOpenIncCache.pas' {Form10}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm10, Form10); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoOpenIncCache.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoOpenIncCache.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoRefreshSingle.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoRefreshSingle; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoDataRefreshSingle in 'frmDemoDataRefreshSingle.pas' {Form1}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm1, Form1); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoRefreshSingle.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoRefreshSingle.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoRefreshSingle.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoSQLToClass.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoSQLToClass; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoSQLToClass in 'frmDemoSQLToClass.pas' {frDemoSQLToClass}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TfrDemoSQLToClass, frDemoSQLToClass); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoSQLToClass.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoSQLToClass.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoSQLToClass.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoScript.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoScript; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoScript in 'frmDemoScript.pas' {frDemoScript}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TfrDemoScript, frDemoScript); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoScript.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoScript.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoScript.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUUID.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoUUID; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoUUID in 'frmDemoUUID.pas' {frmUUID}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TfrmUUID, frmUUID); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUUID.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoUUID.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUUID.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUpDownChunt.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoUpDownChunt; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoUpDownChunk in 'frmDemoUpDownChunk.pas' {Form7}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm7, Form7); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUpDownChunt.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoUpDownChunt.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUpdate.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoUpdate; 2 | 3 | uses 4 | Vcl.Forms, 5 | Winapi.Windows, 6 | frmDemoUpdate in 'frmDemoUpdate.pas' {frDemoUpdate}; 7 | 8 | {$R *.res} 9 | 10 | 11 | var 12 | lpStartupInfo: TStartupInfo; 13 | lpProcessInformation: TProcessInformation; 14 | 15 | begin 16 | Application.Initialize; 17 | if DebugHook <> 0 then 18 | ReportMemoryLeaksOnShutdown := true; 19 | Application.MainFormOnTaskbar := true; 20 | Application.CreateForm(TfrDemoUpdate, frDemoUpdate); 21 | Application.Run; 22 | if not Restart_Flag then 23 | Exit; // 不需要重启 24 | FillChar(lpStartupInfo, sizeof(lpStartupInfo), 0); 25 | FillChar(lpProcessInformation, sizeof(lpProcessInformation), 0); 26 | lpStartupInfo.cb := sizeof(lpStartupInfo); 27 | if CreateProcess(nil, PChar(Application.ExeName), nil, nil, false, 0, nil, nil, lpStartupInfo, lpProcessInformation) then 28 | begin 29 | CloseHandle(lpProcessInformation.hThread); 30 | CloseHandle(lpProcessInformation.hProcess); 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoUpdate.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoUpdate.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoVirtualFile.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoVirtualFile; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoVirtualFile in 'frmDemoVirtualFile.pas' {Form6}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TForm6, Form6); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoVirtualFile.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoVirtualFile.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocket.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoWebSocket; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoWebSocket in 'frmDemoWebSocket.pas' {frDemoWebSocket}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TfrDemoWebSocket, frDemoWebSocket); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocket.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoWebSocket.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocket.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocketChat.dpr: -------------------------------------------------------------------------------- 1 | program OneClientDemoWebSocketChat; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDemoWebSocketChat in 'frmDemoWebSocketChat.pas' {frDemWsChat}; 6 | 7 | {$R *.res} 8 | 9 | 10 | begin 11 | Application.Initialize; 12 | if DebugHook <> 0 then 13 | ReportMemoryLeaksOnShutdown := true; 14 | Application.MainFormOnTaskbar := true; 15 | Application.CreateForm(TfrDemWsChat, frDemWsChat); 16 | Application.Run; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocketChat.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/OneClientDemoWebSocketChat.res -------------------------------------------------------------------------------- /OneClient/ClientDemo/OneClientDemoWebSocketChat.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoBillLock.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/frmDemoBillLock.pas -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoCustTranB.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/frmDemoCustTranB.pas -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoCustTranC.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/frmDemoCustTranC.pas -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoHttpWaitHint.pas: -------------------------------------------------------------------------------- 1 | unit frmDemoHttpWaitHint; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, 8 | OneClientHelper, OneClientConnect, FireDAC.Stan.Intf, FireDAC.Stan.Option, 9 | FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, 10 | FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, 11 | OneClientDataSet; 12 | 13 | type 14 | TfrDemoHttpWaitHint = class(TForm) 15 | plSet: TPanel; 16 | Label1: TLabel; 17 | Label2: TLabel; 18 | Label3: TLabel; 19 | Label17: TLabel; 20 | edHTTPHost: TEdit; 21 | edHTTPPort: TEdit; 22 | edConnectSecretkey: TEdit; 23 | tbClientConnect: TButton; 24 | edZTCode: TEdit; 25 | tbClientDisConnect: TButton; 26 | OneConnection: TOneConnection; 27 | OneDataSet1: TOneDataSet; 28 | procedure tbClientConnectClick(Sender: TObject); 29 | procedure OneConnectionShowWaitHint(Sender: TObject); 30 | procedure OneConnectionShowWaitHintProcess(Sender: TObject); 31 | procedure OneConnectionShowWaitHintClose(Sender: TObject); 32 | private 33 | { Private declarations } 34 | public 35 | { Public declarations } 36 | end; 37 | 38 | var 39 | frDemoHttpWaitHint: TfrDemoHttpWaitHint; 40 | 41 | implementation 42 | 43 | {$R *.dfm} 44 | 45 | 46 | uses frmWait; 47 | 48 | procedure TfrDemoHttpWaitHint.OneConnectionShowWaitHint(Sender: TObject); 49 | begin 50 | // 唤醒等待窗体 51 | frmWait.ShowWaitForm; 52 | end; 53 | 54 | procedure TfrDemoHttpWaitHint.OneConnectionShowWaitHintClose(Sender: TObject); 55 | begin 56 | // 关闭等待窗体 57 | frmWait.CloseWaitForm; 58 | end; 59 | 60 | procedure TfrDemoHttpWaitHint.OneConnectionShowWaitHintProcess(Sender: TObject); 61 | begin 62 | // 归还消息,否则什么造成错误,当是主线程时,非主线程也不会走这边 63 | // // win下用 application.ProcessMessages; 64 | // FMX下需引用相关单元 FMX.Forms 然后调用 Tapplication.ProcessMessages 65 | application.ProcessMessages; 66 | end; 67 | 68 | procedure TfrDemoHttpWaitHint.tbClientConnectClick(Sender: TObject); 69 | begin 70 | // OneConnection.Connected := true; 71 | // OneDataSet1.OpenDataAsync( 72 | // procedure(QIsOK: boolean; QErrmsg: string) 73 | // begin 74 | // 75 | // end) 76 | if OneConnection.Connected then 77 | begin 78 | showMessage('已经连接成功,无需在连接'); 79 | exit; 80 | end; 81 | OneConnection.HTTPHost := edHTTPHost.Text; 82 | OneConnection.HTTPPort := strToInt(edHTTPPort.Text); 83 | OneConnection.ZTCode := edZTCode.Text; 84 | OneConnection.ConnectSecretkey := edConnectSecretkey.Text; 85 | if not OneConnection.DoConnect() then 86 | begin 87 | showMessage(OneConnection.ErrMsg); 88 | end 89 | else 90 | begin 91 | // 全局设置,如果控件没挂勾 connetion,默认走的就是全局的 92 | OneClientConnect.Unit_Connection := OneConnection; 93 | showMessage('连接成功'); 94 | end; 95 | end; 96 | 97 | end. 98 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoOpenIncCache.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/ClientDemo/frmDemoOpenIncCache.pas -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoPostGet.pas: -------------------------------------------------------------------------------- 1 | unit frmDemoPostGet; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, 7 | System.Classes, Vcl.Graphics, System.JSON, 8 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, 9 | OneClientHelper, OneClientConnect; 10 | 11 | type 12 | TForm4 = class(TForm) 13 | plUrl: TPanel; 14 | Label4: TLabel; 15 | edMethod: TComboBox; 16 | edUrl: TEdit; 17 | tbRequest: TButton; 18 | GroupBox1: TGroupBox; 19 | edUrlParam: TMemo; 20 | Label5: TLabel; 21 | edPostResult: TMemo; 22 | Label6: TLabel; 23 | edParams: TMemo; 24 | Label7: TLabel; 25 | OneConnection: TOneConnection; 26 | edPostData: TMemo; 27 | Label1: TLabel; 28 | procedure edMethodChange(Sender: TObject); 29 | procedure tbRequestClick(Sender: TObject); 30 | private 31 | { Private declarations } 32 | public 33 | { Public declarations } 34 | end; 35 | 36 | var 37 | Form4: TForm4; 38 | 39 | implementation 40 | 41 | {$R *.dfm} 42 | 43 | procedure TForm4.edMethodChange(Sender: TObject); 44 | var 45 | lJsonObj: TJsonObject; 46 | lBytes: TBytes; 47 | lStr: string; 48 | begin 49 | if edMethod.ItemIndex = 0 then 50 | begin 51 | edParams.Lines.Clear; 52 | edParams.Lines.Add('name=范联满'); 53 | edParams.Lines.Add('age=18') 54 | end; 55 | if edMethod.ItemIndex = 1 then 56 | begin 57 | edParams.Lines.Clear; 58 | lJsonObj := TJsonObject.Create; 59 | try 60 | lJsonObj.AddPair('name', '范联满'); 61 | lJsonObj.AddPair('age', TJSonNumber.Create(18)); 62 | edParams.Lines.Text := lJsonObj.ToString(); 63 | finally 64 | lJsonObj.Free; 65 | end; 66 | end; 67 | 68 | end; 69 | 70 | procedure TForm4.tbRequestClick(Sender: TObject); 71 | var 72 | lResultData: string; 73 | lUrl: string; 74 | tempStr: string; 75 | i: integer; 76 | tempArr: TArray; 77 | begin 78 | lUrl := edUrl.Text; 79 | if lUrl = '' then 80 | begin 81 | showMessage('请求URL地址不可为空'); 82 | exit; 83 | end; 84 | for i := 0 to edUrlParam.Lines.Count - 1 do 85 | begin 86 | tempStr := edUrlParam.Lines[i]; 87 | if tempStr.Trim = '' then 88 | continue; 89 | tempArr := tempStr.Split(['=']); 90 | if Length(tempArr) = 2 then 91 | begin 92 | if lUrl.IndexOf('?') > 0 then 93 | begin 94 | lUrl := lUrl + '&' + tempStr; 95 | end 96 | else 97 | begin 98 | lUrl := lUrl + '?' + tempStr; 99 | end; 100 | end; 101 | end; 102 | if edMethod.ItemIndex = 0 then 103 | begin 104 | // Get请求 105 | OneConnection.GetResultContent(lUrl, lResultData); 106 | edPostResult.Lines.Text := lResultData; 107 | end 108 | else if edMethod.ItemIndex = 1 then 109 | begin 110 | // Post请求 111 | OneConnection.PostResultContent(lUrl, edPostData.Lines.Text, lResultData); 112 | edPostResult.Lines.Text := lResultData; 113 | end; 114 | end; 115 | 116 | end. 117 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoScript.pas: -------------------------------------------------------------------------------- 1 | unit frmDemoScript; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, 8 | OneClientHelper, OneClientConnect, FireDAC.Stan.Intf, FireDAC.Stan.Option, 9 | FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, 10 | FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, 11 | OneClientDataSet; 12 | 13 | type 14 | TfrDemoScript = class(TForm) 15 | plSet: TPanel; 16 | Label1: TLabel; 17 | Label2: TLabel; 18 | Label3: TLabel; 19 | Label17: TLabel; 20 | edHTTPHost: TEdit; 21 | edHTTPPort: TEdit; 22 | edConnectSecretkey: TEdit; 23 | tbClientConnect: TButton; 24 | tbClientDisConnect: TButton; 25 | edZTCode: TEdit; 26 | OneConnection: TOneConnection; 27 | qryScript: TOneDataSet; 28 | edScript: TMemo; 29 | tbSciprt: TButton; 30 | procedure tbClientConnectClick(Sender: TObject); 31 | procedure tbClientDisConnectClick(Sender: TObject); 32 | procedure tbSciprtClick(Sender: TObject); 33 | private 34 | { Private declarations } 35 | public 36 | { Public declarations } 37 | end; 38 | 39 | var 40 | frDemoScript: TfrDemoScript; 41 | 42 | implementation 43 | 44 | {$R *.dfm} 45 | 46 | 47 | procedure TfrDemoScript.tbClientConnectClick(Sender: TObject); 48 | begin 49 | if OneConnection.Connected then 50 | begin 51 | showMessage('已经连接成功,无需在连接'); 52 | exit; 53 | end; 54 | OneConnection.HTTPHost := edHTTPHost.Text; 55 | OneConnection.HTTPPort := strToInt(edHTTPPort.Text); 56 | OneConnection.ZTCode := edZTCode.Text; 57 | OneConnection.ConnectSecretkey := edConnectSecretkey.Text; 58 | if not OneConnection.DoConnect() then 59 | begin 60 | showMessage(OneConnection.ErrMsg); 61 | end 62 | else 63 | begin 64 | // 全局设置,如果控件没挂勾 connetion,默认走的就是全局的 65 | OneClientConnect.Unit_Connection := OneConnection; 66 | showMessage('连接成功'); 67 | end; 68 | end; 69 | 70 | procedure TfrDemoScript.tbClientDisConnectClick(Sender: TObject); 71 | begin 72 | OneConnection.DisConnect; 73 | end; 74 | 75 | procedure TfrDemoScript.tbSciprtClick(Sender: TObject); 76 | begin 77 | if edScript.Lines.Count = 0 then 78 | begin 79 | showMessage('无相关脚本,请先输入脚本'); 80 | exit; 81 | end; 82 | qryScript.SQL.Text := edScript.Lines.Text; 83 | if not qryScript.ExecScript then 84 | begin 85 | showMessage(qryScript.DataInfo.ErrMsg); 86 | exit; 87 | end 88 | else 89 | begin 90 | showMessage('执行脚本成功'); 91 | end; 92 | end; 93 | 94 | end. 95 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoUUID.pas: -------------------------------------------------------------------------------- 1 | unit frmDemoUUID; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, 8 | OneClientHelper, OneClientConnect, OneClientUUID; 9 | 10 | type 11 | TfrmUUID = class(TForm) 12 | plSet: TPanel; 13 | Label1: TLabel; 14 | Label2: TLabel; 15 | Label3: TLabel; 16 | Label17: TLabel; 17 | edHTTPHost: TEdit; 18 | edHTTPPort: TEdit; 19 | edConnectSecretkey: TEdit; 20 | tbClientConnect: TButton; 21 | edZTCode: TEdit; 22 | tbClientDisConnect: TButton; 23 | OneConnection: TOneConnection; 24 | OneUUID1: TOneUUID; 25 | edUUID: TMemo; 26 | tbGetUUID: TButton; 27 | procedure tbClientConnectClick(Sender: TObject); 28 | procedure tbClientDisConnectClick(Sender: TObject); 29 | procedure tbGetUUIDClick(Sender: TObject); 30 | private 31 | { Private declarations } 32 | public 33 | { Public declarations } 34 | end; 35 | 36 | var 37 | frmUUID: TfrmUUID; 38 | 39 | implementation 40 | 41 | {$R *.dfm} 42 | 43 | 44 | procedure TfrmUUID.tbClientConnectClick(Sender: TObject); 45 | begin 46 | if OneConnection.Connected then 47 | begin 48 | showMessage('已经连接成功,无需在连接'); 49 | exit; 50 | end; 51 | OneConnection.HTTPHost := edHTTPHost.Text; 52 | OneConnection.HTTPPort := strToInt(edHTTPPort.Text); 53 | OneConnection.ZTCode := edZTCode.Text; 54 | OneConnection.ConnectSecretkey := edConnectSecretkey.Text; 55 | if not OneConnection.DoConnect() then 56 | begin 57 | showMessage(OneConnection.ErrMsg); 58 | end 59 | else 60 | begin 61 | showMessage('连接成功'); 62 | end; 63 | end; 64 | 65 | procedure TfrmUUID.tbClientDisConnectClick(Sender: TObject); 66 | begin 67 | OneConnection.DisConnect; 68 | end; 69 | 70 | procedure TfrmUUID.tbGetUUIDClick(Sender: TObject); 71 | var 72 | vUrl: string; 73 | i: integer; 74 | tempI: Int64; 75 | begin 76 | if not OneConnection.Connected then 77 | begin 78 | showMessage('未连接请先连接'); 79 | exit; 80 | end; 81 | tempI := OneUUID1.GetUUID(); 82 | if tempI = -1 then 83 | begin 84 | showMessage(OneUUID1.ErrMsg); 85 | exit; 86 | end; 87 | 88 | edUUID.Lines.Add(tempI.ToString); 89 | end; 90 | 91 | end. 92 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoWebSocket.dfm: -------------------------------------------------------------------------------- 1 | object frDemoWebSocket: TfrDemoWebSocket 2 | Left = 0 3 | Top = 0 4 | Caption = 'WebSocket-'#36890#35759 5 | ClientHeight = 518 6 | ClientWidth = 898 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | TextHeight = 15 14 | object Label3: TLabel 15 | Left = 8 16 | Top = 98 17 | Width = 52 18 | Height = 15 19 | Caption = #28040#24687#23637#31034 20 | end 21 | object plSet: TPanel 22 | Left = 0 23 | Top = 0 24 | Width = 898 25 | Height = 49 26 | Align = alTop 27 | TabOrder = 0 28 | ExplicitWidth = 894 29 | object Label1: TLabel 30 | Left = 12 31 | Top = 17 32 | Width = 42 33 | Height = 15 34 | Caption = 'Ws'#22320#22336 35 | end 36 | object Label2: TLabel 37 | Left = 220 38 | Top = 17 39 | Width = 42 40 | Height = 15 41 | Caption = 'Ws'#31471#21475 42 | end 43 | object edWsIP: TEdit 44 | Left = 80 45 | Top = 14 46 | Width = 121 47 | Height = 23 48 | TabOrder = 0 49 | Text = '127.0.0.1' 50 | end 51 | object edWsPort: TEdit 52 | Left = 288 53 | Top = 14 54 | Width = 121 55 | Height = 23 56 | NumbersOnly = True 57 | TabOrder = 1 58 | Text = '9099' 59 | end 60 | object tbClientConnect: TButton 61 | Left = 591 62 | Top = 13 63 | Width = 114 64 | Height = 25 65 | Caption = #36830#25509 66 | TabOrder = 2 67 | OnClick = tbClientConnectClick 68 | end 69 | object tbClientDisConnect: TButton 70 | Left = 743 71 | Top = 13 72 | Width = 114 73 | Height = 25 74 | Caption = #26029#24320#36830#25509 75 | TabOrder = 3 76 | OnClick = tbClientDisConnectClick 77 | end 78 | object checkWss: TCheckBox 79 | Left = 432 80 | Top = 17 81 | Width = 153 82 | Height = 17 83 | Caption = #21551#29992'-Wss'#27809#20107#21035#20081#21246 84 | TabOrder = 4 85 | end 86 | end 87 | object edMessage: TMemo 88 | Left = 8 89 | Top = 120 90 | Width = 577 91 | Height = 390 92 | ScrollBars = ssBoth 93 | TabOrder = 1 94 | end 95 | object edSendMsg: TEdit 96 | Left = 8 97 | Top = 64 98 | Width = 577 99 | Height = 28 100 | Font.Charset = DEFAULT_CHARSET 101 | Font.Color = clWindowText 102 | Font.Height = -15 103 | Font.Name = 'Segoe UI' 104 | Font.Style = [] 105 | ParentFont = False 106 | TabOrder = 2 107 | end 108 | object tbSendMsg: TButton 109 | Left = 591 110 | Top = 64 111 | Width = 114 112 | Height = 25 113 | Caption = #28040#24687#21457#36865 114 | TabOrder = 3 115 | OnClick = tbSendMsgClick 116 | end 117 | object OneWsClient: TOneWebSocketClient 118 | IsWss = False 119 | WsPort = 0 120 | WsProtocol = 'Onews' 121 | OnReceiveMessage = OneWsClientReceiveMessage 122 | Left = 216 123 | Top = 152 124 | end 125 | end 126 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmDemoWebSocket.pas: -------------------------------------------------------------------------------- 1 | unit frmDemoWebSocket; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, 8 | OneWebSocketClient; 9 | 10 | type 11 | TfrDemoWebSocket = class(TForm) 12 | plSet: TPanel; 13 | Label1: TLabel; 14 | Label2: TLabel; 15 | edWsIP: TEdit; 16 | edWsPort: TEdit; 17 | tbClientConnect: TButton; 18 | tbClientDisConnect: TButton; 19 | checkWss: TCheckBox; 20 | OneWsClient: TOneWebSocketClient; 21 | edMessage: TMemo; 22 | edSendMsg: TEdit; 23 | tbSendMsg: TButton; 24 | Label3: TLabel; 25 | procedure OneWsClientReceiveMessage(const S: string); 26 | procedure tbClientConnectClick(Sender: TObject); 27 | procedure tbClientDisConnectClick(Sender: TObject); 28 | procedure tbSendMsgClick(Sender: TObject); 29 | private 30 | { Private declarations } 31 | public 32 | { Public declarations } 33 | end; 34 | 35 | var 36 | frDemoWebSocket: TfrDemoWebSocket; 37 | 38 | implementation 39 | 40 | {$R *.dfm} 41 | 42 | 43 | procedure TfrDemoWebSocket.OneWsClientReceiveMessage(const S: string); 44 | begin 45 | // 46 | edMessage.Lines.Add('***********'); 47 | edMessage.Lines.Add('接收时间: ' + FormatDateTime('yyyy-mm-dd hh:mm:ss', now)); 48 | edMessage.Lines.Add('接收消息: ' + S); 49 | edMessage.Lines.Add('***********'); 50 | end; 51 | 52 | procedure TfrDemoWebSocket.tbClientConnectClick(Sender: TObject); 53 | var 54 | tempStr: string; 55 | tempI: integer; 56 | begin 57 | // 58 | OneWsClient.WsHost := edWsIP.Text; 59 | tempI := 0; 60 | tryStrToInt(edWsPort.Text, tempI); 61 | OneWsClient.WsPort := tempI; 62 | if not OneWsClient.DoConnect() then 63 | begin 64 | edMessage.Lines.Add('连接时间: ' + FormatDateTime('yyyy-mm-dd hh:mm:ss', now)); 65 | edMessage.Lines.Add('连接失败: ' + OneWsClient.ErrMsg); 66 | edMessage.Lines.Add(''); 67 | showMessage(OneWsClient.ErrMsg); 68 | end 69 | else 70 | begin 71 | edMessage.Lines.Add('连接时间: ' + FormatDateTime('yyyy-mm-dd hh:mm:ss', now)); 72 | edMessage.Lines.Add('连接成'); 73 | edMessage.Lines.Add(''); 74 | showMessage('连接成功'); 75 | end; 76 | end; 77 | 78 | procedure TfrDemoWebSocket.tbClientDisConnectClick(Sender: TObject); 79 | begin 80 | OneWsClient.DisConnect; 81 | edMessage.Lines.Add('断开时间: ' + FormatDateTime('yyyy-mm-dd hh:mm:ss', now)); 82 | edMessage.Lines.Add(''); 83 | end; 84 | 85 | procedure TfrDemoWebSocket.tbSendMsgClick(Sender: TObject); 86 | begin 87 | // 88 | if not OneWsClient.SendMessage(edSendMsg.Text) then 89 | begin 90 | showMessage(OneWsClient.ErrMsg); 91 | exit; 92 | end; 93 | edMessage.Lines.Add('发送时间: ' + FormatDateTime('yyyy-mm-dd hh:mm:ss', now)); 94 | edMessage.Lines.Add('发送消息: ' + edSendMsg.Text); 95 | edMessage.Lines.Add(''); 96 | end; 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /OneClient/ClientDemo/frmWait.dfm: -------------------------------------------------------------------------------- 1 | object frWaitHint: TfrWaitHint 2 | Left = 0 3 | Top = 0 4 | BorderStyle = bsNone 5 | Caption = 'frWaitHint' 6 | ClientHeight = 45 7 | ClientWidth = 353 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -12 12 | Font.Name = 'Segoe UI' 13 | Font.Style = [] 14 | Position = poScreenCenter 15 | OnClose = FormClose 16 | OnCreate = FormCreate 17 | TextHeight = 15 18 | object lbHint: TLabel 19 | Left = 0 20 | Top = 0 21 | Width = 353 22 | Height = 45 23 | Align = alClient 24 | Alignment = taCenter 25 | Caption = #32593#32476#27491#22312#35831#27714#20013#35831#31245#20505'....' 26 | Font.Charset = DEFAULT_CHARSET 27 | Font.Color = clRed 28 | Font.Height = -15 29 | Font.Name = 'Segoe UI' 30 | Font.Style = [] 31 | ParentFont = False 32 | Layout = tlCenter 33 | WordWrap = True 34 | ExplicitWidth = 172 35 | ExplicitHeight = 20 36 | end 37 | object TimerCacle: TTimer 38 | Enabled = False 39 | OnTimer = TimerCacleTimer 40 | Left = 32 41 | Top = 8 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OneOpenSSLDemo.dpr: -------------------------------------------------------------------------------- 1 | program OneOpenSSLDemo; 2 | 3 | uses 4 | Vcl.Forms, 5 | FormOpenSSL in 'FormOpenSSL.pas' {Form1}, 6 | ssl_aes in 'OpenSSL\ssl_aes.pas', 7 | ssl_asn in 'OpenSSL\ssl_asn.pas', 8 | ssl_bf in 'OpenSSL\ssl_bf.pas', 9 | ssl_bio in 'OpenSSL\ssl_bio.pas', 10 | ssl_bn in 'OpenSSL\ssl_bn.pas', 11 | ssl_buffer in 'OpenSSL\ssl_buffer.pas', 12 | ssl_camellia in 'OpenSSL\ssl_camellia.pas', 13 | ssl_cast in 'OpenSSL\ssl_cast.pas', 14 | ssl_cmac in 'OpenSSL\ssl_cmac.pas', 15 | ssl_cms in 'OpenSSL\ssl_cms.pas', 16 | ssl_comp in 'OpenSSL\ssl_comp.pas', 17 | ssl_conf in 'OpenSSL\ssl_conf.pas', 18 | ssl_const in 'OpenSSL\ssl_const.pas', 19 | ssl_des in 'OpenSSL\ssl_des.pas', 20 | ssl_dh in 'OpenSSL\ssl_dh.pas', 21 | ssl_dsa in 'OpenSSL\ssl_dsa.pas', 22 | ssl_ec in 'OpenSSL\ssl_ec.pas', 23 | ssl_ecdh in 'OpenSSL\ssl_ecdh.pas', 24 | ssl_ecdsa in 'OpenSSL\ssl_ecdsa.pas', 25 | ssl_engine in 'OpenSSL\ssl_engine.pas', 26 | ssl_err in 'OpenSSL\ssl_err.pas', 27 | ssl_evphis in 'OpenSSL\ssl_evphis.pas', 28 | ssl_hmac in 'OpenSSL\ssl_hmac.pas', 29 | ssl_idea in 'OpenSSL\ssl_idea.pas', 30 | ssl_init in 'OpenSSL\ssl_init.pas', 31 | ssl_lhash in 'OpenSSL\ssl_lhash.pas', 32 | ssl_lib in 'OpenSSL\ssl_lib.pas', 33 | ssl_md4 in 'OpenSSL\ssl_md4.pas', 34 | ssl_md5 in 'OpenSSL\ssl_md5.pas', 35 | ssl_mdc2 in 'OpenSSL\ssl_mdc2.pas', 36 | ssl_obj_id in 'OpenSSL\ssl_obj_id.pas', 37 | ssl_objects in 'OpenSSL\ssl_objects.pas', 38 | ssl_ocsp in 'OpenSSL\ssl_ocsp.pas', 39 | ssl_pem in 'OpenSSL\ssl_pem.pas', 40 | ssl_pkcs7 in 'OpenSSL\ssl_pkcs7.pas', 41 | ssl_pkcs12 in 'OpenSSL\ssl_pkcs12.pas', 42 | ssl_rand in 'OpenSSL\ssl_rand.pas', 43 | ssl_rc2 in 'OpenSSL\ssl_rc2.pas', 44 | ssl_rc4 in 'OpenSSL\ssl_rc4.pas', 45 | ssl_rc5 in 'OpenSSL\ssl_rc5.pas', 46 | ssl_ripemd in 'OpenSSL\ssl_ripemd.pas', 47 | ssl_rsa in 'OpenSSL\ssl_rsa.pas', 48 | ssl_sha in 'OpenSSL\ssl_sha.pas', 49 | ssl_sk in 'OpenSSL\ssl_sk.pas', 50 | ssl_types in 'OpenSSL\ssl_types.pas', 51 | ssl_util in 'OpenSSL\ssl_util.pas', 52 | ssl_x509 in 'OpenSSL\ssl_x509.pas', 53 | ssl_encode in 'OpenSSL\ssl_encode.pas', 54 | ssl_sm4 in 'OpenSSL\ssl_sm4.pas', 55 | ssl_sm3 in 'OpenSSL\ssl_sm3.pas', 56 | ssl_evpmdctx in 'OpenSSL\ssl_evpmdctx.pas', 57 | ssl_evp in 'OpenSSL\ssl_evp.pas', 58 | ssl_typepointers in 'OpenSSL\ssl_typepointers.pas', 59 | ssl_conver in 'OpenSSL\ssl_conver.pas', 60 | ssl_evppkey in 'OpenSSL\ssl_evppkey.pas', 61 | ssl_sm2 in 'OpenSSL\ssl_sm2.pas'; 62 | 63 | {$R *.res} 64 | 65 | begin 66 | Application.Initialize; 67 | Application.MainFormOnTaskbar := True; 68 | Application.CreateForm(TForm1, Form1); 69 | Application.Run; 70 | end. 71 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OneOpenSSLDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/OpenSSLDemo/OneOpenSSLDemo.res -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | *.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | 25 | # Delphi compiler-generated binaries (safe to delete) 26 | *.exe 27 | *.dll 28 | *.bpl 29 | *.bpi 30 | *.dcp 31 | *.so 32 | *.apk 33 | *.drc 34 | *.map 35 | *.dres 36 | *.rsm 37 | *.tds 38 | *.dcu 39 | *.lib 40 | 41 | # Delphi autogenerated files (duplicated info) 42 | *.cfg 43 | *Resource.rc 44 | 45 | # Delphi local files (user-specific info) 46 | *.local 47 | *.identcache 48 | *.projdata 49 | *.tvsconfig 50 | *.dsk 51 | 52 | # Delphi history and backups 53 | __history/ 54 | *.~* 55 | 56 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 57 | *.stat 58 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE AES_LONG} 2 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_aes.pas: -------------------------------------------------------------------------------- 1 | unit ssl_aes; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | AES_options: function: PByte; cdecl = nil; 8 | AES_set_encrypt_key : function(userKey: PByte; bits: TC_INT; key: PAES_KEY): TC_INT; cdecl = nil; 9 | AES_set_decrypt_key: function(userKey: PByte; bits: TC_INT; key: PAES_KEY): TC_INT; cdecl = nil; 10 | AES_encrypt: procedure(_in: PByte; _out: PByte; key: PAES_KEY); cdecl = nil; 11 | AES_decrypt: procedure(_in: PByte; _out: PByte; key: PAES_KEY); cdecl = nil; 12 | AES_ecb_encrypt: procedure(_in: PByte; _out: PByte; key: PAES_KEY; enc: TC_INT); cdecl = nil; 13 | AES_cbc_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; enc: TC_INT); cdecl = nil; 14 | AES_cfb128_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; num: PC_INT; enc: TC_INT); cdecl = nil; 15 | AES_cfb1_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; num: PC_INT; enc: TC_INT); cdecl = nil; 16 | AES_cfb8_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; num: PC_INT; enc: TC_INT); cdecl = nil; 17 | AES_ofb128_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; num: PC_INT); cdecl = nil; 18 | AES_ige_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; ivec: PByte; enc: TC_INT); cdecl = nil; 19 | AES_bi_ige_encrypt: procedure(_in: PByte; _out: PByte; _length: TC_SIZE_T; key: PAES_KEY; key2: PAES_KEY; ivec: PByte; enc: TC_INT); cdecl = nil; 20 | AES_wrap_key: function(key: PAES_KEY; iv: PByte; _out: PByte; _in: PByte; inlen: TC_UINT): TC_INT; cdecl = nil; 21 | AES_unwrap_key: function(key: PAES_KEY; iv: PByte; _out: PByte; _in: PByte; inlen: TC_UINT): TC_INT; cdecl = nil; 22 | 23 | procedure SSL_InitAES; 24 | 25 | implementation 26 | uses ssl_lib; 27 | procedure SSL_InitAES; 28 | begin 29 | if @AES_options = nil then 30 | begin 31 | 32 | @AES_options:= LoadFuncCLibCrypto('AES_options'); 33 | @AES_set_encrypt_key:= LoadFuncCLibCrypto('AES_set_encrypt_key'); 34 | @AES_set_decrypt_key:= LoadFuncCLibCrypto('AES_set_decrypt_key'); 35 | @AES_encrypt:= LoadFuncCLibCrypto('AES_encrypt'); 36 | @AES_decrypt:= LoadFuncCLibCrypto('AES_decrypt'); 37 | @AES_ecb_encrypt:= LoadFuncCLibCrypto('AES_ecb_encrypt'); 38 | @AES_cbc_encrypt:= LoadFuncCLibCrypto('AES_cbc_encrypt'); 39 | @AES_cfb128_encrypt:= LoadFuncCLibCrypto('AES_cfb128_encrypt'); 40 | @AES_cfb1_encrypt:= LoadFuncCLibCrypto('AES_cfb1_encrypt'); 41 | @AES_cfb8_encrypt:= LoadFuncCLibCrypto('AES_cfb8_encrypt'); 42 | @AES_ofb128_encrypt:= LoadFuncCLibCrypto('AES_ofb128_encrypt'); 43 | @AES_ige_encrypt:= LoadFuncCLibCrypto('AES_ige_encrypt'); 44 | @AES_bi_ige_encrypt:= LoadFuncCLibCrypto('AES_bi_ige_encrypt'); 45 | @AES_wrap_key:= LoadFuncCLibCrypto('AES_wrap_key'); 46 | @AES_unwrap_key:= LoadFuncCLibCrypto('AES_unwrap_key'); 47 | 48 | end; 49 | end; 50 | 51 | end. 52 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_bf.pas: -------------------------------------------------------------------------------- 1 | unit ssl_bf; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | private_BF_set_key: procedure(key: PBF_KEY; len: TC_INT; data: PAnsiChar); cdecl = nil; 8 | BF_set_key: procedure(key: PBF_KEY; len: TC_INT; data: PAnsiChar); cdecl = nil; 9 | BF_encrypt: procedure(data: PBF_LONG; key: PBF_KEY); cdecl = nil; 10 | BF_decrypt: procedure(data: PBF_LONG; key: PBF_KEY); cdecl = nil; 11 | 12 | BF_ecb_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; key: PBF_KEY; enc: TC_INT); cdecl = nil; 13 | BF_cbc_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; schedule: PBF_KEY; ivec: PAnsiChar; enc: TC_INT); cdecl = nil; 14 | BF_cfb64_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; schedule: PBF_KEY; ivec: PAnsiChar; num: PC_INT; enc: TC_INT); cdecl = nil; 15 | BF_ofb64_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; schedule: PBF_KEY; ivec: PAnsiChar; num: PC_INT); cdecl = nil; 16 | BF_options: function: PAnsiChar; cdecl = nil; 17 | 18 | procedure SSL_InitBF; 19 | 20 | implementation 21 | uses ssl_lib; 22 | 23 | procedure SSL_InitBF; 24 | begin 25 | if @BF_options = nil then 26 | begin 27 | 28 | @private_BF_set_key:= LoadFuncCLibCrypto('private_BF_set_key', false); 29 | @BF_set_key:= LoadFuncCLibCrypto('BF_set_key'); 30 | @BF_encrypt:= LoadFuncCLibCrypto('BF_encrypt'); 31 | @BF_decrypt:= LoadFuncCLibCrypto('BF_decrypt'); 32 | @BF_ecb_encrypt:= LoadFuncCLibCrypto('BF_ecb_encrypt'); 33 | @BF_cbc_encrypt:= LoadFuncCLibCrypto('BF_cbc_encrypt'); 34 | @BF_cfb64_encrypt:= LoadFuncCLibCrypto('BF_cfb64_encrypt'); 35 | @BF_ofb64_encrypt:= LoadFuncCLibCrypto('BF_ofb64_encrypt'); 36 | @BF_options:= LoadFuncCLibCrypto('BF_options'); 37 | 38 | end; 39 | end; 40 | 41 | end. 42 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_buffer.pas: -------------------------------------------------------------------------------- 1 | {} 2 | unit ssl_buffer; 3 | 4 | interface 5 | uses ssl_types; 6 | var 7 | BUF_MEM_new: function: PBUF_MEM; cdecl = nil; 8 | BUF_MEM_free: procedure(a: PBUF_MEM); cdecl = nil; 9 | BUF_MEM_grow: function(str: PBUF_MEM; len: TC_SIZE_T): TC_INT; cdecl = nil; 10 | BUF_MEM_grow_clean: function(str: PBUF_MEM; len: TC_SIZE_T): TC_INT; cdecl = nil; 11 | BUF_strdup: function(str: PAnsiChar): PAnsiChar; cdecl = nil; 12 | BUF_strndup: function(str: PAnsiChar; siz: TC_SIZE_T): PAnsiChar; cdecl = nil; 13 | BUF_memdup: function(data: Pointer; siz: TC_SIZE_T): Pointer; cdecl = nil; 14 | BUF_reverse: procedure(_out: PAnsiChar; _in: PAnsiChar; siz: TC_SIZE_T); cdecl = nil; 15 | 16 | BUF_strlcpy: function(dst: PAnsiChar; src: PAnsiChar; siz: TC_SIZE_T): TC_SIZE_T; cdecl = nil; 17 | BUF_strlcat: function(dst: PAnsiChar; src: PAnsiChar; siz: TC_SIZE_T): TC_SIZE_T; cdecl = nil; 18 | 19 | ERR_load_BUF_strings: Procedure; cdecl = nil; 20 | 21 | procedure SSL_InitBuffer; 22 | 23 | implementation 24 | uses ssl_lib; 25 | 26 | procedure SSL_InitBuffer; 27 | begin 28 | if @BUF_MEM_new = nil then 29 | begin 30 | @BUF_MEM_new:= LoadFuncCLibCrypto('BUF_MEM_new'); 31 | @BUF_MEM_free:= LoadFuncCLibCrypto('BUF_MEM_free'); 32 | @BUF_MEM_grow:= LoadFuncCLibCrypto('BUF_MEM_grow'); 33 | @BUF_MEM_grow_clean:= LoadFuncCLibCrypto('BUF_MEM_grow_clean'); 34 | @BUF_strdup:= LoadFuncCLibCrypto('BUF_strdup'); 35 | @BUF_strndup:= LoadFuncCLibCrypto('BUF_strndup'); 36 | @BUF_memdup:= LoadFuncCLibCrypto('BUF_memdup'); 37 | @BUF_reverse:= LoadFuncCLibCrypto('BUF_reverse'); 38 | @BUF_strlcpy:= LoadFuncCLibCrypto('BUF_strlcpy'); 39 | @BUF_strlcat:= LoadFuncCLibCrypto('BUF_strlcat'); 40 | @ERR_load_BUF_strings:= LoadFuncCLibCrypto('ERR_load_BUF_strings'); 41 | 42 | end; 43 | end; 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_camellia.pas: -------------------------------------------------------------------------------- 1 | unit ssl_camellia; 2 | interface 3 | uses ssl_types; 4 | var 5 | Camellia_set_key: function (userKey: PAnsiChar; const bits: TC_INT; key: PCAMELLIA_KEY): TC_INT; cdecl = nil; 6 | 7 | Camellia_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; const key: PCAMELLIA_KEY); cdecl = nil; 8 | Camellia_decrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; const key: PCAMELLIA_KEY); cdecl = nil; 9 | 10 | Camellia_ecb_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; const key: PCAMELLIA_KEY; const enc: TC_INT); cdecl = nil; 11 | Camellia_cbc_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar;_length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: PAnsiChar; const enc: TC_INT); cdecl = nil; 12 | Camellia_cfb128_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: PAnsiChar; var num: TC_INT; const enc: TC_INT); cdecl = nil; 13 | Camellia_cfb1_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar;_length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: PAnsiChar; var num: TC_INT; const enc: TC_INT); cdecl = nil; 14 | Camellia_cfb8_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: PAnsiChar; var num: TC_INT; const enc: TC_INT); cdecl = nil; 15 | Camellia_ofb128_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: PAnsiChar; var num: TC_INT); cdecl = nil; 16 | Camellia_ctr128_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_SIZE_T; const key: PCAMELLIA_KEY; ivec: CAMELLIA_BUF; ecount_buf: CAMELLIA_BUF; var num: TC_UINT); cdecl = nil; 17 | 18 | procedure SSL_InitCAMELLIA; 19 | 20 | implementation 21 | uses ssl_lib; 22 | 23 | procedure SSL_InitCAMELLIA; 24 | begin 25 | if @Camellia_encrypt = nil then 26 | begin 27 | @Camellia_set_key:= LoadFuncCLibCrypto('Camellia_set_key'); 28 | @Camellia_encrypt:= LoadFuncCLibCrypto('Camellia_encrypt'); 29 | @Camellia_decrypt:= LoadFuncCLibCrypto('Camellia_decrypt'); 30 | @Camellia_ecb_encrypt:= LoadFuncCLibCrypto('Camellia_ecb_encrypt'); 31 | @Camellia_cbc_encrypt:= LoadFuncCLibCrypto('Camellia_cbc_encrypt'); 32 | @Camellia_cfb128_encrypt:= LoadFuncCLibCrypto('Camellia_cfb128_encrypt'); 33 | @Camellia_cfb1_encrypt:= LoadFuncCLibCrypto('Camellia_cfb1_encrypt'); 34 | @Camellia_cfb8_encrypt:= LoadFuncCLibCrypto('Camellia_cfb8_encrypt'); 35 | @Camellia_ofb128_encrypt:= LoadFuncCLibCrypto('Camellia_ofb128_encrypt'); 36 | @Camellia_ctr128_encrypt:= LoadFuncCLibCrypto('Camellia_ctr128_encrypt'); 37 | end; 38 | end; 39 | 40 | end. -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_cast.pas: -------------------------------------------------------------------------------- 1 | unit ssl_cast; 2 | 3 | interface 4 | uses ssl_types; 5 | var 6 | private_CAST_set_key: procedure(key: PCAST_KEY; len: TC_INT; data: PAnsiChar); cdecl = nil; 7 | CAST_set_key: procedure(key: PCAST_KEY; len: TC_INT; data: PAnsiChar); cdecl = nil; 8 | CAST_ecb_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; const key: PCAST_KEY; enc: TC_INT); cdecl = nil; 9 | CAST_encrypt: procedure(var data: CAST_LONG; key: PCAST_KEY); cdecl = nil; 10 | CAST_decrypt: procedure(var data: CAST_LONG; key: PCAST_KEY); cdecl = nil; 11 | CAST_cbc_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; ks: PCAST_KEY;iv: PAnsiChar; enc: TC_INT); cdecl = nil; 12 | CAST_cfb64_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; schedule: PCAST_KEY;ivec: PAnsiChar; var num: TC_INT; enc: TC_INT); cdecl = nil; 13 | CAST_ofb64_encrypt: procedure(_in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; schedule: PCAST_KEY;ivec: PAnsiChar; var num: TC_INT); cdecl = nil; 14 | 15 | procedure SLL_InitCAST; 16 | 17 | implementation 18 | uses ssl_lib; 19 | 20 | procedure SLL_InitCAST; 21 | begin 22 | if @CAST_set_key = nil then 23 | begin 24 | @private_CAST_set_key:= LoadFuncCLibCrypto('private_CAST_set_key', false); 25 | @CAST_set_key:= LoadFuncCLibCrypto('CAST_set_key'); 26 | @CAST_ecb_encrypt:= LoadFuncCLibCrypto('CAST_ecb_encrypt'); 27 | @CAST_encrypt:= LoadFuncCLibCrypto('CAST_encrypt'); 28 | @CAST_decrypt:= LoadFuncCLibCrypto('CAST_decrypt'); 29 | @CAST_cbc_encrypt:= LoadFuncCLibCrypto('CAST_cbc_encrypt'); 30 | @CAST_cfb64_encrypt:= LoadFuncCLibCrypto('CAST_cfb64_encrypt'); 31 | @CAST_ofb64_encrypt:= LoadFuncCLibCrypto('CAST_ofb64_encrypt'); 32 | end; 33 | 34 | end; 35 | 36 | end. 37 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_cmac.pas: -------------------------------------------------------------------------------- 1 | unit ssl_cmac; 2 | 3 | interface 4 | uses ssl_types; 5 | var 6 | CMAC_CTX_new: function: PCMAC_CTX; cdecl = nil; 7 | CMAC_CTX_cleanup: procedure(ctx: PCMAC_CTX); cdecl = nil; 8 | CMAC_CTX_free: procedure(ctx: PCMAC_CTX); cdecl = nil; 9 | CMAC_CTX_get0_cipher_ctx: function(ctx: PCMAC_CTX): PEVP_CIPHER_CTX; cdecl = nil; 10 | CMAC_CTX_copy: function(_out: PCMAC_CTX; _in: CMAC_CTX): TC_INT; cdecl = nil; 11 | CMAC_Init: function(ctx: PCMAC_CTX; key: Pointer; keylen: TC_SIZE_T; cipher: PEVP_CIPHER; impl: PENGINE): TC_INT; cdecl = nil; 12 | CMAC_Update: function(ctx: PCMAC_CTX; data: Pointer; dlen: TC_SIZE_T): TC_INT; cdecl = nil; 13 | CMAC_Final: function(ctx: PCMAC_CTX; _out: PAnsiChar; var poutlen: TC_SIZE_T): TC_INT; cdecl = nil; 14 | CMAC_resume: function(ctx: PCMAC_CTX): TC_INT; cdecl = nil; 15 | 16 | procedure SSL_InitCMAC; 17 | 18 | implementation 19 | uses ssl_lib; 20 | 21 | procedure SSL_InitCMAC; 22 | begin 23 | 24 | if @CMAC_CTX_new = nil then 25 | begin 26 | @CMAC_CTX_new:= LoadFuncCLibCrypto('CMAC_CTX_new'); 27 | @CMAC_CTX_cleanup:= LoadFuncCLibCrypto('CMAC_CTX_cleanup'); 28 | @CMAC_CTX_free:= LoadFuncCLibCrypto('CMAC_CTX_free'); 29 | @CMAC_CTX_get0_cipher_ctx:= LoadFuncCLibCrypto('CMAC_CTX_get0_cipher_ctx'); 30 | @CMAC_CTX_copy:= LoadFuncCLibCrypto('CMAC_CTX_copy'); 31 | @CMAC_Init:= LoadFuncCLibCrypto('CMAC_Init'); 32 | @CMAC_Update:= LoadFuncCLibCrypto('CMAC_Update'); 33 | @CMAC_Final:= LoadFuncCLibCrypto('CMAC_Final'); 34 | @CMAC_resume:= LoadFuncCLibCrypto('CMAC_resume'); 35 | end; 36 | end; 37 | end. 38 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_comp.pas: -------------------------------------------------------------------------------- 1 | unit ssl_comp; 2 | interface 3 | uses ssl_types; 4 | var 5 | COMP_CTX_new: function(meth: PCOMP_METHOD): PCOMP_CTX; cdecl = nil; 6 | COMP_CTX_free: procedure(ctx: PCOMP_CTX); cdecl = nil; 7 | COMP_compress_block: function(ctx: PCOMP_CTX; _out: PAnsiChar; olen: TC_INT;_in: PAnsiChar; ilen: TC_INT): TC_INT; cdecl = nil; 8 | COMP_expand_block:function(ctx: PCOMP_CTX; _out: PAnsiChar; olen: TC_INT;_in: PAnsiChar; ilen: TC_INT): TC_INT; cdecl = nil; 9 | COMP_rle: function: PCOMP_METHOD; cdecl = nil; 10 | COMP_zlib: function: PCOMP_METHOD; cdecl = nil; 11 | COMP_zlib_cleanup: procedure; cdecl = nil; 12 | BIO_f_zlib: function: PBIO_METHOD; cdecl = nil; 13 | 14 | procedure SSL_InitCOMP; 15 | 16 | implementation 17 | uses ssl_lib; 18 | 19 | procedure SSL_InitCOMP; 20 | begin 21 | if @COMP_CTX_new = nil then 22 | begin 23 | @COMP_CTX_new:= LoadFuncCLibCrypto('COMP_CTX_new'); 24 | @COMP_CTX_free:= LoadFuncCLibCrypto('COMP_CTX_free'); 25 | @COMP_compress_block:= LoadFuncCLibCrypto('COMP_compress_block'); 26 | @COMP_expand_block:= LoadFuncCLibCrypto('COMP_expand_block'); 27 | @COMP_rle:= LoadFuncCLibCrypto('COMP_rle'); 28 | @COMP_zlib:= LoadFuncCLibCrypto('COMP_zlib'); 29 | @COMP_zlib_cleanup:= LoadFuncCLibCrypto('COMP_zlib_cleanup'); 30 | @BIO_f_zlib:= LoadFuncCLibCrypto('BIO_f_zlib', false); 31 | end; 32 | end; 33 | 34 | end. -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_conver.pas: -------------------------------------------------------------------------------- 1 | unit ssl_conver; 2 | 3 | interface 4 | 5 | uses system.SysUtils, system.Classes,System.NetEncoding; 6 | //二进制转16进制字符串 7 | function BinToHexStr(QInBytes: TBytes): string; 8 | function BinToHexStr2(QInBytes: TBytes): string; 9 | //16进制字符串转Bytes 10 | function HexStrToBin(QHexStr:string):TBytes; 11 | //二进制转base64 12 | function BinToBase64Str(QInBytes: TBytes):string; 13 | //BASE64转bytes 14 | function Base64StrToBin(QBase64Str:string):TBytes; 15 | implementation 16 | 17 | function BinToHexStr(QInBytes: TBytes): string; 18 | var 19 | i, iLen: integer; 20 | tempStr: string; 21 | begin 22 | iLen := Length(QInBytes); 23 | tempStr := ''; 24 | for i := 0 to iLen - 1 do 25 | begin 26 | tempStr := tempStr + IntToHex(QInBytes[i], 2); 27 | end; 28 | result := tempStr; 29 | end; 30 | 31 | function BinToHexStr2(QInBytes: TBytes): string; 32 | var 33 | i, iLen: integer; 34 | tempStr: string; 35 | begin 36 | iLen := Length(QInBytes); 37 | tempStr := ''; 38 | if iLen = 0 then 39 | begin 40 | result := tempStr; 41 | exit; 42 | end; 43 | setLength(tempStr, iLen * 2); 44 | BinToHex(@QInBytes[0], PWideChar(tempStr), iLen); 45 | result := tempStr; 46 | end; 47 | 48 | function HexStrToBin(QHexStr:string):TBytes; 49 | var lOutBytes:TBytes; 50 | iLen:integer; 51 | begin 52 | iLen := Length(QHexStr); 53 | //预设长度 54 | setLength(lOutBytes,iLen); 55 | //返回实际长度 56 | if iLen>0 then 57 | begin 58 | iLen := HexToBin(PWideChar(QHexStr), @lOutBytes[0], iLen); 59 | end; 60 | //栽剪长度 61 | setLength(lOutBytes,iLen); 62 | Result := lOutBytes; 63 | end; 64 | 65 | function BinToBase64Str(QInBytes: TBytes):string; 66 | var lEncoding:TBase64Encoding; 67 | begin 68 | lEncoding := TBase64Encoding.Create(0); 69 | try 70 | Result := lEncoding.EncodeBytesToString(QInBytes); 71 | finally 72 | lEncoding.Free; 73 | end; 74 | end; 75 | function Base64StrToBin(QBase64Str:string):TBytes; 76 | begin 77 | Result := TNetEncoding.Base64.DecodeStringToBytes(QBase64Str); 78 | end; 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_ecdh.pas: -------------------------------------------------------------------------------- 1 | unit ssl_ecdh; 2 | 3 | interface 4 | uses ssl_types; 5 | var 6 | ECDH_OpenSSL: function: PECDH_METHOD; cdecl = nil; 7 | 8 | ECDH_set_default_method: procedure(const _p: PECDH_METHOD); cdecl = nil; 9 | ECDH_get_default_method: function: PECDH_METHOD; cdecl = nil; 10 | ECDH_set_method: function(_key: PEC_KEY; const _p: PECDH_METHOD): TC_INT; cdecl = nil; 11 | 12 | ECDH_compute_key: function(_out: Pointer; outlen: TC_SIZE_T; const _pub_key: PEC_POINT; _ecdh: PEC_KEY; KDF: ecdh_kdf): TC_INT; cdecl = nil; 13 | 14 | ECDH_get_ex_new_index: function(_argl: TC_LONG; _argp: Pointer; _new_func: CRYPTO_EX_new; _dup_func: CRYPTO_EX_dup; _free_func: CRYPTO_EX_free): TC_INT; cdecl = nil; 15 | ECDH_set_ex_data: function(_d: PEC_KEY; _idx: TC_INT; _arg: Pointer): TC_INT; cdecl = nil; 16 | ECDH_get_ex_data: function(_d: Pointer; _idx: TC_INT): Pointer; cdecl = nil; 17 | 18 | ERR_load_ECDH_strings: procedure; cdecl = nil; 19 | 20 | 21 | procedure SSL_InitSSLDH; 22 | 23 | implementation 24 | uses ssl_lib; 25 | 26 | procedure SSL_InitSSLDH; 27 | begin 28 | if @ECDH_OpenSSL = nil then 29 | begin 30 | @ECDH_OpenSSL:= LoadFuncCLibCrypto('ECDH_OpenSSL'); 31 | 32 | @ECDH_set_default_method:= LoadFuncCLibCrypto('ECDH_set_default_method'); 33 | @ECDH_get_default_method:= LoadFuncCLibCrypto('ECDH_get_default_method'); 34 | @ECDH_set_method:= LoadFuncCLibCrypto('ECDH_set_method'); 35 | 36 | @ECDH_compute_key:= LoadFuncCLibCrypto('ECDH_compute_key'); 37 | 38 | @ECDH_get_ex_new_index:= LoadFuncCLibCrypto('ECDH_get_ex_new_index'); 39 | @ECDH_set_ex_data:= LoadFuncCLibCrypto('ECDH_set_ex_data'); 40 | @ECDH_get_ex_data:= LoadFuncCLibCrypto('ECDH_get_ex_data'); 41 | 42 | @ERR_load_ECDH_strings:= LoadFuncCLibCrypto('ERR_load_ECDH_strings'); 43 | 44 | end; 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_encode.pas: -------------------------------------------------------------------------------- 1 | unit ssl_encode; 2 | //base64相关加解密 3 | interface 4 | uses ssl_types; 5 | var 6 | EVP_EncodeInit: procedure(ctx: PEVP_ENCODE_CTX); cdecl = nil; 7 | EVP_EncodeUpdate: procedure(ctx: PEVP_ENCODE_CTX;_out: PAnsiChar;var outl: TC_INT; const _in: PAnsiChar;var inl: TC_INT); cdecl = nil; 8 | EVP_EncodeFinal: procedure(ctx: PEVP_ENCODE_CTX;_out: PAnsiChar;var outl: TC_INT); cdecl = nil; 9 | EVP_EncodeBlock: function(t: PByte; f: PByte; n: TC_INT): TC_INT; cdecl = nil; 10 | // 11 | EVP_DecodeInit: procedure(ctx: PEVP_ENCODE_CTX); cdecl = nil; 12 | EVP_DecodeUpdate: function(ctx: PEVP_ENCODE_CTX;_out: PAnsiChar;var outl: TC_INT; const _in: PAnsiChar; var inl: TC_INT): TC_INT; cdecl = nil; 13 | EVP_DecodeFinal: function(ctx: PEVP_ENCODE_CTX; _out: PAnsiChar; var outl: TC_INT): TC_INT; cdecl = nil; 14 | EVP_DecodeBlock: function(t: PByte; f: PByte; n: TC_INT): TC_INT; cdecl = nil; 15 | 16 | procedure SSL_InitEncode; 17 | implementation 18 | uses ssl_lib; 19 | procedure SSL_InitEncode; 20 | begin 21 | if @EVP_EncodeInit = nil then 22 | begin 23 | @EVP_EncodeInit := LoadFuncCLibCrypto('EVP_EncodeInit'); 24 | @EVP_EncodeUpdate := LoadFuncCLibCrypto('EVP_EncodeUpdate'); 25 | @EVP_EncodeFinal := LoadFuncCLibCrypto('EVP_EncodeFinal'); 26 | @EVP_EncodeBlock := LoadFuncCLibCrypto('EVP_EncodeBlock'); 27 | @EVP_DecodeInit := LoadFuncCLibCrypto('EVP_DecodeInit'); 28 | @EVP_DecodeUpdate := LoadFuncCLibCrypto('EVP_DecodeUpdate'); 29 | @EVP_DecodeFinal := LoadFuncCLibCrypto('EVP_DecodeFinal'); 30 | @EVP_DecodeBlock := LoadFuncCLibCrypto('EVP_DecodeBlock'); 31 | end; 32 | end; 33 | end. 34 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_evp.pas: -------------------------------------------------------------------------------- 1 | unit ssl_evp; 2 | 3 | interface 4 | uses ssl_types,ssl_typepointers; 5 | var 6 | EVP_DigestInit_ex: function(ctx: PTEVP_MD_CTX; const _type: PEVP_MD; impl: PENGINE): TC_INT; cdecl = nil; 7 | EVP_DigestUpdate: function(ctx: PTEVP_MD_CTX;const d: Pointer; cnt: TC_SIZE_T): TC_INT; cdecl = nil; 8 | EVP_DigestFinal_ex: function(ctx: PTEVP_MD_CTX;md: PByte;size: PCardinal): TC_INT; cdecl = nil; 9 | // 10 | EVP_CIPHER_CTX_new: function:PTEVP_CIPHER_CTX; cdecl = nil; 11 | EVP_CIPHER_CTX_free: procedure(a: PTEVP_CIPHER_CTX); cdecl = nil; 12 | // 13 | EVP_EncryptInit_ex: function(ctx: PTEVP_CIPHER_CTX;const cipher: PEVP_CIPHER; impl: PENGINE; 14 | const key: PByte; const iv: PByte): TC_INT; cdecl = nil; 15 | EVP_EncryptUpdate: function(ctx: PTEVP_CIPHER_CTX; _out: PByte;outl: PInteger; 16 | const _in: PByte; inl: TC_INT): TC_INT; cdecl = nil; 17 | EVP_EncryptFinal_ex: function(ctx: PTEVP_CIPHER_CTX; _out: PByte;outl: PInteger): TC_INT; cdecl = nil; 18 | // 19 | EVP_DecryptInit_ex: function(ctx: PTEVP_CIPHER_CTX;const cipher: PEVP_CIPHER; impl: PENGINE; 20 | const key: PByte; const iv: PByte): TC_INT; cdecl = nil; 21 | EVP_DecryptUpdate: function(ctx: PTEVP_CIPHER_CTX; _out: PByte;outl: PInteger; 22 | const _in: PByte; inl: TC_INT): TC_INT; cdecl = nil; 23 | EVP_DecryptFinal_ex: function(ctx: PTEVP_CIPHER_CTX; _out: PByte;outl: PInteger): TC_INT; cdecl = nil; 24 | // 25 | EVP_CIPHER_CTX_set_padding: function(ctx:PTEVP_CIPHER_CTX; pad:TC_INT): TC_INT; cdecl = nil; 26 | EVP_CIPHER_block_size:function (e:PTEVP_CIPHER): TC_INT; cdecl = nil; 27 | procedure SSL_InitEVP; 28 | implementation 29 | uses ssl_lib; 30 | procedure SSL_InitEVP; 31 | begin 32 | if @EVP_DigestInit_ex = nil then 33 | begin 34 | @EVP_DigestInit_ex := LoadFuncCLibCrypto('EVP_DigestInit_ex'); 35 | @EVP_DigestUpdate := LoadFuncCLibCrypto('EVP_DigestUpdate'); 36 | @EVP_DigestFinal_ex := LoadFuncCLibCrypto('EVP_DigestFinal_ex'); 37 | @EVP_CIPHER_CTX_new := LoadFuncCLibCrypto('EVP_CIPHER_CTX_new'); 38 | @EVP_CIPHER_CTX_free := LoadFuncCLibCrypto('EVP_CIPHER_CTX_free'); 39 | // 40 | @EVP_EncryptInit_ex := LoadFuncCLibCrypto('EVP_EncryptInit_ex'); 41 | @EVP_EncryptUpdate := LoadFuncCLibCrypto('EVP_EncryptUpdate'); 42 | @EVP_EncryptFinal_ex := LoadFuncCLibCrypto('EVP_EncryptFinal_ex'); 43 | 44 | @EVP_DecryptInit_ex := LoadFuncCLibCrypto('EVP_DecryptInit_ex'); 45 | @EVP_DecryptUpdate := LoadFuncCLibCrypto('EVP_DecryptUpdate'); 46 | @EVP_DecryptFinal_ex := LoadFuncCLibCrypto('EVP_DecryptFinal_ex'); 47 | 48 | // 49 | @EVP_CIPHER_CTX_set_padding := LoadFuncCLibCrypto('EVP_CIPHER_CTX_set_padding'); 50 | @EVP_CIPHER_block_size := LoadFuncCLibCrypto('EVP_CIPHER_block_size'); 51 | end; 52 | end; 53 | end. 54 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_evpmdctx.pas: -------------------------------------------------------------------------------- 1 | unit ssl_evpmdctx; 2 | 3 | interface 4 | 5 | uses ssl_types,ssl_typepointers; 6 | 7 | var 8 | EVP_MD_CTX_md_data: function(const ctx: PTEVP_MD_CTX): Pointer; cdecl=nil; 9 | EVP_MD_CTX_new: function():PTEVP_MD_CTX;cdecl=nil; 10 | EVP_MD_CTX_free:procedure(ctx:PTEVP_MD_CTX);cdecl=nil; 11 | 12 | procedure SSL_InitEVPMDCTX; 13 | 14 | implementation 15 | uses ssl_lib; 16 | procedure SSL_InitEVPMDCTX; 17 | begin 18 | if @EVP_MD_CTX_md_data = nil then 19 | begin 20 | @EVP_MD_CTX_md_data := LoadFuncCLibCrypto('EVP_MD_CTX_md_data'); 21 | @EVP_MD_CTX_new := LoadFuncCLibCrypto('EVP_MD_CTX_new'); 22 | @EVP_MD_CTX_free := LoadFuncCLibCrypto('EVP_MD_CTX_free'); 23 | end; 24 | end; 25 | end. 26 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_evppkey.pas: -------------------------------------------------------------------------------- 1 | unit ssl_evppkey; 2 | 3 | interface 4 | uses ssl_types,ssl_typepointers,system.SysUtils; 5 | var 6 | EVP_PKEY_CTX_new: function(pkey: PTEVP_PKEY; e: PTENGINE): PTEVP_PKEY_CTX; cdecl = nil; 7 | EVP_PKEY_CTX_new_id: function(i:integer; e: PTENGINE): PTEVP_PKEY_CTX; cdecl = nil; 8 | EVP_PKEY_CTX_free:procedure(ctx:PTEVP_PKEY_CTX);cdecl = nil; 9 | // 10 | EVP_PKEY_encrypt_init:function(ctx:PTEVP_PKEY_CTX):integer;cdecl = nil; 11 | EVP_PKEY_encrypt:function(ctx:PTEVP_PKEY_CTX;_out:PByte;outlen:PCardinal;_in:PByte;inlen:Cardinal):integer;cdecl = nil; 12 | // 13 | EVP_PKEY_decrypt_init:function(ctx:PTEVP_PKEY_CTX):integer;cdecl = nil; 14 | EVP_PKEY_decrypt:function(ctx:PTEVP_PKEY_CTX;_out:PByte;outlen:PCardinal;_in:PByte;inlen:Cardinal):integer;cdecl = nil; 15 | 16 | procedure SSL_InitEVP_PKEY; 17 | implementation 18 | uses ssl_lib; 19 | procedure SSL_InitEVP_PKEY; 20 | begin 21 | if @EVP_PKEY_CTX_new = nil then 22 | begin 23 | @EVP_PKEY_CTX_new := LoadFuncCLibCrypto('EVP_PKEY_CTX_new'); 24 | @EVP_PKEY_CTX_new_id := LoadFuncCLibCrypto('EVP_PKEY_CTX_new_id'); 25 | @EVP_PKEY_CTX_free := LoadFuncCLibCrypto('EVP_PKEY_CTX_free'); 26 | @EVP_PKEY_encrypt_init := LoadFuncCLibCrypto('EVP_PKEY_encrypt_init'); 27 | @EVP_PKEY_encrypt := LoadFuncCLibCrypto('EVP_PKEY_encrypt'); 28 | @EVP_PKEY_decrypt_init := LoadFuncCLibCrypto('EVP_PKEY_decrypt_init'); 29 | @EVP_PKEY_decrypt := LoadFuncCLibCrypto('EVP_PKEY_decrypt'); 30 | end; 31 | end; 32 | end. 33 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_hmac.pas: -------------------------------------------------------------------------------- 1 | unit ssl_hmac; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | HMAC_CTX_init: procedure(_ctx: PHMAC_CTX); cdecl = nil; 8 | HMAC_CTX_cleanup: procedure(_ctx: PHMAC_CTX); cdecl = nil; 9 | 10 | HMAC_Init: function(_ctx: PHMAC_CTX; const _key: Pointer; _len: TC_INT;const _md: PEVP_MD): TC_INT; cdecl = nil; 11 | HMAC_Init_ex: function(_ctx: PHMAC_CTX; const _key: Pointer; _len: TC_INT;const _md: PEVP_MD; _impl: PENGINE): TC_INT; cdecl = nil; 12 | HMAC_Update: function(_ctx: PHMAC_CTX; const _data: PAnsiChar; _len: TC_SIZE_T): TC_INT; cdecl = nil; 13 | HMAC_Final: function(_ctx: PHMAC_CTX; _md: PAnsiChar; var _len: TC_UINT): TC_INT; cdecl = nil; 14 | HMAC: function(const _evp_md: PEVP_MD; const _key: Pointer; _key_len: TC_INT; const _d: PAnsiChar; _n: TC_SIZE_T; _md: PAnsiChar; var _md_len: TC_UINT): PAnsiChar; cdecl = nil; 15 | HMAC_CTX_copy: function(_dctx: PHMAC_CTX; _sctx: PHMAC_CTX): TC_INT; cdecl = nil; 16 | 17 | HMAC_CTX_set_flags: procedure(_ctx: PHMAC_CTX; _flags: TC_ULONG); cdecl = nil; 18 | 19 | procedure SSL_InitHMAC; 20 | implementation 21 | uses ssl_lib; 22 | 23 | procedure SSL_InitHMAC; 24 | begin 25 | 26 | if @HMAC_CTX_init = nil then 27 | begin 28 | @HMAC_CTX_init:= LoadFuncCLibCrypto('HMAC_CTX_init'); 29 | @HMAC_CTX_cleanup:= LoadFuncCLibCrypto('HMAC_CTX_cleanup'); 30 | @HMAC_Init:= LoadFuncCLibCrypto('HMAC_Init'); 31 | @HMAC_Init_ex:= LoadFuncCLibCrypto('HMAC_Init_ex'); 32 | @HMAC_Update:= LoadFuncCLibCrypto('HMAC_Update'); 33 | @HMAC_Final:= LoadFuncCLibCrypto('HMAC_Final'); 34 | @HMAC:= LoadFuncCLibCrypto('HMAC'); 35 | @HMAC_CTX_copy:= LoadFuncCLibCrypto('HMAC_CTX_copy'); 36 | @HMAC_CTX_set_flags:= LoadFuncCLibCrypto('HMAC_CTX_set_flags'); 37 | end; 38 | 39 | end; 40 | 41 | end. 42 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_idea.pas: -------------------------------------------------------------------------------- 1 | unit ssl_idea; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | idea_options: function: PAnsiChar; cdecl = nil; 8 | idea_ecb_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _ks: PIDEA_KEY_SCHEDULE); cdecl = nil; 9 | private_idea_set_encrypt_key: procedure(const _key: PAnsiChar; _ks: PIDEA_KEY_SCHEDULE); cdecl = nil; 10 | idea_set_encrypt_key: procedure(const _key: PAnsiChar; _ks: PIDEA_KEY_SCHEDULE); cdecl = nil; 11 | idea_set_decrypt_key: procedure(_ek: PIDEA_KEY_SCHEDULE; _dk: PIDEA_KEY_SCHEDULE); cdecl = nil; 12 | idea_cbc_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _ks: PIDEA_KEY_SCHEDULE; _iv: PAnsiChar; _enc: TC_INT); cdecl = nil; 13 | idea_cfb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _ks: PIDEA_KEY_SCHEDULE; _iv: PAnsiChar; var _num: TC_INT; _enc: TC_INT); cdecl = nil; 14 | idea_ofb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _ks: PIDEA_KEY_SCHEDULE; _iv: PAnsiChar; var _num: TC_INT); cdecl = nil; 15 | idea_encrypt: procedure(var _in: TC_LONG; _ks: PIDEA_KEY_SCHEDULE); cdecl = nil; 16 | 17 | procedure SSL_InitIDEA; 18 | 19 | implementation 20 | uses ssl_lib; 21 | 22 | procedure SSL_InitIDEA; 23 | begin 24 | if @idea_options = nil then 25 | begin 26 | @idea_options:= LoadFuncCLibCrypto('idea_options'); 27 | @idea_ecb_encrypt:= LoadFuncCLibCrypto('idea_ecb_encrypt'); 28 | @private_idea_set_encrypt_key:= LoadFuncCLibCrypto('private_idea_set_encrypt_key', false); 29 | @idea_set_encrypt_key:= LoadFuncCLibCrypto('idea_set_encrypt_key'); 30 | @idea_set_decrypt_key:= LoadFuncCLibCrypto('idea_set_decrypt_key'); 31 | @idea_cbc_encrypt:= LoadFuncCLibCrypto('idea_cbc_encrypt'); 32 | @idea_cfb64_encrypt:= LoadFuncCLibCrypto('idea_cfb64_encrypt'); 33 | @idea_ofb64_encrypt:= LoadFuncCLibCrypto('idea_ofb64_encrypt'); 34 | @idea_encrypt:= LoadFuncCLibCrypto('idea_encrypt'); 35 | end; 36 | end; 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_init.pas: -------------------------------------------------------------------------------- 1 | unit ssl_init; 2 | 3 | interface 4 | 5 | procedure SSL_InitLib; 6 | 7 | implementation 8 | 9 | uses 10 | ssl_ec, ssl_util, ssl_types, ssl_lib, ssl_evp, ssl_const, ssl_rsa, ssl_dsa, ssl_x509, ssl_bio, ssl_pem, ssl_asn, 11 | ssl_aes, ssl_bf, ssl_bn, ssl_buffer, ssl_cast, ssl_cmac, ssl_engine, ssl_rand, ssl_camellia, ssl_comp, ssl_des, 12 | ssl_dh, ssl_err, ssl_objects, ssl_sk, ssl_pkcs12, ssl_pkcs7, ssl_cms, ssl_ecdh, ssl_ecdsa, ssl_hmac, ssl_idea, 13 | ssl_lhash, ssl_md4, ssl_md5, ssl_ocsp, ssl_mdc2, ssl_rc2, ssl_rc4, ssl_rc5, ssl_ripemd, ssl_sha; 14 | 15 | 16 | procedure SSL_InitLib; 17 | begin 18 | ssl_util.SSL_InitUtil; 19 | ssl_err.SSL_InitERR; 20 | ssl_objects.SSL_InitOBJ; 21 | ssl_bio.SSL_InitBIO; 22 | ssl_ec.SSL_InitEC; 23 | ssl_evp.SSL_InitEVP; 24 | ssl_rsa.SSL_InitRSA; 25 | ssl_dsa.SSL_InitDSA; 26 | ssl_x509.SSL_InitX509; 27 | ssl_pem.SSL_InitPEM; 28 | ssl_asn.SSL_InitASN1; 29 | ssl_aes.SSL_InitAES; 30 | ssl_bf.SSL_InitBF; 31 | ssl_bn.SSL_InitBN; 32 | ssl_buffer.SSL_InitBuffer; 33 | ssl_cast.SLL_InitCAST; 34 | ssl_cmac.SSL_InitCMAC; 35 | ssl_engine.SSL_InitENGINE; 36 | ssl_rand.SSL_InitRAND; 37 | ssl_camellia.SSL_InitCAMELLIA; 38 | ssl_comp.SSL_InitCOMP; 39 | ssl_des.SSL_InitDES; 40 | ssl_dh.SSL_InitDH; 41 | ssl_sk.SSL_initSk; 42 | ssl_pkcs12.SSL_InitPKCS12; 43 | ssl_pkcs7.SSL_InitPKCS7; 44 | ssl_cms.SSL_InitCMS; 45 | ssl_ecdh.SSL_InitSSLDH; 46 | ssl_ecdsa.SSL_InitECDSA; 47 | ssl_hmac.SSL_InitHMAC; 48 | ssl_idea.SSL_InitIDEA; 49 | ssl_lhash.SSL_InitLHASH; 50 | ssl_md4.SSL_InitMD4; 51 | ssl_md5.SSL_InitMD5; 52 | ssl_ocsp.SSL_InitOCSP; 53 | ssl_mdc2.ssl_initmdc2; 54 | ssl_rc2.SSL_Initrc2; 55 | ssl_rc4.SSL_Initrc4; 56 | ssl_rc5.SSL_Initrc5; 57 | ssl_ripemd.SSL_Initripemd; 58 | ssl_sha.ssl_Initsha; 59 | end; 60 | 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_lhash.pas: -------------------------------------------------------------------------------- 1 | unit ssl_lhash; 2 | 3 | interface 4 | uses ssl_types; 5 | var 6 | lh_new: function(h: LHASH_HASH_FN_TYPE; c: LHASH_COMP_FN_TYPE): P_LHASH; cdecl = nil; 7 | lh_free: procedure(_lh: P_LHASH); cdecl = nil; 8 | lh_insert: function(_lh: P_LHASH; _data: Pointer): Pointer; cdecl = nil; 9 | lh_delete: function(_lh: P_LHASH; const _data: Pointer): Pointer; cdecl = nil; 10 | lh_retrieve: function(_lh: P_LHASH; const _data: Pointer): Pointer; cdecl = nil; 11 | lh_doall: procedure(_lh: P_LHASH; func: LHASH_DOALL_FN_TYPE); cdecl = nil; 12 | lh_doall_arg: procedure(_lh: P_LHASH; func: LHASH_DOALL_ARG_FN_TYPE; _arg: Pointer); cdecl = nil; 13 | lh_strhash: function(const _c: PAnsiChar): TC_ULONG; cdecl = nil; 14 | lh_num_items: function(const _lh: P_LHASH): TC_ULONG; cdecl = nil; 15 | lh_stats_bio: procedure(const _lh: P_LHASH; _out: PBIO); cdecl = nil; 16 | lh_node_stats_bio: procedure(const _lh: P_LHASH; _out: PBIO); cdecl = nil; 17 | lh_node_usage_stats_bio: procedure(const _lh: P_LHASH; _out: PBIO); cdecl = nil; 18 | 19 | procedure SSL_InitLHASH; 20 | 21 | implementation 22 | uses ssl_lib; 23 | 24 | procedure SSL_InitLHASH; 25 | begin 26 | if @lh_new = nil then 27 | begin 28 | @lh_new:= LoadFuncCLibCrypto('lh_new'); 29 | @lh_free:= LoadFuncCLibCrypto('lh_free'); 30 | @lh_insert:= LoadFuncCLibCrypto('lh_insert'); 31 | @lh_delete:= LoadFuncCLibCrypto('lh_delete'); 32 | @lh_retrieve:= LoadFuncCLibCrypto('lh_retrieve'); 33 | @lh_doall:= LoadFuncCLibCrypto('lh_doall'); 34 | @lh_doall_arg:= LoadFuncCLibCrypto('lh_doall_arg'); 35 | @lh_strhash:= LoadFuncCLibCrypto('lh_strhash'); 36 | @lh_num_items:= LoadFuncCLibCrypto('lh_num_items'); 37 | @lh_stats_bio:= LoadFuncCLibCrypto('lh_stats_bio'); 38 | @lh_node_stats_bio:= LoadFuncCLibCrypto('lh_node_stats_bio'); 39 | @lh_node_usage_stats_bio:= LoadFuncCLibCrypto('lh_node_usage_stats_bio'); 40 | end; 41 | 42 | end; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_md4.pas: -------------------------------------------------------------------------------- 1 | unit ssl_md4; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | MD4_Init: function(_c: PMD4_CTX): TC_INT; cdecl = nil; 8 | MD4_Update: function(_c: PMD4_CTX; const _data: Pointer; _len: TC_SIZE_T): TC_INT; cdecl = nil; 9 | MD4_Final: function(_md: PAnsiChar; _c: PMD4_CTX): TC_INT; cdecl = nil; 10 | MD4: function(const _d: PByte; _n: TC_SIZE_T; _md: PByte): PByte; cdecl = nil; 11 | MD4_Transform: procedure(_c: PMD4_CTX; const _b: PAnsiChar); cdecl = nil; 12 | 13 | procedure SSL_InitMD4; 14 | 15 | implementation 16 | uses ssl_lib; 17 | 18 | procedure SSL_InitMD4; 19 | begin 20 | if @MD4_Init = nil then 21 | begin 22 | @MD4_Init:= LoadFuncCLibCrypto('MD4_Init'); 23 | @MD4_Update:= LoadFuncCLibCrypto('MD4_Update'); 24 | @MD4_Final:= LoadFuncCLibCrypto('MD4_Final'); 25 | @MD4:= LoadFuncCLibCrypto('MD4'); 26 | @MD4_Transform:= LoadFuncCLibCrypto('MD4_Transform'); 27 | end; 28 | end; 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_md5.pas: -------------------------------------------------------------------------------- 1 | unit ssl_md5; 2 | //md5��ؼӽ��� 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | MD5_Init: function(_c: PMD5_CTX): TC_INT; cdecl = nil; 8 | MD5_Update: function(_c: PMD5_CTX; const _data: Pointer; _len: TC_SIZE_T): TC_INT; cdecl = nil; 9 | MD5_Final: function(_md: PByte; _c: PMD5_CTX): TC_INT; cdecl = nil; 10 | MD5: function(const _d: PByte; _n: TC_SIZE_T; _md: PByte): PByte; cdecl = nil; 11 | MD5_Transform: procedure(_c: PMD5_CTX; const _b: PByte); cdecl = nil; 12 | 13 | procedure SSL_InitMD5; 14 | 15 | implementation 16 | uses ssl_lib; 17 | 18 | procedure SSL_InitMD5; 19 | begin 20 | if @MD5_Init = nil then 21 | begin 22 | @MD5_Init := LoadFuncCLibCrypto('MD5_Init'); 23 | @MD5_Update := LoadFuncCLibCrypto('MD5_Update'); 24 | @MD5_Final := LoadFuncCLibCrypto('MD5_Final'); 25 | @MD5 := LoadFuncCLibCrypto('MD5'); 26 | @MD5_Transform := LoadFuncCLibCrypto('MD5_Transform'); 27 | end; 28 | end; 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_mdc2.pas: -------------------------------------------------------------------------------- 1 | unit ssl_mdc2; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | MDC2_Init: function(_c: PMDC2_CTX): TC_INT; cdecl = nil; 8 | MDC2_Update: function(_c: PMDC2_CTX; const _data: PAnsiChar; _len: TC_SIZE_T): TC_INT; cdecl = nil; 9 | MDC2_Final: function(_md: PAnsiChar; _c: PMDC2_CTX): TC_INT; cdecl = nil; 10 | MDC2: function(const _d: PAnsiChar; _n: TC_SIZE_T;_md: PAnsiChar): PAnsiChar; cdecl = nil; 11 | 12 | 13 | procedure SSL_InitMDC2; 14 | 15 | implementation 16 | uses ssl_lib; 17 | 18 | procedure SSL_InitMDC2; 19 | begin 20 | if @MDC2_Init = nil then 21 | begin 22 | @MDC2_Init:= LoadFuncCLibCrypto('MDC2_Init'); 23 | @MDC2_Update:= LoadFuncCLibCrypto('MDC2_Update'); 24 | @MDC2_Final:= LoadFuncCLibCrypto('MDC2_Final'); 25 | @MDC2:= LoadFuncCLibCrypto('MDC2'); 26 | end; 27 | end; 28 | 29 | end. 30 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_pem.pas: -------------------------------------------------------------------------------- 1 | unit ssl_pem; 2 | 3 | interface 4 | uses ssl_typepointers; 5 | 6 | var 7 | PEM_read_PUBKEY: function (var fp: FILE; x: pointer; cb: pointer; u: pointer): PTEVP_PKEY; cdecl = nil; 8 | procedure SSL_InitPEM; 9 | 10 | implementation 11 | uses ssl_lib; 12 | 13 | procedure SSL_InitPEM; 14 | begin 15 | if @PEM_read_PUBKEY = nil then 16 | begin 17 | @PEM_read_PUBKEY := LoadFuncCLibCrypto('PEM_read_PUBKEY'); 18 | end; 19 | end; 20 | 21 | end. 22 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_rand.pas: -------------------------------------------------------------------------------- 1 | unit ssl_rand; 2 | interface 3 | uses ssl_types; 4 | var 5 | RAND_set_rand_method: function(const meth: PRAND_METHOD): TC_INT; cdecl = nil; 6 | RAND_get_rand_method: function: PRAND_METHOD; cdecl = nil; 7 | RAND_set_rand_engine: function(engine: PENGINE): TC_INT; cdecl = nil; 8 | RAND_SSLeay: function: PRAND_METHOD; cdecl = nil; 9 | RAND_cleanup: procedure; cdecl = nil; 10 | RAND_bytes: function(buf: PAnsiChar; num: TC_INT): TC_INT; cdecl = nil; 11 | RAND_pseudo_bytes: function(buf: PAnsiChar; num: TC_INT): TC_INT; cdecl = nil; 12 | RAND_seed: procedure(buf: Pointer; num: TC_INT); cdecl = nil; 13 | RAND_add: procedure(buf: Pointer; num: TC_INT; entropy: double); cdecl = nil; 14 | RAND_load_file: function(_file: PAnsiChar; max_bytes: TC_LONG): TC_INT; cdecl = nil; 15 | RAND_write_file: function(_file: PAnsiChar): TC_INT; cdecl = nil; 16 | RAND_file_name: function(_file: PAnsiChar; num: TC_size_t ): PAnsiChar; cdecl = nil; 17 | RAND_status: function: TC_INT; cdecl = nil; 18 | RAND_query_egd_bytes: function(path: PAnsiChar; buf: PAnsiChar; bytes: TC_INT): TC_INT; cdecl = nil; 19 | RAND_egd: function(path: PAnsiChar): TC_INT; cdecl = nil; 20 | RAND_egd_bytes: function(path: PAnsiChar; bytes: TC_INT): TC_INT; cdecl = nil; 21 | RAND_poll: function: TC_INT; cdecl = nil; 22 | 23 | RAND_screen: procedure; cdecl; 24 | //int RAND_event(UINT, WPARAM, LPARAM); 25 | 26 | RAND_set_fips_drbg_type: procedure(_type: TC_INT; flags: TC_INT); cdecl = nil; 27 | RAND_init_fips: function: TC_INT; cdecl = nil; 28 | ERR_load_RAND_strings: procedure; cdecl = nil; 29 | 30 | procedure SSL_InitRAND; 31 | 32 | implementation 33 | uses ssl_lib; 34 | 35 | procedure SSL_InitRAND; 36 | begin 37 | if @RAND_set_rand_method = nil then 38 | begin 39 | @RAND_set_rand_method:= LoadFuncCLibCrypto('RAND_set_rand_method'); 40 | @RAND_get_rand_method:= LoadFuncCLibCrypto('RAND_get_rand_method'); 41 | @RAND_set_rand_engine:= LoadFuncCLibCrypto('RAND_set_rand_engine'); 42 | @RAND_SSLeay:= LoadFuncCLibCrypto('RAND_SSLeay'); 43 | @RAND_cleanup:= LoadFuncCLibCrypto('RAND_cleanup'); 44 | @RAND_bytes:= LoadFuncCLibCrypto('RAND_bytes'); 45 | @RAND_pseudo_bytes:= LoadFuncCLibCrypto('RAND_pseudo_bytes'); 46 | @RAND_seed:= LoadFuncCLibCrypto('RAND_seed'); 47 | @RAND_add:= LoadFuncCLibCrypto('RAND_add'); 48 | @RAND_load_file:= LoadFuncCLibCrypto('RAND_load_file'); 49 | @RAND_write_file:= LoadFuncCLibCrypto('RAND_write_file'); 50 | @RAND_file_name:= LoadFuncCLibCrypto('RAND_file_name'); 51 | @RAND_status:= LoadFuncCLibCrypto('RAND_status'); 52 | @RAND_query_egd_bytes:= LoadFuncCLibCrypto('RAND_query_egd_bytes'); 53 | @RAND_egd:= LoadFuncCLibCrypto('RAND_egd'); 54 | @RAND_egd_bytes:= LoadFuncCLibCrypto('RAND_egd_bytes'); 55 | @RAND_poll:= LoadFuncCLibCrypto('RAND_poll'); 56 | @RAND_screen:= LoadFuncCLibCrypto('RAND_screen'); 57 | @RAND_set_fips_drbg_type:= LoadFuncCLibCrypto('RAND_set_fips_drbg_type', false); 58 | @RAND_init_fips:= LoadFuncCLibCrypto('RAND_init_fips', false); 59 | @ERR_load_RAND_strings:= LoadFuncCLibCrypto('ERR_load_RAND_strings'); 60 | end; 61 | end; 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_rc2.pas: -------------------------------------------------------------------------------- 1 | unit ssl_rc2; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | RC2_set_key: procedure(_key: PRC2_KEY; _len: TC_INT; const _data: PAnsiChar;_bits: TC_INT); cdecl = nil; 8 | RC2_ecb_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _key: PRC2_KEY; _enc: TC_INT); cdecl = nil; 9 | RC2_encrypt: procedure(_data: PC_ULONG;_key: PRC2_KEY); cdecl = nil; 10 | RC2_decrypt: procedure(_data: PC_ULONG;_key: PRC2_KEY); cdecl = nil; 11 | RC2_cbc_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _ks: PRC2_KEY; _iv: PAnsiChar; _enc: TC_INT); cdecl = nil; 12 | RC2_cfb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _schedule: PRC2_KEY; _ivec: PAnsiChar; var _num: TC_INT; _enc: TC_INT); cdecl = nil; 13 | RC2_ofb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _schedule: PRC2_KEY; _ivec: PAnsiChar; var _num: TC_INT); cdecl = nil; 14 | 15 | procedure SSL_Initrc2; 16 | 17 | implementation 18 | uses ssl_lib; 19 | 20 | procedure SSL_Initrc2; 21 | begin 22 | if @RC2_encrypt = nil then 23 | begin 24 | @RC2_set_key:= LoadFuncCLibCrypto('RC2_set_key'); 25 | @RC2_ecb_encrypt:= LoadFuncCLibCrypto('RC2_ecb_encrypt'); 26 | @RC2_encrypt:= LoadFuncCLibCrypto('RC2_encrypt'); 27 | @RC2_decrypt:= LoadFuncCLibCrypto('RC2_decrypt'); 28 | @RC2_cbc_encrypt:= LoadFuncCLibCrypto('RC2_cbc_encrypt'); 29 | @RC2_cfb64_encrypt:= LoadFuncCLibCrypto('RC2_cfb64_encrypt'); 30 | @RC2_ofb64_encrypt:= LoadFuncCLibCrypto('RC2_ofb64_encrypt'); 31 | end; 32 | 33 | end; 34 | 35 | end. 36 | 37 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_rc4.pas: -------------------------------------------------------------------------------- 1 | unit ssl_rc4; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | RC4_options: function: PAnsiChar; cdecl = nil; 8 | RC4_set_key: procedure(_key: PRC4_KEY; _len: TC_INT; const _data: PAnsiChar); cdecl = nil; 9 | private_RC4_set_key: procedure(_key: PRC4_KEY; _len: TC_INT; const _data: PAnsiChar); cdecl = nil; 10 | RC4: procedure(_key: PRC4_KEY; _len: TC_SIZE_T; const _indata: PAnsiChar; _outdata: PAnsiChar); cdecl = nil; 11 | 12 | procedure SSL_Initrc4; 13 | 14 | implementation 15 | uses ssl_lib; 16 | 17 | procedure SSL_Initrc4; 18 | begin 19 | if @RC4_options = nil then 20 | begin 21 | @RC4_options:= LoadFuncCLibCrypto('RC4_options'); 22 | @RC4_set_key:= LoadFuncCLibCrypto('RC4_set_key'); 23 | @private_RC4_set_key:= LoadFuncCLibCrypto('private_RC4_set_key'); 24 | @RC4:= LoadFuncCLibCrypto('RC4'); 25 | end; 26 | 27 | end; 28 | 29 | end. 30 | 31 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_rc5.pas: -------------------------------------------------------------------------------- 1 | unit ssl_rc5; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | RC5_32_set_key: procedure(_key: PRC5_32_KEY; _len: TC_INT; const _data: PAnsiChar; _rounds: TC_INT); cdecl = nil; 8 | RC5_32_ecb_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _key: PRC5_32_KEY; _enc: TC_INT); cdecl = nil; 9 | RC5_32_encrypt: procedure(_data: PC_ULONG; _key: PRC5_32_KEY); cdecl = nil; 10 | RC5_32_decrypt: procedure(data: PC_ULONG; _key: PRC5_32_KEY); cdecl = nil; 11 | RC5_32_cbc_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _ks: PRC5_32_KEY; _iv: PAnsiChar; _enc: TC_INT); cdecl = nil; 12 | RC5_32_cfb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _schedule: PRC5_32_KEY; _ivec: PAnsiChar; var _num: TC_INT; _enc: TC_INT); cdecl = nil; 13 | RC5_32_ofb64_encrypt: procedure(const _in: PAnsiChar; _out: PAnsiChar; _length: TC_LONG; _schedule: PRC5_32_KEY; _ivec: PAnsiChar; var _num: TC_INT); cdecl = nil; 14 | 15 | procedure SSL_Initrc5; 16 | 17 | implementation 18 | uses ssl_lib; 19 | 20 | procedure SSL_Initrc5; 21 | begin 22 | if @RC5_32_encrypt = nil then 23 | begin 24 | @RC5_32_set_key:= LoadFuncCLibCrypto('RC5_32_set_key', false); 25 | @RC5_32_ecb_encrypt:= LoadFuncCLibCrypto('RC5_32_ecb_encrypt', false); 26 | @RC5_32_encrypt:= LoadFuncCLibCrypto('RC5_32_encrypt', false); 27 | @RC5_32_decrypt:= LoadFuncCLibCrypto('RC5_32_decrypt', false); 28 | @RC5_32_cbc_encrypt:= LoadFuncCLibCrypto('RC5_32_cbc_encrypt', false); 29 | @RC5_32_cfb64_encrypt:= LoadFuncCLibCrypto('RC5_32_cfb64_encrypt', false); 30 | @RC5_32_ofb64_encrypt:= LoadFuncCLibCrypto('RC5_32_ofb64_encrypt', false); 31 | end; 32 | end; 33 | 34 | end. 35 | 36 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_ripemd.pas: -------------------------------------------------------------------------------- 1 | unit ssl_ripemd; 2 | 3 | interface 4 | uses ssl_types; 5 | 6 | var 7 | RIPEMD160_Init: function(_c: PRIPEMD160_CTX): TC_INT; cdecl = nil; 8 | RIPEMD160_Update: function(_c: PRIPEMD160_CTX; const _data: Pointer; _len: TC_SIZE_T): TC_INT; cdecl = nil; 9 | RIPEMD160_Final: function(_md: PAnsiChar; _c: PRIPEMD160_CTX): TC_INT; cdecl = nil; 10 | RIPEMD160: function(const _d: PAnsiChar; _n: TC_SIZE_T; _md: PAnsiChar): PAnsiChar; cdecl = nil; 11 | RIPEMD160_Transform: procedure(_c: PRIPEMD160_CTX; const _b: PAnsiChar); cdecl = nil; 12 | 13 | procedure SSL_Initripemd; 14 | 15 | implementation 16 | uses ssl_lib; 17 | 18 | procedure SSL_Initripemd; 19 | begin 20 | if @RIPEMD160_Init = nil then 21 | begin 22 | @RIPEMD160_Init:= LoadFuncCLibCrypto('RIPEMD160_Init'); 23 | @RIPEMD160_Update:= LoadFuncCLibCrypto('RIPEMD160_Update'); 24 | @RIPEMD160_Final:= LoadFuncCLibCrypto('RIPEMD160_Final'); 25 | @RIPEMD160:= LoadFuncCLibCrypto('RIPEMD160'); 26 | @RIPEMD160_Transform:= LoadFuncCLibCrypto('RIPEMD160_Transform'); 27 | end; 28 | end; 29 | 30 | end. 31 | 32 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_sk.pas: -------------------------------------------------------------------------------- 1 | unit ssl_sk; 2 | 3 | interface 4 | uses ssl_types; 5 | var 6 | sk_value: function (_stack: PSTACK_OF; _i: TC_INT): Pointer; cdecl = nil; 7 | sk_new_null: function: PSTACK_OF; cdecl = nil; 8 | sk_push: function(st: PSTACK_OF; data: Pointer): TC_INT; cdecl = nil; 9 | sk_pop_free: procedure(st: PSTACK_OF; func: SK_POP_FREE_PROC); cdecl = nil; 10 | sk_free: procedure(_stack: PSTACK_OF); cdecl = nil; 11 | 12 | function sk_X509_NAME_ENTRY_value(_stack: PSTACK_OF_X509_NAME_ENTRY; i: Integer): PX509_NAME_ENTRY; 13 | function sk_X509_EXTENSION_new_null: PSTACK_OF_X509_EXTENSION; 14 | function sk_X509_EXTENSION_push(_stak: PSTACK_OF_X509_EXTENSION; data: Pointer): TC_INT; 15 | procedure sk_X509_EXTENSION_pop_free(st: PSTACK_OF_X509_EXTENSION; func: SK_POP_FREE_PROC); 16 | procedure sk_X509_EXTENSION_free(st: PSTACK_OF_X509_EXTENSION); 17 | 18 | function sk_X509_new_null: PSTACK_OF_X509; 19 | function sk_X509_push(_stak: PSTACK_OF_X509; data: Pointer): TC_INT; 20 | procedure SSL_initSk; 21 | 22 | implementation 23 | uses ssl_lib; 24 | 25 | function sk_X509_NAME_ENTRY_value(_stack: PSTACK_OF_X509_NAME_ENTRY; i: Integer): PX509_NAME_ENTRY; 26 | begin 27 | Result := sk_value(_stack, i); 28 | end; 29 | 30 | function sk_X509_EXTENSION_new_null: PSTACK_OF_X509_EXTENSION; 31 | begin 32 | Result := sk_new_null; 33 | end; 34 | 35 | function sk_X509_new_null: PSTACK_OF_X509; 36 | begin 37 | Result := sk_new_null; 38 | end; 39 | 40 | function sk_X509_EXTENSION_push(_stak: PSTACK_OF_X509_EXTENSION; data: Pointer): TC_INT; 41 | begin 42 | Result := sk_push(_stak, data); 43 | end; 44 | 45 | function sk_X509_push(_stak: PSTACK_OF_X509; data: Pointer): TC_INT; 46 | begin 47 | Result := sk_push(_stak, data); 48 | end; 49 | 50 | procedure sk_X509_EXTENSION_pop_free(st: PSTACK_OF_X509_EXTENSION; func: SK_POP_FREE_PROC); 51 | begin 52 | sk_pop_free(st, func); 53 | end; 54 | 55 | procedure sk_X509_EXTENSION_free(st: PSTACK_OF_X509_EXTENSION); 56 | begin 57 | sk_free(st); 58 | end; 59 | 60 | procedure SSL_initSk; 61 | begin 62 | if @sk_value = nil then 63 | begin 64 | @sk_value := LoadFuncCLibCrypto('sk_value'); 65 | @sk_new_null := LoadFuncCLibCrypto('sk_new_null'); 66 | @sk_push := LoadFuncCLibCrypto('sk_push'); 67 | @sk_pop_free := LoadFuncCLibCrypto('sk_pop_free'); 68 | @sk_free := LoadFuncCLibCrypto('sk_free'); 69 | end; 70 | end; 71 | 72 | end. 73 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_sm2.pas: -------------------------------------------------------------------------------- 1 | unit ssl_sm2; 2 | 3 | interface 4 | uses ssl_types,ssl_typepointers, SysUtils,math; 5 | 6 | function SM2Encrypt(input: TBytes;publicKeyFile:string; var outPut: TBytes): boolean; 7 | 8 | procedure SSL_InitSM2; 9 | implementation 10 | uses ssl_evppkey,ssl_pem; 11 | procedure SSL_InitSM2; 12 | begin 13 | SSL_InitEVP_PKEY(); 14 | SSL_InitPEM(); 15 | end; 16 | function SM2Encrypt(input: TBytes;publicKeyFile:string; var outPut: TBytes): boolean; 17 | var 18 | iFileHand:integer; 19 | pub_key_file: File; 20 | pub_key: PTEVP_PKEY; 21 | ctx:PTEVP_PKEY_CTX; 22 | iInLen,iOutLen:Cardinal; 23 | tempI:Integer; 24 | begin 25 | Result := false; 26 | ctx :=nil; 27 | AssignFile(pub_key_file, publicKeyFile); 28 | Reset(pub_key_file); 29 | try 30 | pub_key := PEM_read_PUBKEY(pub_key_file, nil, nil, nil); 31 | if pub_key=nil then 32 | begin 33 | raise Exception.Create('pub_key_file fail'); 34 | exit; 35 | end; 36 | ctx := EVP_PKEY_CTX_new(pub_key, nil); 37 | if ctx=nil then 38 | begin 39 | raise Exception.Create('EVP_PKEY_CTX_new fail'); 40 | exit; 41 | end; 42 | 43 | tempI := EVP_PKEY_encrypt_init(ctx); 44 | if tempI<=0 then 45 | begin 46 | raise Exception.Create('EVP_PKEY_encrypt_init fail'); 47 | exit; 48 | end; 49 | iInLen := length(input); 50 | iOutLen := 0; 51 | tempI := EVP_PKEY_encrypt(ctx,@outPut[0],@iOutLen,@input[0],iInLen); 52 | if tempI<=0 then 53 | begin 54 | raise Exception.Create('EVP_PKEY_encrypt fail'); 55 | exit; 56 | end; 57 | Result := true; 58 | finally 59 | if ctx<>nil then 60 | EVP_PKEY_CTX_free(ctx); 61 | Close(pub_key_file); 62 | end; 63 | end; 64 | end. 65 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_sm3.pas: -------------------------------------------------------------------------------- 1 | unit ssl_sm3; 2 | 3 | interface 4 | 5 | uses ssl_types, SysUtils,ssl_typepointers; 6 | 7 | const 8 | SM3_DIGEST_LENGTH = 32; 9 | SM3_CBLOCK = 64; 10 | SM3_LBLOCK = 16; 11 | 12 | type 13 | SM3_WORD = Cardinal; 14 | 15 | PSM3_CTX = ^SM3_CTX; 16 | 17 | SM3_CTX = record 18 | A, B, C, D, E, F, G, H: SM3_WORD; 19 | Nl, Nh: SM3_WORD; 20 | data: array [0 .. SM3_LBLOCK - 1] of SM3_WORD; // 假设SM3_LBLOCK是常量或已知的数组长度 21 | num: Integer; // 将unsigned int转换为Integer,因为Pascal没有unsigned int 22 | end; 23 | var 24 | EVP_sm3: function():PTEVP_MD;cdecl=nil; 25 | 26 | function SM3Encrypt(inputs: TBytes; var outPut: TBytes): boolean; 27 | procedure SSL_InitSM3; 28 | 29 | implementation 30 | 31 | uses ssl_lib, ssl_evpmdctx, ssl_evp; 32 | 33 | procedure SSL_InitSM3; 34 | begin 35 | if @EVP_sm3=nil then 36 | begin 37 | @EVP_sm3 := LoadFuncCLibCrypto('EVP_sm3'); 38 | end; 39 | SSL_InitEVP(); 40 | SSL_InitEVPMDCTX(); 41 | end; 42 | 43 | function SM3Encrypt(inputs: TBytes; var outPut: TBytes): boolean; 44 | var 45 | lMDCTXPoint, lSM3MdPoint: Pointer; 46 | cipherBytes: TBytes; 47 | outLen: TC_INT; 48 | begin 49 | Result := false; 50 | lMDCTXPoint := nil; 51 | lSM3MdPoint := nil; 52 | outLen := 0; 53 | setLength(outPut, SM3_DIGEST_LENGTH); 54 | lMDCTXPoint := EVP_MD_CTX_new(); 55 | if lMDCTXPoint = nil then 56 | exit; 57 | lSM3MdPoint := EVP_sm3(); 58 | if lSM3MdPoint = nil then 59 | exit; 60 | try 61 | EVP_DigestInit_ex(lMDCTXPoint, lSM3MdPoint, nil); 62 | EVP_DigestUpdate(lMDCTXPoint, inputs, length(inputs)); 63 | EVP_DigestFinal_ex(lMDCTXPoint, @outPut[0], nil); 64 | Result := true; 65 | finally 66 | EVP_MD_CTX_free(lMDCTXPoint); 67 | end; 68 | end; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSL/ssl_typepointers.pas: -------------------------------------------------------------------------------- 1 | unit ssl_typepointers; 2 | 3 | interface 4 | type 5 | PTENGINE=pointer; 6 | PTEVP_PKEY=pointer; 7 | PTEVP_PKEY_CTX=pointer; 8 | // 9 | PTEVP_CIPHER=pointer; 10 | PTEVP_CIPHER_CTX=pointer; 11 | // 12 | PTEVP_MD_CTX=pointer; 13 | PTEVP_MD=pointer; 14 | implementation 15 | 16 | end. 17 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/OpenSSLDLL/README.txt: -------------------------------------------------------------------------------- 1 | This file was provided by: https://www.dll-files.com/ 2 | 3 | If you downloaded it from somewhere else, please let us know: info@dll-files.com 4 | 5 | DLL-Files.com is owned and operated by Tilf AB, Sweden. The collection of DLL files as a whole (falls under the “collection copyright” laws) are © Copyright Tilf AB 6 | 7 | The individual DLL files are provided free of charge with the understanding that the user is familiar with their use. 8 | 9 | If you need help installing the file, please see: 10 | https://www.dll-files.com/support/ 11 | or ask your question in the forum: 12 | https://forum.dll-files.com/ 13 | 14 | DISCLAIMER AND LIMITATION OF LIABILITY 15 | 16 | The Following Refers to all Files with the Extension of "dll" or dlls compressed as "zip". 17 | 18 | All files are provided on an as is basis. No guarantees or warranties are given or implied. Downloading files from this site is free of charge and the user assumes all risks of any damages that may occur, including but not limited to loss of data, damages to hardware, or loss of business profits. We do our best to ensure that all files are virus-free using available means. However, all files have not been tested for functionality or contamination. Many have been sent to us by visitors like yourself. Thus, we suggest that you do a virus scan using an up-to-date version of an anti-virus program before use. Please use at your own risk. 19 | -------------------------------------------------------------------------------- /OneClient/OpenSSLDemo/更新即使用说明.txt: -------------------------------------------------------------------------------- 1 | 把 \OpenSSLDLL 四个DLL放到编译出来的运行exe目录下面,后面在加指定目录 2 | 基于OpenSSL 1.1.1的版本打造 delphi调用openSSL库解决各种加解密问题,提供方案 3 | 当然个人能力有限,改到哪就写到哪 4 | 5 | ************************目前实现算法***************************** 6 | MD4,MD5,FileMd5,Base64加密,Base54解密 7 | Aes加密(CBC,ECB) 8 | SM3加密,SM4加解密 9 | 10 | ************************更新日记***************************** 11 | 2021-05-14 12 | 实现 SM3加密,SM4加解密 13 | 14 | 2021-04-30 15 | 纠正 Aes ECB算法长字符串加密错误 16 | 实现 Aes CBC,ECB解密 17 | 18 | 2021-04-29 19 | 文件MD5算法实现 20 | Aes加密(CBC,ECB) 算法实现 21 | 22 | 2021-04-28 23 | MD4算法调用及实现 24 | Base64算法加解调用及实现 25 | 2021-04-28 26 | MD5算法调用及实现 -------------------------------------------------------------------------------- /OneClient/Package/Neon.inc: -------------------------------------------------------------------------------- 1 | {$IF CompilerVersion >= 27} // Delphi XE6 2 | {$DEFINE HAS_SYSTEM_JSON} 3 | {$ENDIF} 4 | 5 | {$IF CompilerVersion >= 28} // Delphi XE7 6 | {$DEFINE HAS_NEW_ARRAY} 7 | {$DEFINE HAS_NET_ENCODING} 8 | {$DEFINE HAS_SYSTEM_THREADING} 9 | {$ENDIF} 10 | 11 | {$IF CompilerVersion >= 29} // Delphi XE8 12 | {$DEFINE HAS_NETHTTP_CLIENT} 13 | {$ENDIF} 14 | 15 | {$IF CompilerVersion >= 30} // Delphi 10.0 Seattle 16 | {$DEFINE HAS_HMAC_HASH} 17 | {$DEFINE HAS_GENERIC_CREATE} 18 | {$ENDIF} 19 | 20 | {$IF CompilerVersion >= 31} // Delphi 10.1 Berlin 21 | {$DEFINE HAS_UTF8CHAR} 22 | {$DEFINE NO_ARRAY_HELPER_BUG} 23 | {$ENDIF} 24 | 25 | {$IF CompilerVersion >= 33} // Delphi 10.3 Rio 26 | {$DEFINE HAS_NEW_PIDS} 27 | {$DEFINE HAS_NEW_JSON} 28 | {$ENDIF} 29 | 30 | {$IF CompilerVersion >= 34} // Delphi 10.4 Sydney 31 | {$DEFINE HAS_MRECORDS} 32 | {$ENDIF} 33 | 34 | -------------------------------------------------------------------------------- /OneClient/Package/NeonSerialization/Neon.Core.Persistence.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/NeonSerialization/Neon.Core.Persistence.pas -------------------------------------------------------------------------------- /OneClient/Package/NeonSerialization/Neon.inc: -------------------------------------------------------------------------------- 1 | {$IF CompilerVersion >= 27} // Delphi XE6 2 | {$DEFINE HAS_SYSTEM_JSON} // New System.JSON unit 3 | {$ENDIF} 4 | 5 | {$IF CompilerVersion >= 28} // Delphi XE7 6 | {$DEFINE HAS_NEW_ARRAY} // New dynamic array syntax 7 | {$DEFINE HAS_NET_ENCODING} // System.NetEncoding unit introduced 8 | {$DEFINE HAS_SYSTEM_THREADING} // System.Threading unit introduced 9 | {$ENDIF} 10 | 11 | {$IF CompilerVersion >= 29} // Delphi XE8 12 | {$DEFINE HAS_NETHTTP_CLIENT} // New NetHttp native client 13 | {$DEFINE HAS_SYSTEM_IMAGELIST} // New unit System.ImageList 14 | {$ENDIF} 15 | 16 | {$IF CompilerVersion >= 30} // Delphi 10.0 Seattle 17 | {$DEFINE HAS_JSON_BOOL} // TJSONBool class introduced 18 | {$DEFINE HAS_TOJSON} // ToJSON method introduced 19 | {$DEFINE HAS_HMAC_HASH} // Unit Hashing introduced 20 | {$DEFINE HAS_GENERIC_CREATE} // Generic constraint 21 | {$ENDIF} 22 | 23 | {$IF CompilerVersion >= 31} // Delphi 10.1 Berlin 24 | {$DEFINE HAS_UTF8CHAR} // New UTF8Char type 25 | {$ENDIF} 26 | 27 | {$IF CompilerVersion >= 32} // Delphi 10.2 Tokyo 28 | {$DEFINE HAS_EXTENDED_80} // New type Extended80 29 | {$ENDIF} 30 | 31 | {$IF CompilerVersion >= 33} // Delphi 10.3 Rio 32 | {$DEFINE HAS_NEW_JSON} // New JSON parsing options (raise) 33 | {$DEFINE HAS_VAR_INLINE} // Declaration of inline variables 34 | {$ENDIF} 35 | 36 | {$IF CompilerVersion >= 34} // Delphi 10.4 Sydney 37 | {$DEFINE HAS_TOJSON_OPTIONS} // Options in the ToJSON serialization 38 | {$DEFINE HAS_MRECORDS} // Managed Records 39 | {$ENDIF} 40 | 41 | {$IF CompilerVersion >= 35} // Delphi 11 Alexandria 42 | {$DEFINE HAS_NO_REF_COUNT} // TNoRefCountObject class 43 | {$ENDIF} 44 | 45 | {$IF CompilerVersion >= 36} // Delphi 12 Athens 46 | {$DEFINE HAS_JSON_MAPPING} // JSON Data Mapping 47 | {$ENDIF} 48 | 49 | -------------------------------------------------------------------------------- /OneClient/Package/NeonSerialization/OneNeonHelper.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/NeonSerialization/OneNeonHelper.pas -------------------------------------------------------------------------------- /OneClient/Package/OneClient.dpk: -------------------------------------------------------------------------------- 1 | package OneClient; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$IMPLICITBUILD ON} 29 | 30 | requires 31 | designIde, 32 | soaprtl, 33 | dbrtl, 34 | IndySystem, 35 | IndyProtocols, 36 | IndyCore, 37 | RESTComponents, 38 | FireDAC, 39 | FireDACCommonDriver, 40 | FireDACCommon; 41 | 42 | contains 43 | OneClientConnect in 'OneClientConnect.pas', 44 | OneClientConst in 'OneClientConst.pas', 45 | OneClientRegister in 'OneClientRegister.pas', 46 | OneClientResult in 'OneClientResult.pas', 47 | Neon.Core.Attributes in 'NeonSerialization\Neon.Core.Attributes.pas', 48 | Neon.Core.DynamicTypes in 'NeonSerialization\Neon.Core.DynamicTypes.pas', 49 | Neon.Core.Nullables in 'NeonSerialization\Neon.Core.Nullables.pas', 50 | Neon.Core.Persistence.JSON in 'NeonSerialization\Neon.Core.Persistence.JSON.pas', 51 | Neon.Core.Persistence.JSON.Schema in 'NeonSerialization\Neon.Core.Persistence.JSON.Schema.pas', 52 | Neon.Core.Persistence in 'NeonSerialization\Neon.Core.Persistence.pas', 53 | Neon.Core.Serializers.DB in 'NeonSerialization\Neon.Core.Serializers.DB.pas', 54 | Neon.Core.Serializers.Nullables in 'NeonSerialization\Neon.Core.Serializers.Nullables.pas', 55 | Neon.Core.Serializers.RTL in 'NeonSerialization\Neon.Core.Serializers.RTL.pas', 56 | Neon.Core.TypeInfo in 'NeonSerialization\Neon.Core.TypeInfo.pas', 57 | Neon.Core.Types in 'NeonSerialization\Neon.Core.Types.pas', 58 | Neon.Core.Utils in 'NeonSerialization\Neon.Core.Utils.pas', 59 | OneNeonHelper in 'NeonSerialization\OneNeonHelper.pas', 60 | OneClientDataInfo in 'baseLib\OneClientDataInfo.pas', 61 | OneStreamString in 'baseLib\OneStreamString.pas', 62 | OneClientDataSet in 'OneClientDataSet.pas', 63 | OneSQLCrypto in 'baseLib\OneSQLCrypto.pas', 64 | OneClientHelper in 'OneClientHelper.pas', 65 | OneClientVirtualFile in 'OneClientVirtualFile.pas', 66 | OneFileHelper in 'baseLib\OneFileHelper.pas', 67 | OneCrypto in 'baseLib\OneCrypto.pas', 68 | OneLog in 'baseLib\OneLog.pas', 69 | OneILog in 'baseLib\OneILog.pas', 70 | OneThread in 'baseLib\OneThread.pas', 71 | OneClientUUID in 'OneClientUUID.pas', 72 | OneClientFastLsh in 'OneFast\OneClientFastLsh.pas', 73 | OneClientFastUpdate in 'OneFast\OneClientFastUpdate.pas', 74 | OneClientFastFile in 'OneFast\OneClientFastFile.pas', 75 | OneWebSocketClient in 'websocket\OneWebSocketClient.pas', 76 | OneFunc in 'baseLib\OneFunc.pas', 77 | OneClientFastReport in 'OneFast\OneClientFastReport.pas', 78 | OneDate in 'baseLib\OneDate.pas', 79 | OneClientFastBillLock in 'OneFast\OneClientFastBillLock.pas'; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /OneClient/Package/OneClient.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/OneClient.res -------------------------------------------------------------------------------- /OneClient/Package/OneClient.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneClient/Package/OneClientConnect.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/OneClientConnect.pas -------------------------------------------------------------------------------- /OneClient/Package/OneClientConst.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/OneClientConst.pas -------------------------------------------------------------------------------- /OneClient/Package/OneClientRegister.pas: -------------------------------------------------------------------------------- 1 | unit OneClientRegister; 2 | 3 | interface 4 | 5 | uses DesignIntf, DesignEditors, System.Classes, FireDAC.Stan.Param; 6 | 7 | // type 8 | // TOneParamsProperty = class(TComponentProperty) 9 | // public 10 | // procedure Edit; override; 11 | // end; 12 | // 13 | // type 14 | // TOneParamsEditor = class(TComponentEditor{$IFDEF LINUX}, 15 | // IDesignerThreadAffinity{$ENDIF}) 16 | // public 17 | // procedure ExecuteVerb(Index: Integer); override; 18 | // end; 19 | type 20 | TOneUnitSelector = class(TSelectionEditor) 21 | public 22 | procedure RequiresUnits(Proc: TGetStrProc); override; // 覆盖此方法来添加所需的单元 23 | end; 24 | 25 | procedure Register; 26 | 27 | implementation 28 | 29 | uses 30 | OneClientConnect, OneClientDataSet, OneClientVirtualFile, OneClientUUID, OneClientFastLsh, 31 | OneClientFastUpdate, OneClientFastFile, OneWebSocketClient, OneClientFastReport,OneClientFastBillLock; 32 | 33 | procedure TOneUnitSelector.RequiresUnits(Proc: TGetStrProc); 34 | begin 35 | Proc('OneClientHelper'); 36 | end; 37 | // procedure TOneParamsProperty.Edit; 38 | // begin 39 | /// / ShowCollectionEditorClass(Designer, TCollectionEditor, 40 | /// / TOnePersistent(GetComponent(0)).GetOwner as TComponent, 41 | /// / TCollection(GetOrdValue), GetName); 42 | // end; 43 | // 44 | // procedure TOneParamsEditor.ExecuteVerb(Index: Integer); 45 | // begin 46 | // // ShowCollectionEditorClass(Designer, TCollectionEditor, Component, 47 | // // (Component as TOneDataSet).Params, 'Params'); 48 | // end; 49 | 50 | procedure Register; 51 | begin 52 | RegisterComponents('OneClient', [TOneConnection, TOneDataSet, TOneVirtualFile, 53 | TOneUUID, TOneWebSocketClient]); 54 | RegisterComponents('OneClientFast', [TOneFastLsh, TOneFastUpdate, TOneFastFile, TOneServerFastReport,TOneBillLock]); 55 | RegisterSelectionEditor(TOneConnection, TOneUnitSelector); 56 | RegisterSelectionEditor(TOneDataSet, TOneUnitSelector); 57 | // RegisterPropertyEditor(TypeInfo(TFDParams), TOneDataInfo, 'Params', 58 | // TOneParamsProperty); 59 | // RegisterComponentEditor(TOneDataSet, TOneParamsEditor); 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /OneClient/Package/OneClientResult.pas: -------------------------------------------------------------------------------- 1 | unit OneClientResult; 2 | 3 | // 终端的Data需要自已解析释放 4 | interface 5 | 6 | type 7 | TClientConnect = record 8 | public 9 | ConnectSecretkey: string; 10 | ClientIP: string; // 客户端传上来的客户端IP 11 | ClientMac: string; // 客户端传上来的客户端Mac地址 12 | TokenID: string; // 服务端返回的TokenID 13 | PrivateKey: string; // 服务端返回的私钥 14 | // public 15 | // property ConnectSecretkey: string read FConnectSecretkey 16 | // write FConnectSecretkey; 17 | // property ClientIP: string read FClientIP write FClientIP; 18 | // property ClientMac: string read FClientMac write FClientMac; 19 | // property TokenID: string read FTokenID write FTokenID; 20 | // property PrivateKey: string read FPrivateKey write FPrivateKey; 21 | end; 22 | 23 | TActionResult = class 24 | private 25 | FResultSuccess: boolean; 26 | FResultCode: string; 27 | FResultMsg: string; 28 | FResultData: T; 29 | FFreeResultData: boolean; 30 | FFreeListItem: boolean; 31 | public 32 | constructor Create(); 33 | public 34 | property ResultSuccess: boolean read FResultSuccess write FResultSuccess; 35 | property ResultCode: string read FResultCode write FResultCode; 36 | property ResultMsg: string read FResultMsg write FResultMsg; 37 | property ResultData: T read FResultData write FResultData; 38 | end; 39 | 40 | implementation 41 | 42 | constructor TActionResult.Create(); 43 | begin 44 | inherited Create; 45 | self.FResultSuccess := false; 46 | end; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /OneClient/Package/OneFast/OneClientFastBillLock.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/OneFast/OneClientFastBillLock.pas -------------------------------------------------------------------------------- /OneClient/Package/baseLib/OneDate.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneClient/Package/baseLib/OneDate.pas -------------------------------------------------------------------------------- /OneClient/Package/baseLib/OneFileHelper.pas: -------------------------------------------------------------------------------- 1 | unit OneFileHelper; 2 | 3 | interface 4 | 5 | uses System.SysUtils, System.IOUtils, System.StrUtils; 6 | // 返回Exe运行目录 7 | function GetExeRunPath(): string; 8 | // 返回Exe运行名称 9 | function GetExeName(): string; 10 | // 格式化路径分割符,比如\写成/ 11 | function FormatPath(QPath: string): string; 12 | // 拼接A,B 13 | function CombinePath(QPathA: string; QPathB: string): string; 14 | function CombineExeRunPath(QPath: string): string; 15 | function CombinePathC(QPathA: string; QPathB: string; QPathC: string): string; 16 | function CombinePathD(QPathA: string; QPathB: string; QPathC: string; 17 | QPathD: string): string; 18 | 19 | implementation 20 | 21 | function GetExeRunPath(): string; 22 | var 23 | lFullExeName: string; 24 | begin 25 | lFullExeName := ParamStr(0); 26 | result := ExtractFilePath(lFullExeName); 27 | end; 28 | 29 | function GetExeName(): string; 30 | var 31 | lFullExeName: string; 32 | begin 33 | lFullExeName := ParamStr(0); 34 | result := TPath.GetFileName(lFullExeName); 35 | end; 36 | 37 | function FormatPath(QPath: string): string; 38 | var 39 | lSeparatorChar: string; 40 | lReplaceChar: string; 41 | begin 42 | lSeparatorChar := TPath.DirectorySeparatorChar; 43 | lReplaceChar := '/'; 44 | if lSeparatorChar = '/' then 45 | begin 46 | lReplaceChar := '\'; 47 | end; 48 | QPath := QPath.Replace(lReplaceChar, lSeparatorChar); 49 | result := QPath; 50 | end; 51 | 52 | function CombinePath(QPathA: string; QPathB: string): string; 53 | var 54 | lSeparatorChar: string; 55 | lReplaceChar: string; 56 | begin 57 | lSeparatorChar := TPath.DirectorySeparatorChar; 58 | lReplaceChar := '/'; 59 | if lSeparatorChar = '/' then 60 | begin 61 | lReplaceChar := '\'; 62 | end; 63 | QPathA := QPathA.Replace(lReplaceChar, lSeparatorChar); 64 | QPathB := QPathB.Replace(lReplaceChar, lSeparatorChar); 65 | if QPathB.Length > 0 then 66 | begin 67 | if QPathA.Length > 0 then 68 | begin 69 | // 判断第一个是不是 lSeparatorChar,是的话去除 70 | if leftStr(QPathB, 1) = lSeparatorChar then 71 | begin 72 | QPathB := QPathB.Substring(1, QPathB.Length - 1); 73 | end; 74 | end; 75 | end; 76 | result := TPath.Combine(QPathA, QPathB); 77 | end; 78 | 79 | function CombineExeRunPath(QPath: string): string; 80 | var 81 | lSeparatorChar: string; 82 | lReplaceChar: string; 83 | lExeRunPath: string; 84 | begin 85 | lExeRunPath := GetExeRunPath(); 86 | result := TPath.Combine(lExeRunPath, QPath); 87 | end; 88 | 89 | function CombinePathC(QPathA: string; QPathB: string; QPathC: string): string; 90 | var 91 | lPathA, lPathB: string; 92 | begin 93 | lPathA := CombinePath(QPathA, QPathB); 94 | lPathB := QPathC; 95 | result := CombinePath(lPathA, lPathB); 96 | end; 97 | 98 | function CombinePathD(QPathA: string; QPathB: string; QPathC: string; 99 | QPathD: string): string; 100 | var 101 | lPathA, lPathB: string; 102 | begin 103 | lPathA := CombinePath(QPathA, QPathB); 104 | lPathB := QPathC; 105 | lPathA := CombinePath(lPathA, lPathB); 106 | lPathB := QPathD; 107 | result := CombinePath(lPathA, lPathB); 108 | end; 109 | 110 | end. 111 | -------------------------------------------------------------------------------- /OneClient/Package/baseLib/OneFunc.pas: -------------------------------------------------------------------------------- 1 | unit OneFunc; 2 | 3 | interface 4 | 5 | uses System.SysUtils, System.StrUtils; 6 | function GetGUID32(): string; 7 | 8 | implementation 9 | 10 | function GetGUID32(): string; 11 | var 12 | ii: TGUID; 13 | begin 14 | CreateGUID(ii); 15 | Result := Copy(AnsiReplaceStr(GUIDToString(ii), '-', ''), 2, 32); 16 | end; 17 | 18 | end. 19 | -------------------------------------------------------------------------------- /OneClient/Package/baseLib/OneILog.pas: -------------------------------------------------------------------------------- 1 | unit OneILog; 2 | 3 | interface 4 | 5 | type 6 | IOneLog = interface 7 | // 只有调试模式下才写入日记 8 | Procedure WriteDebug(const QMsg: string); 9 | // 写入公共日记 10 | procedure WriteLog(const QMsg: string); Overload; 11 | // 写入日记 12 | procedure WriteLog(QLogCode: string; const QMsg: string); Overload; 13 | // 写入日记到 专门SQL日记 14 | procedure WriteSQLLog(const QMsg: string); 15 | // 写入日记到专门 HTTP日记 16 | procedure WriteHTTPLog(const QMsg: string); 17 | function IsSQLLog(): boolean; 18 | function IsHTTPLog(): boolean; 19 | // 开始工作 20 | procedure StarWork; 21 | // 停止工作 22 | procedure StopWork; 23 | end; 24 | 25 | var 26 | unit_IOneLog: IOneLog = nil; 27 | 28 | implementation 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /OneClient/使用前说明.txt: -------------------------------------------------------------------------------- 1 | 1.编绎控件包package->OneClient,并发装控件 2 | 把控件包相关源码加到lib路径, 3 | 包括 4 | OneClient\Package 5 | OneClient\Package\NeonSerialization 6 | OneClient\Package\baseLib 7 | 2.编绎CleintDemo 运行起来看效果 -------------------------------------------------------------------------------- /OneServer/DBCenter/OneIOrm.pas: -------------------------------------------------------------------------------- 1 | unit OneIOrm; 2 | 3 | interface 4 | uses system.Generics.Collections; 5 | type 6 | 7 | 8 | implementation 9 | 10 | end. 11 | -------------------------------------------------------------------------------- /OneServer/Neon.inc: -------------------------------------------------------------------------------- 1 | {$IF CompilerVersion >= 27} // Delphi XE6 2 | {$DEFINE HAS_SYSTEM_JSON} 3 | {$ENDIF} 4 | 5 | {$IF CompilerVersion >= 28} // Delphi XE7 6 | {$DEFINE HAS_NEW_ARRAY} 7 | {$DEFINE HAS_NET_ENCODING} 8 | {$DEFINE HAS_SYSTEM_THREADING} 9 | {$ENDIF} 10 | 11 | {$IF CompilerVersion >= 29} // Delphi XE8 12 | {$DEFINE HAS_NETHTTP_CLIENT} 13 | {$ENDIF} 14 | 15 | {$IF CompilerVersion >= 30} // Delphi 10.0 Seattle 16 | {$DEFINE HAS_HMAC_HASH} 17 | {$DEFINE HAS_GENERIC_CREATE} 18 | {$ENDIF} 19 | 20 | {$IF CompilerVersion >= 31} // Delphi 10.1 Berlin 21 | {$DEFINE HAS_UTF8CHAR} 22 | {$DEFINE NO_ARRAY_HELPER_BUG} 23 | {$ENDIF} 24 | 25 | {$IF CompilerVersion >= 33} // Delphi 10.3 Rio 26 | {$DEFINE HAS_NEW_PIDS} 27 | {$DEFINE HAS_NEW_JSON} 28 | {$ENDIF} 29 | 30 | {$IF CompilerVersion >= 34} // Delphi 10.4 Sydney 31 | {$DEFINE HAS_MRECORDS} 32 | {$ENDIF} 33 | 34 | -------------------------------------------------------------------------------- /OneServer/NeonSerialization/Neon.Core.Persistence.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/NeonSerialization/Neon.Core.Persistence.pas -------------------------------------------------------------------------------- /OneServer/NeonSerialization/Neon.inc: -------------------------------------------------------------------------------- 1 | {$IF CompilerVersion >= 27} // Delphi XE6 2 | {$DEFINE HAS_SYSTEM_JSON} // New System.JSON unit 3 | {$ENDIF} 4 | 5 | {$IF CompilerVersion >= 28} // Delphi XE7 6 | {$DEFINE HAS_NEW_ARRAY} // New dynamic array syntax 7 | {$DEFINE HAS_NET_ENCODING} // System.NetEncoding unit introduced 8 | {$DEFINE HAS_SYSTEM_THREADING} // System.Threading unit introduced 9 | {$ENDIF} 10 | 11 | {$IF CompilerVersion >= 29} // Delphi XE8 12 | {$DEFINE HAS_NETHTTP_CLIENT} // New NetHttp native client 13 | {$DEFINE HAS_SYSTEM_IMAGELIST} // New unit System.ImageList 14 | {$ENDIF} 15 | 16 | {$IF CompilerVersion >= 30} // Delphi 10.0 Seattle 17 | {$DEFINE HAS_JSON_BOOL} // TJSONBool class introduced 18 | {$DEFINE HAS_TOJSON} // ToJSON method introduced 19 | {$DEFINE HAS_HMAC_HASH} // Unit Hashing introduced 20 | {$DEFINE HAS_GENERIC_CREATE} // Generic constraint 21 | {$ENDIF} 22 | 23 | {$IF CompilerVersion >= 31} // Delphi 10.1 Berlin 24 | {$DEFINE HAS_UTF8CHAR} // New UTF8Char type 25 | {$ENDIF} 26 | 27 | {$IF CompilerVersion >= 32} // Delphi 10.2 Tokyo 28 | {$DEFINE HAS_EXTENDED_80} // New type Extended80 29 | {$ENDIF} 30 | 31 | {$IF CompilerVersion >= 33} // Delphi 10.3 Rio 32 | {$DEFINE HAS_NEW_JSON} // New JSON parsing options (raise) 33 | {$DEFINE HAS_VAR_INLINE} // Declaration of inline variables 34 | {$ENDIF} 35 | 36 | {$IF CompilerVersion >= 34} // Delphi 10.4 Sydney 37 | {$DEFINE HAS_TOJSON_OPTIONS} // Options in the ToJSON serialization 38 | {$DEFINE HAS_MRECORDS} // Managed Records 39 | {$ENDIF} 40 | 41 | {$IF CompilerVersion >= 35} // Delphi 11 Alexandria 42 | {$DEFINE HAS_NO_REF_COUNT} // TNoRefCountObject class 43 | {$ENDIF} 44 | 45 | {$IF CompilerVersion >= 36} // Delphi 12 Athens 46 | {$DEFINE HAS_JSON_MAPPING} // JSON Data Mapping 47 | {$ENDIF} 48 | 49 | -------------------------------------------------------------------------------- /OneServer/NeonSerialization/OneNeonHelper.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/NeonSerialization/OneNeonHelper.pas -------------------------------------------------------------------------------- /OneServer/One.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE One_NoFastReport} -------------------------------------------------------------------------------- /OneServer/OneCompilerVersion.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneCompilerVersion.pas -------------------------------------------------------------------------------- /OneServer/OneFastApi/OneFastApiController.pas: -------------------------------------------------------------------------------- 1 | unit OneFastApiController; 2 | 3 | interface 4 | 5 | uses 6 | system.StrUtils, system.SysUtils, Math, system.JSON, system.Threading, system.Classes, 7 | OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, OneHttpConst, 8 | system.Generics.Collections, OneControllerResult, FireDAC.Comp.Client, Data.DB, OneGuID, 9 | OneMultipart; 10 | 11 | type 12 | TFastApiController = class(TOneControllerBase) 13 | public 14 | function DoFastApi(QPostJson: TJsonObject): string; 15 | function RefreshApiInfo(QApiCode: string): TActionResult; 16 | function RefreshApiInfoAll(): TActionResult; 17 | end; 18 | 19 | implementation 20 | 21 | uses OneGlobal, OneFastApiManage, OneFastApiDo; 22 | 23 | function CreateNewFastApiController(QRouterItem: TOneRouterWorkItem): Tobject; 24 | var 25 | lController: TFastApiController; 26 | begin 27 | // 自定义创建控制器类,否则会按 TPersistentclass.create 28 | // 最好自定义一个好 29 | lController := TFastApiController.Create; 30 | // 挂载RTTI信息 31 | lController.RouterItem := QRouterItem; 32 | result := lController; 33 | end; 34 | 35 | function TFastApiController.DoFastApi(QPostJson: TJsonObject): string; 36 | var 37 | lTokenItem: TOneTokenItem; 38 | lErrMsg: string; 39 | lJsonValue: TJsonValue; 40 | begin 41 | lTokenItem := nil; 42 | lJsonValue := nil; 43 | try 44 | lTokenItem := self.GetCureentToken(lErrMsg); 45 | lJsonValue := OneFastApiDo.DoFastApi(lTokenItem, QPostJson); 46 | try 47 | result := lJsonValue.tostring; 48 | finally 49 | if lJsonValue <> nil then 50 | begin 51 | lJsonValue.free; 52 | end; 53 | end; 54 | except 55 | on e:exception do 56 | begin 57 | result := '发生异常,异常消息['+e.Message+']'; 58 | end; 59 | end; 60 | end; 61 | 62 | function TFastApiController.RefreshApiInfo(QApiCode: string): TActionResult; 63 | var 64 | lApiManage: TOneFastApiManage; 65 | lErrMsg: string; 66 | begin 67 | result := TActionResult.Create(false, false); 68 | lApiManage := OneFastApiManage.UnitFastApiManage(); 69 | if not lApiManage.RefreshApiInfo(QApiCode, lErrMsg) then 70 | begin 71 | result.ResultMsg := lErrMsg; 72 | exit; 73 | end; 74 | result.ResultData := '刷新FastApi模板[' + QApiCode + ']板信息成功'; 75 | result.SetResultTrue; 76 | end; 77 | 78 | function TFastApiController.RefreshApiInfoAll(): TActionResult; 79 | var 80 | lApiManage: TOneFastApiManage; 81 | lErrMsg: string; 82 | begin 83 | result := TActionResult.Create(false, false); 84 | lApiManage := OneFastApiManage.UnitFastApiManage(); 85 | if not lApiManage.RefreshApiInfoAll(lErrMsg) then 86 | begin 87 | result.ResultMsg := lErrMsg; 88 | exit; 89 | end; 90 | result.ResultData := '刷新FastApi模板信息成功'; 91 | result.SetResultTrue; 92 | end; 93 | 94 | initialization 95 | 96 | // 单例模式注册 97 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('OneServer/FastApi', TFastApiController, 0, CreateNewFastApiController); 98 | 99 | finalization 100 | 101 | end. 102 | -------------------------------------------------------------------------------- /OneServer/OneFastBillLock/OneFastBillLockController.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneFastBillLock/OneFastBillLockController.pas -------------------------------------------------------------------------------- /OneServer/OneFastBillLock/OneFastBillLockManage.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneFastBillLock/OneFastBillLockManage.pas -------------------------------------------------------------------------------- /OneServer/OneFastCleint/OneFastModuleController.pas: -------------------------------------------------------------------------------- 1 | unit OneFastModuleController; 2 | 3 | interface 4 | 5 | uses 6 | system.StrUtils, system.SysUtils, Math, system.JSON, system.Threading, system.Classes, 7 | OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, OneHttpConst, 8 | system.Generics.Collections, OneControllerResult, FireDAC.Comp.Client, Data.DB, OneGuID, 9 | OneMultipart, OneFastModuleManage; 10 | 11 | type 12 | TFastModuleController = class(TOneControllerBase) 13 | public 14 | function GetModuleInfo(QModuleCode: string): TActionResult; 15 | function RefreshModuleInfo(QModuleCode: string): TActionResult; 16 | function RefreshModuleInfoAll(): TActionResult; 17 | end; 18 | 19 | implementation 20 | 21 | uses OneGlobal, OneZTManage; 22 | 23 | function CreateNewFastModuleController(QRouterItem: TOneRouterWorkItem): Tobject; 24 | var 25 | lController: TFastModuleController; 26 | begin 27 | // 自定义创建控制器类,否则会按 TPersistentclass.create 28 | // 最好自定义一个好 29 | lController := TFastModuleController.Create; 30 | // 挂载RTTI信息 31 | lController.RouterItem := QRouterItem; 32 | result := lController; 33 | end; 34 | 35 | function TFastModuleController.GetModuleInfo(QModuleCode: string): TActionResult; 36 | var 37 | lFastModuleManage: TOneFastModuleManage; 38 | lErrMsg: string; 39 | lModuleInfo: TModuleInfo; 40 | begin 41 | result := TActionResult.Create(false, false); 42 | lFastModuleManage := OneFastModuleManage.UnitFastModuleManage(); 43 | lModuleInfo := lFastModuleManage.GetModuleInfo(QModuleCode, lErrMsg); 44 | if lModuleInfo = nil then 45 | begin 46 | result.ResultMsg := lErrMsg; 47 | exit; 48 | end; 49 | result.ResultData := lModuleInfo; 50 | result.SetResultTrue; 51 | end; 52 | 53 | function TFastModuleController.RefreshModuleInfo(QModuleCode: string): TActionResult; 54 | var 55 | lFastModuleManage: TOneFastModuleManage; 56 | lErrMsg: string; 57 | lModuleInfo: TModuleInfo; 58 | begin 59 | result := TActionResult.Create(false, false); 60 | lFastModuleManage := OneFastModuleManage.UnitFastModuleManage(); 61 | if not lFastModuleManage.RefreshModuleInfo(QModuleCode, lErrMsg) then 62 | begin 63 | result.ResultMsg := lErrMsg; 64 | exit; 65 | end; 66 | result.ResultData := '刷新模[' + QModuleCode + ']板信息成功'; 67 | result.SetResultTrue; 68 | end; 69 | 70 | function TFastModuleController.RefreshModuleInfoAll(): TActionResult; 71 | var 72 | lFastModuleManage: TOneFastModuleManage; 73 | lErrMsg: string; 74 | lModuleInfo: TModuleInfo; 75 | begin 76 | result := TActionResult.Create(false, false); 77 | lFastModuleManage := OneFastModuleManage.UnitFastModuleManage(); 78 | if not lFastModuleManage.RefreshModuleInfoAll(lErrMsg) then 79 | begin 80 | result.ResultMsg := lErrMsg; 81 | exit; 82 | end; 83 | result.ResultData := '刷新模板信息成功'; 84 | result.SetResultTrue; 85 | end; 86 | 87 | initialization 88 | 89 | // 单例模式注册 90 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('/FastClient/FastModule', TFastModuleController, 0, CreateNewFastModuleController); 91 | 92 | finalization 93 | 94 | end. 95 | -------------------------------------------------------------------------------- /OneServer/OneFastCleint/OneFastPlatManage.pas: -------------------------------------------------------------------------------- 1 | unit OneFastPlatManage; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | end. 8 | -------------------------------------------------------------------------------- /OneServer/OneFastFlow.pas: -------------------------------------------------------------------------------- 1 | unit OneFastFlow; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | end. 8 | -------------------------------------------------------------------------------- /OneServer/OneFastFlow/OneFastFlowController.pas: -------------------------------------------------------------------------------- 1 | unit OneFastFlowController; 2 | 3 | interface 4 | 5 | uses 6 | system.StrUtils, system.SysUtils, Math, system.JSON, system.Threading, system.Classes, 7 | OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, OneHttpConst, 8 | system.Generics.Collections, OneControllerResult, FireDAC.Comp.Client, Data.DB, OneGuID, 9 | OneMultipart, OneFastFlowManage; 10 | 11 | type 12 | TFastFlowController = class(TOneControllerBase) 13 | public 14 | function RefreshFlowManage(): TActionResult; 15 | function GetFlowInfo(QFlowCode: string): TActionResult; 16 | end; 17 | 18 | implementation 19 | 20 | uses OneGlobal; 21 | 22 | function CreateNewFastFlowController(QRouterItem: TOneRouterWorkItem): Tobject; 23 | var 24 | lController: TFastFlowController; 25 | begin 26 | // 自定义创建控制器类,否则会按 TPersistentclass.create 27 | // 最好自定义一个好 28 | lController := TFastFlowController.Create; 29 | // 挂载RTTI信息 30 | lController.RouterItem := QRouterItem; 31 | result := lController; 32 | end; 33 | 34 | function TFastFlowController.RefreshFlowManage(): TActionResult; 35 | var 36 | lErrMsg: string; 37 | begin 38 | result := TActionResult.Create(false, false); 39 | if not OneFastFlowManage.UnitFastFlowManage().RefreshFlowManage(lErrMsg) then 40 | begin 41 | result.ResultMsg := lErrMsg; 42 | exit; 43 | end; 44 | result.SetResultTrue(); 45 | end; 46 | 47 | function TFastFlowController.GetFlowInfo(QFlowCode: string): TActionResult; 48 | var 49 | lErrMsg: string; 50 | lFlowInfo: TFlowInfo; 51 | begin 52 | result := TActionResult.Create(false, false); 53 | lFlowInfo := nil; 54 | lFlowInfo := OneFastFlowManage.UnitFastFlowManage().GetFlowInfo(QFlowCode, lErrMsg); 55 | if lFlowInfo = nil then 56 | begin 57 | result.ResultMsg := lErrMsg; 58 | exit; 59 | end; 60 | result.ResultData := lFlowInfo; 61 | result.SetResultTrue(); 62 | end; 63 | 64 | initialization 65 | 66 | // 单例模式注册 67 | OneHttpRouterManage.GetInitRouterManage() 68 | .AddHTTPSingleWork('OneServer/FastFlow', TFastFlowController, 0, CreateNewFastFlowController); 69 | 70 | finalization 71 | 72 | end. 73 | -------------------------------------------------------------------------------- /OneServer/OneFastLsh/OneFastLshController.pas: -------------------------------------------------------------------------------- 1 | unit OneFastLshController; 2 | 3 | interface 4 | 5 | uses 6 | system.StrUtils, system.SysUtils, Math, system.JSON, system.Threading, system.Classes, 7 | OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, OneHttpConst, 8 | system.Generics.Collections, OneControllerResult, FireDAC.Comp.Client, Data.DB, OneGuID, 9 | OneMultipart; 10 | 11 | type 12 | TFastLshController = class(TOneControllerBase) 13 | public 14 | function RefreshLshSet(): TActionResult; 15 | function GetLsh(QLshCode: string): TActionResult; 16 | function GetLshList(QLshCode: string; QStep: integer): TActionResult>; 17 | end; 18 | 19 | implementation 20 | 21 | uses OneGlobal, OneFastLshManage; 22 | 23 | function CreateNewFastLshController(QRouterItem: TOneRouterWorkItem): Tobject; 24 | var 25 | lController: TFastLshController; 26 | begin 27 | // 自定义创建控制器类,否则会按 TPersistentclass.create 28 | // 最好自定义一个好 29 | lController := TFastLshController.Create; 30 | // 挂载RTTI信息 31 | lController.RouterItem := QRouterItem; 32 | result := lController; 33 | end; 34 | 35 | function TFastLshController.RefreshLshSet(): TActionResult; 36 | var 37 | lErrMsg: string; 38 | begin 39 | result := TActionResult.Create(false, false); 40 | if not OneFastLshManage.UnitFastLshMange().RefreshLshSet(lErrMsg) then 41 | begin 42 | result.ResultMsg := lErrMsg; 43 | exit; 44 | end; 45 | result.SetResultTrue(); 46 | end; 47 | 48 | function TFastLshController.GetLsh(QLshCode: string): TActionResult; 49 | var 50 | lLsh, lErrMsg: string; 51 | begin 52 | result := TActionResult.Create(false, false); 53 | lLsh := OneFastLshManage.UnitFastLshMange().GetLsh(QLshCode, lErrMsg); 54 | if lErrMsg <> '' then 55 | begin 56 | result.ResultMsg := lErrMsg; 57 | exit; 58 | end; 59 | result.ResultData := lLsh; 60 | result.SetResultTrue(); 61 | end; 62 | 63 | function TFastLshController.GetLshList(QLshCode: string; QStep: integer): TActionResult>; 64 | var 65 | lErrMsg: string; 66 | lLshList: TList; 67 | begin 68 | result := TActionResult < TList < string >>.Create(true, false); 69 | lLshList := nil; 70 | lLshList := OneFastLshManage.UnitFastLshMange().GetLshList(QLshCode, QStep, lErrMsg); 71 | if lErrMsg <> '' then 72 | begin 73 | result.ResultMsg := lErrMsg; 74 | exit; 75 | end; 76 | result.ResultData := lLshList; 77 | result.SetResultTrue; 78 | end; 79 | 80 | initialization 81 | 82 | // 单例模式注册 83 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('OneServer/FastLsh', TFastLshController, 0, CreateNewFastLshController); 84 | 85 | finalization 86 | 87 | end. 88 | -------------------------------------------------------------------------------- /OneServer/OneFastWeiXin/WeixinAdminController.pas: -------------------------------------------------------------------------------- 1 | unit WeixinAdminController; 2 | 3 | { 微信回调,验证接口单元 } 4 | 5 | interface 6 | 7 | uses OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, 8 | system.Generics.Collections, system.StrUtils, system.SysUtils, Data.DB, 9 | FireDAC.Comp.Client, OneControllerResult, system.Classes, system.Hash; 10 | 11 | type 12 | 13 | TWeixinAdminController = class(TOneControllerBase) 14 | public 15 | function RefreshWeixinAccount(): TActionResult; 16 | function RefreshWeixinAccessToken(): TActionResult; 17 | end; 18 | 19 | function CreateNewWeixinAdminController(QRouterItem: TOneRouterWorkItem): TObject; 20 | 21 | implementation 22 | 23 | uses OneGlobal, WeiXinManage; 24 | 25 | function CreateNewWeixinAdminController(QRouterItem: TOneRouterWorkItem) 26 | : TObject; 27 | var 28 | lController: TWeixinAdminController; 29 | begin 30 | // 自定义创建控制器类,否则会按 TPersistentclass.create 31 | // 最好自定义一个好 32 | lController := TWeixinAdminController.Create; 33 | // 挂载RTTI信息 34 | lController.RouterItem := QRouterItem; 35 | result := lController; 36 | end; 37 | 38 | function TWeixinAdminController.RefreshWeixinAccount(): TActionResult; 39 | var 40 | lWeiXinManage: TWeiXinManage; 41 | lErrMsg: string; 42 | begin 43 | result := TActionResult.Create(false, false); 44 | lWeiXinManage := WeiXinManage.GetWeiXinManage(); 45 | if not lWeiXinManage.RefreshWeixinAccount(lErrMsg) then 46 | begin 47 | result.ResultMsg := lErrMsg; 48 | exit; 49 | end; 50 | result.ResultData := '刷新数据成功!'; 51 | result.SetResultTrue(); 52 | end; 53 | 54 | function TWeixinAdminController.RefreshWeixinAccessToken(): TActionResult; 55 | var 56 | lWeiXinManage: TWeiXinManage; 57 | lErrMsg: string; 58 | begin 59 | result := TActionResult.Create(false, false); 60 | lWeiXinManage := WeiXinManage.GetWeiXinManage(); 61 | if not lWeiXinManage.RefreshWeixinAccessToken(true, lErrMsg) then 62 | begin 63 | result.ResultMsg := lErrMsg; 64 | exit; 65 | end; 66 | result.ResultData := '刷新数据成功!'; 67 | result.SetResultTrue(); 68 | end; 69 | 70 | initialization 71 | 72 | // 单例模式注册 73 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('OneServer/WeixinAdmin', TWeixinAdminController, 0, CreateNewWeixinAdminController); 74 | 75 | finalization 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /OneServer/OneFastWeiXin/WeixinApiPublic.pas: -------------------------------------------------------------------------------- 1 | unit WeixinApiPublic; 2 | 3 | interface 4 | 5 | uses 6 | System.JSON, System.Classes, System.SysConst, System.SysUtils, 7 | System.Net.URLClient, System.Net.HttpClient, System.Net.HttpClientComponent; 8 | 9 | type 10 | TWeixinRequest = class 11 | public 12 | appID: string; 13 | appSecret: string; 14 | accessToken: string; 15 | authCode: string; 16 | // 请求结果 17 | resultSucces: boolean; 18 | resultCode: string; 19 | resultMsg: string; 20 | resultOpenID: string; 21 | resultUnionid: string; 22 | resultDataString: string; 23 | end; 24 | 25 | function GetNetHTTPClient(): TNetHTTPClient; 26 | 27 | implementation 28 | 29 | var 30 | Unit_NetHTTPClient: TNetHTTPClient = nil; 31 | 32 | function GetNetHTTPClient(): TNetHTTPClient; 33 | begin 34 | if Unit_NetHTTPClient = nil then 35 | begin 36 | Unit_NetHTTPClient := TNetHTTPClient.Create(nil); 37 | Unit_NetHTTPClient.ContentType := 'application/x-www-form-urlencoded'; 38 | end; 39 | Result := Unit_NetHTTPClient; 40 | end; 41 | 42 | initialization 43 | 44 | 45 | finalization 46 | 47 | if Unit_NetHTTPClient <> nil then 48 | Unit_NetHTTPClient.Free; 49 | 50 | end. 51 | -------------------------------------------------------------------------------- /OneServer/OneService.dpr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneService.dpr -------------------------------------------------------------------------------- /OneServer/OneService.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneService.res -------------------------------------------------------------------------------- /OneServer/OneService.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneServer/OneServiceConsole.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneServiceConsole.res -------------------------------------------------------------------------------- /OneServer/OneServiceConsole.skincfg: -------------------------------------------------------------------------------- 1 | [ExpressSkins] 2 | Default=1 3 | ShowNotifications=1 4 | Enabled=0 5 | dxSkinBasic=1 6 | dxSkinBlack=1 7 | dxSkinBlue=1 8 | dxSkinBlueprint=1 9 | dxSkinCaramel=1 10 | dxSkinCoffee=1 11 | dxSkinDarkroom=1 12 | dxSkinDarkSide=1 13 | dxSkinDevExpressDarkStyle=1 14 | dxSkinDevExpressStyle=1 15 | dxSkinFoggy=1 16 | dxSkinGlassOceans=1 17 | dxSkinHighContrast=1 18 | dxSkiniMaginary=1 19 | dxSkinLilian=1 20 | dxSkinLiquidSky=1 21 | dxSkinLondonLiquidSky=1 22 | dxSkinMcSkin=1 23 | dxSkinMetropolis=1 24 | dxSkinMetropolisDark=1 25 | dxSkinMoneyTwins=1 26 | dxSkinOffice2007Black=1 27 | dxSkinOffice2007Blue=1 28 | dxSkinOffice2007Green=1 29 | dxSkinOffice2007Pink=1 30 | dxSkinOffice2007Silver=1 31 | dxSkinOffice2010Black=1 32 | dxSkinOffice2010Blue=1 33 | dxSkinOffice2010Silver=1 34 | dxSkinOffice2013DarkGray=1 35 | dxSkinOffice2013LightGray=1 36 | dxSkinOffice2013White=1 37 | dxSkinOffice2016Colorful=1 38 | dxSkinOffice2016Dark=1 39 | dxSkinOffice2019Black=1 40 | dxSkinOffice2019Colorful=1 41 | dxSkinOffice2019DarkGray=1 42 | dxSkinOffice2019White=1 43 | dxSkinPumpkin=1 44 | dxSkinSeven=1 45 | dxSkinSevenClassic=1 46 | dxSkinSharp=1 47 | dxSkinSharpPlus=1 48 | dxSkinSilver=1 49 | dxSkinSpringtime=1 50 | dxSkinStardust=1 51 | dxSkinSummer2008=1 52 | dxSkinTheAsphaltWorld=1 53 | dxSkinTheBezier=1 54 | dxSkinsDefaultPainters=1 55 | dxSkinValentine=1 56 | dxSkinVisualStudio2013Blue=1 57 | dxSkinVisualStudio2013Dark=1 58 | dxSkinVisualStudio2013Light=1 59 | dxSkinVS2010=1 60 | dxSkinWhiteprint=1 61 | dxSkinXmas2008Blue=1 62 | -------------------------------------------------------------------------------- /OneServer/OneUniDemo/UniLoginController.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/OneUniDemo/UniLoginController.pas -------------------------------------------------------------------------------- /OneServer/WeixinAdminController.pas: -------------------------------------------------------------------------------- 1 | unit WeixinAdminController; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | end. 8 | -------------------------------------------------------------------------------- /OneServer/basLib/OneDate.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/OneDate.pas -------------------------------------------------------------------------------- /OneServer/basLib/TokenManage.pas: -------------------------------------------------------------------------------- 1 | unit TokenManage; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | end. 8 | -------------------------------------------------------------------------------- /OneServer/basLib/func/OneDateTimeHelper.pas: -------------------------------------------------------------------------------- 1 | unit OneDateTimeHelper; 2 | 3 | interface 4 | uses System.SysUtils; 5 | //设置软件系统时间格式 6 | procedure SetSystemDataTimeFormatSettings; 7 | implementation 8 | //设置软件系统时间格式 9 | procedure SetSystemDataTimeFormatSettings; 10 | begin 11 | FormatSettings.LongDateFormat := 'yyyy-MM-dd'; 12 | FormatSettings.ShortDateFormat := 'yyyy-MM-dd'; 13 | FormatSettings.LongTimeFormat := 'hh:nn:ss'; 14 | FormatSettings.ShortTimeFormat := 'hh:nn:ss'; 15 | FormatSettings.DateSeparator := '-'; 16 | FormatSettings.timeSeparator := ':'; 17 | FormatSettings.ShortMonthNames[1] := '01'; 18 | FormatSettings.ShortMonthNames[2] := '02'; 19 | FormatSettings.ShortMonthNames[3] := '03'; 20 | FormatSettings.ShortMonthNames[4] := '04'; 21 | FormatSettings.ShortMonthNames[5] := '05'; 22 | FormatSettings.ShortMonthNames[6] := '06'; 23 | FormatSettings.ShortMonthNames[7] := '07'; 24 | FormatSettings.ShortMonthNames[8] := '08'; 25 | FormatSettings.ShortMonthNames[9] := '09'; 26 | FormatSettings.ShortMonthNames[10] := '10'; 27 | FormatSettings.ShortMonthNames[11] := '11'; 28 | FormatSettings.ShortMonthNames[12] := '12'; 29 | FormatSettings.LongMonthNames[1] := '01'; 30 | FormatSettings.LongMonthNames[2] := '02'; 31 | FormatSettings.LongMonthNames[3] := '03'; 32 | FormatSettings.LongMonthNames[4] := '04'; 33 | FormatSettings.LongMonthNames[5] := '05'; 34 | FormatSettings.LongMonthNames[6] := '06'; 35 | FormatSettings.LongMonthNames[7] := '07'; 36 | FormatSettings.LongMonthNames[8] := '08'; 37 | FormatSettings.LongMonthNames[9] := '09'; 38 | FormatSettings.LongMonthNames[10] := '10'; 39 | FormatSettings.LongMonthNames[11] := '11'; 40 | FormatSettings.LongMonthNames[12] := '12'; 41 | FormatSettings.ShortDayNames[1] := '日'; 42 | FormatSettings.ShortDayNames[2] := '一'; 43 | FormatSettings.ShortDayNames[3] := '二'; 44 | FormatSettings.ShortDayNames[4] := '三'; 45 | FormatSettings.ShortDayNames[5] := '四'; 46 | FormatSettings.ShortDayNames[6] := '五'; 47 | FormatSettings.ShortDayNames[7] := '六'; 48 | FormatSettings.LongDayNames[1] := '日'; 49 | FormatSettings.LongDayNames[2] := '一'; 50 | FormatSettings.LongDayNames[3] := '二'; 51 | FormatSettings.LongDayNames[4] := '三'; 52 | FormatSettings.LongDayNames[5] := '四'; 53 | FormatSettings.LongDayNames[6] := '五'; 54 | FormatSettings.LongDayNames[7] := '六'; 55 | end; 56 | end. 57 | -------------------------------------------------------------------------------- /OneServer/basLib/func/OneFunc.pas: -------------------------------------------------------------------------------- 1 | unit OneFunc; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | end. 8 | -------------------------------------------------------------------------------- /OneServer/basLib/func/OneGUID.pas: -------------------------------------------------------------------------------- 1 | unit OneGUID; 2 | 3 | interface 4 | uses System.SysUtils,system.StrUtils; 5 | function GetGUID32():string; 6 | implementation 7 | function GetGUID32():string; 8 | var 9 | ii: TGUID; 10 | begin 11 | CreateGUID(ii); 12 | Result := Copy(AnsiReplaceStr(GUIDToString(ii), '-',''), 2, 32); 13 | end; 14 | end. 15 | -------------------------------------------------------------------------------- /OneServer/basLib/logger/OneILog.pas: -------------------------------------------------------------------------------- 1 | unit OneILog; 2 | 3 | interface 4 | 5 | type 6 | IOneLog = interface 7 | // 只有调试模式下才写入日记 8 | Procedure WriteDebug(const QMsg: string); 9 | // 写入公共日记 10 | procedure WriteLog(const QMsg: string); Overload; 11 | // 写入日记 12 | procedure WriteLog(QLogCode: string; const QMsg: string); Overload; 13 | // 写入日记到 专门SQL日记 14 | procedure WriteSQLLog(const QMsg: string); 15 | // 写入日记到专门 HTTP日记 16 | procedure WriteHTTPLog(const QMsg: string); 17 | function IsSQLLog(): boolean; 18 | function IsHTTPLog(): boolean; 19 | // 开始工作 20 | procedure StarWork; 21 | // 停止工作 22 | procedure StopWork; 23 | end; 24 | 25 | var 26 | unit_IOneLog: IOneLog = nil; 27 | 28 | implementation 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /OneServer/basLib/multipart/OneMultipart.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/multipart/OneMultipart.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Contract/uIIdGenerator.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Contract/uIIdGenerator.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Contract/uISnowWorker.pas: -------------------------------------------------------------------------------- 1 | unit uISnowWorker; 2 | 3 | interface 4 | 5 | type 6 | ISnowWorker = interface 7 | ['{AB5DCE35-5745-417F-9217-9094CA651A8C}'] 8 | function NextId(): Int64; 9 | end; 10 | 11 | implementation 12 | 13 | end. 14 | -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Contract/uIdGeneratorOptions.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Contract/uIdGeneratorOptions.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Contract/uTOverCostActionArg.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Contract/uTOverCostActionArg.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Core/uSnowWorkerM1.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Core/uSnowWorkerM1.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Core/uSnowWorkerM2.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Core/uSnowWorkerM2.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/Core/uSnowWorkerM3.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/Core/uSnowWorkerM3.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/OneUUID.pas: -------------------------------------------------------------------------------- 1 | unit OneUUID; 2 | 3 | // 版权声明引用了开源的,非作者所有 4 | // https://github.com/yitter/IdGenerator/tree/master/Delphi 5 | interface 6 | 7 | uses 8 | system.Classes, system.StrUtils, system.SysUtils, 9 | uIdGeneratorOptions, uIIdGenerator, uDefaultIdGenerator, uYitIdHelper; 10 | 11 | function GetUUID(): int64; 12 | function GetUUIDStr(): string; 13 | 14 | implementation 15 | 16 | var 17 | IdGeneratorOption: TIdGeneratorOptions = nil; 18 | YitIdHelper: TYitIdHelper = nil; 19 | 20 | function GetYitIdHelper(): TYitIdHelper; 21 | begin 22 | if YitIdHelper = nil then 23 | begin 24 | YitIdHelper := TYitIdHelper.Create; 25 | IdGeneratorOption := TIdGeneratorOptions.Create; 26 | // 参数参考IdGeneratorOptions定义。 27 | with IdGeneratorOption do 28 | begin 29 | // 以下全部为默认参数 30 | Method := 1; 31 | // BaseTime := DateTime.Now.AddYears(-10); 32 | WorkerId := 1; 33 | 34 | // WorkerIdBitLength + SeqBitLength 不超过 22。 35 | WorkerIdBitLength := 6; 36 | SeqBitLength := 14; 37 | 38 | MaxSeqNumber := 0; 39 | MinSeqNumber := 5; 40 | 41 | TopOverCostCount := 2000; 42 | 43 | DataCenterId := 0; 44 | DataCenterIdBitLength := 0; 45 | 46 | TimestampType := 0; 47 | end; 48 | // 保存参数(务必调用,否则参数设置不生效): 49 | YitIdHelper.SetIdGenerator(IdGeneratorOption); 50 | end; 51 | Result := YitIdHelper; 52 | end; 53 | 54 | function GetUUID(): int64; 55 | begin 56 | Result := GetYitIdHelper().NextId(); 57 | end; 58 | 59 | function GetUUIDStr(): string; 60 | begin 61 | Result := GetUUID().ToString; 62 | end; 63 | 64 | initialization 65 | 66 | 67 | finalization 68 | 69 | if YitIdHelper <> nil then 70 | begin 71 | YitIdHelper.Free; 72 | IdGeneratorOption.Free; 73 | end; 74 | 75 | end. 76 | -------------------------------------------------------------------------------- /OneServer/basLib/uuid/uDefaultIdGenerator.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/uDefaultIdGenerator.pas -------------------------------------------------------------------------------- /OneServer/basLib/uuid/uYitIdHelper.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/basLib/uuid/uYitIdHelper.pas -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoAttributeController.pas: -------------------------------------------------------------------------------- 1 | unit DemoAttributeController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB, System.JSON, System.IOUtils, OneAttribute; 8 | 9 | type 10 | TDemoAttributeController = class(TOneControllerBase) 11 | public 12 | // 取参数取的是ULR ?后面的参数,且只支持Get访问,不需要以OneGet开头 13 | [TOneHttpGet] 14 | function GetTest(name: string; sex: string): string; 15 | 16 | // 取参数取的是ULR路径的参数 /url路径/myname/mysex;,不需要以OnePath开头 17 | [TOneHttpPath] 18 | function GetPath(name: string; sex: string): string; 19 | 20 | // 取参数取的是post Data数据且为JSON格式,且只支持Post访问,不需要以OnePost开头 21 | [TOneHttpPost] 22 | function PostTest(name: string; sex: string): string; 23 | 24 | // 取参数取的是post Data数据,且只支持Post访问 25 | // data数据是表单格式 key1=value1&key2=value2 26 | // 数据之间是用&关联 27 | [TOneHttpForm] 28 | function PostForm(name: string; sex: string): string; 29 | 30 | //增加匿名路由,访问地址如下 31 | //http://127.0.0.1:9090/DemoAttribute/mytest 32 | //而不是 http://127.0.0.1:9090/DemoAttribute/CustRouter 33 | [TOneRouter('/mytest')] 34 | [TOneHttpPost] 35 | function CustRouter(name: string; sex: string): string; 36 | end; 37 | 38 | implementation 39 | 40 | function CreateNewDemoAttributeController(QRouterItem: TOneRouterWorkItem): TObject; 41 | var 42 | lController: TDemoAttributeController; 43 | begin 44 | // 自定义创建控制器类,否则会按 TPersistentclass.create 45 | // 最好自定义一个好 46 | lController := TDemoAttributeController.Create; 47 | // 挂载RTTI信息 48 | lController.RouterItem := QRouterItem; 49 | result := lController; 50 | end; 51 | 52 | function TDemoAttributeController.GetTest(name: string; sex: string): string; 53 | begin 54 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 55 | end; 56 | 57 | function TDemoAttributeController.GetPath(name: string; sex: string): string; 58 | begin 59 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 60 | end; 61 | 62 | function TDemoAttributeController.PostTest(name: string; sex: string): string; 63 | begin 64 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 65 | end; 66 | 67 | function TDemoAttributeController.PostForm(name: string; sex: string): string; 68 | begin 69 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 70 | end; 71 | 72 | function TDemoAttributeController.CustRouter(name: string; sex: string): string; 73 | begin 74 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 75 | end; 76 | 77 | // 注册到路由 78 | initialization 79 | 80 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 81 | // 单例模式注册 82 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoAttribute', TDemoAttributeController, 100, CreateNewDemoAttributeController); 83 | 84 | finalization 85 | 86 | end. 87 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoAuthorController.pas: -------------------------------------------------------------------------------- 1 | unit DemoAuthorController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB, System.JSON, System.IOUtils, OneAttribute; 8 | 9 | type 10 | TDemoAuthorController = class(TOneControllerBase) 11 | public 12 | // 建议使用方式 13 | // 跟据ulr?后面的参数获取相关验证信息 14 | [TOneAuthor(TOneAuthorGetMode.token)] 15 | [TOneHttpGet] 16 | function GetTestA(name: string; sex: string): string; 17 | 18 | // 建议使用方式 19 | // 跟据关部 Authorization获取验证信息 20 | [TOneAuthor(TOneAuthorGetMode.header)] 21 | [TOneHttpGet] 22 | function GetTestB(name: string; sex: string): string; 23 | 24 | // 底程有提供相关方法,线程安全直接调用 25 | // 但个人建议还是用注解方式 26 | [TOneHttpGet] 27 | function GetTestC(name: string; sex: string): string; 28 | end; 29 | 30 | implementation 31 | 32 | function CreateDemoAuthorController(QRouterItem: TOneRouterWorkItem): TObject; 33 | var 34 | lController: TDemoAuthorController; 35 | begin 36 | // 自定义创建控制器类,否则会按 TPersistentclass.create 37 | // 最好自定义一个好 38 | lController := TDemoAuthorController.Create; 39 | // 挂载RTTI信息 40 | lController.RouterItem := QRouterItem; 41 | result := lController; 42 | end; 43 | 44 | function TDemoAuthorController.GetTestA(name: string; sex: string): string; 45 | begin 46 | //底程会先调用 TOneAuthor(TOneAuthorGetMode.token)注解,判断是否授权 47 | //没有的话,不会调用此方法,会返回无授权信息 48 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 49 | end; 50 | 51 | function TDemoAuthorController.GetTestB(name: string; sex: string): string; 52 | begin 53 | //底程会先调用 TOneAuthor(TOneAuthorGetMode.header)注解,判断是否授权 54 | //没有的话,不会调用此方法,会返回无授权信息 55 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 56 | end; 57 | 58 | function TDemoAuthorController.GetTestC(name: string; sex: string): string; 59 | var 60 | lErrMsg: string; 61 | begin 62 | //一定会调用到此方法,手动判断是否授权 63 | if not self.CheckCureentToken(lErrMsg) then 64 | begin 65 | result := lErrMsg; 66 | exit; 67 | end; 68 | result := '姓名:[' + name + '];姓别:[' + sex + ']'; 69 | end; 70 | 71 | // 注册到路由 72 | initialization 73 | 74 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 75 | // 单例模式注册 76 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoAuthor', TDemoAuthorController, 100, CreateDemoAuthorController); 77 | 78 | finalization 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoBController.pas: -------------------------------------------------------------------------------- 1 | unit DemoBController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB, System.JSON; 8 | 9 | type 10 | TDemoBController = class(TOneControllerBase) 11 | private 12 | 13 | public 14 | // 要对外访问的,方法全要放在pulibc部份,外面才可访问 15 | procedure DoTest(); 16 | 17 | end; 18 | 19 | implementation 20 | 21 | function CreateNewDemoBController(QRouterItem: TOneRouterItem): TObject; 22 | var 23 | lController: TDemoBController; 24 | begin 25 | // 自定义创建控制器类,否则会按 TPersistentclass.create 26 | // 最好自定义一个好 27 | lController := TDemoBController.Create; 28 | // 挂载RTTI信息 29 | lController.RouterItem := QRouterItem; 30 | result := lController; 31 | end; 32 | 33 | procedure TDemoBController.DoTest(); 34 | var 35 | lStr: string; 36 | begin 37 | lStr := '1231345'; 38 | end; 39 | 40 | // 注册到路由 41 | initialization 42 | 43 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 44 | // 多例模式注册 45 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoB', 46 | TDemoBController, 10, CreateNewDemoBController); 47 | 48 | finalization 49 | 50 | end. 51 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoDataController.pas: -------------------------------------------------------------------------------- 1 | unit DemoDataController; 2 | 3 | // 结果返回是jsonobject,jsonArray事例 4 | interface 5 | 6 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 7 | System.Generics.Collections, System.Contnrs, System.Classes, 8 | FireDAC.Comp.Client, Data.DB, System.JSON; 9 | 10 | type 11 | TDemoDataController = class(TOneControllerBase) 12 | public 13 | // 返回结果 [{"name":"flm0"},{"name":"flm1"},{"name":"flm2"}] 14 | function GetData(): TFDMemtable; 15 | // 返回结果 [{"name":"flm0"},{"name":"flm1"},{"name":"flm2"}] 16 | function GetQuery(): TFDQuery; 17 | end; 18 | 19 | function CreateNewDemoDataController(QRouterItem: TOneRouterWorkItem): TObject; 20 | 21 | implementation 22 | 23 | function CreateNewDemoDataController(QRouterItem: TOneRouterWorkItem): TObject; 24 | var 25 | lController: TDemoDataController; 26 | begin 27 | // 自定义创建控制器类,否则会按 TPersistentclass.create 28 | // 最好自定义一个好 29 | lController := TDemoDataController.Create; 30 | // 挂载RTTI信息 31 | lController.RouterItem := QRouterItem; 32 | result := lController; 33 | end; 34 | 35 | function TDemoDataController.GetData(): TFDMemtable; 36 | var 37 | i: integer; 38 | begin 39 | result := TFDMemtable.Create(nil); 40 | result.FieldDefs.Add('name', ftString, 20, false); 41 | result.FieldDefs.Add('age', ftInteger, 0, True); 42 | result.CreateDataSet(); 43 | for i := 0 to 99999 do 44 | begin 45 | result.Append; 46 | result.FieldByName('name').AsString := 'flm' + i.ToString(); 47 | result.FieldByName('age').AsInteger := i; 48 | result.Post; 49 | end; 50 | end; 51 | 52 | function TDemoDataController.GetQuery(): TFDQuery; 53 | var 54 | i: integer; 55 | begin 56 | result := TFDQuery.Create(nil); 57 | // 当着本地缓存,否则要连接数据库 58 | result.CachedUpdates := True; 59 | result.FieldDefs.Add('name', ftString, 20, false); 60 | result.FieldDefs.Add('age', ftInteger, 0, True); 61 | result.CreateDataSet(); 62 | for i := 0 to 9 do 63 | begin 64 | result.Append; 65 | result.FieldByName('name').AsString := 'flm' + i.ToString(); 66 | result.FieldByName('age').AsInteger := i; 67 | result.Post; 68 | end; 69 | end; 70 | 71 | // 注册到路由 72 | initialization 73 | 74 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 75 | // 多例模式注册 76 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoData', TDemoDataController, 0, CreateNewDemoDataController); 77 | 78 | finalization 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoEvenController.pas: -------------------------------------------------------------------------------- 1 | unit DemoEvenController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB, System.JSON, Rtti; 8 | 9 | type 10 | {$M+} 11 | TMyProc = reference to procedure(); 12 | {$M-} 13 | 14 | procedure myTest; 15 | 16 | implementation 17 | 18 | procedure myTest; 19 | begin 20 | 21 | end; 22 | 23 | // 注册到路由 24 | initialization 25 | 26 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 27 | // 多例模式注册 28 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPointerWork('DemoMyEven', TValue.From(myTest), 10); 29 | 30 | finalization 31 | 32 | end. 33 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoJsonController.pas: -------------------------------------------------------------------------------- 1 | unit DemoJsonController; 2 | 3 | // 结果返回是jsonobject,jsonArray事例 4 | interface 5 | 6 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 7 | System.Generics.Collections, System.Contnrs, System.Classes, 8 | FireDAC.Comp.Client, Data.DB, System.JSON; 9 | 10 | type 11 | TDemoJsonController = class(TOneControllerBase) 12 | public 13 | // 返回结果 {"name":"flm0"} 14 | function GetJsonObject(): TJsonObject; 15 | // 返回结果 [{"name":"flm0"},{"name":"flm1"},{"name":"flm2"}] 16 | function GetJsonArray(): TJsonArray; 17 | 18 | // 最好是 TJsonValue做参数,如果传进的是一个数组也能正常接收 19 | // 然后在逻辑判断是JSONOBJECT还是JSONARRAY 20 | function GetJsonParam(QJsonObj: TJsonObject): string; 21 | end; 22 | 23 | function CreateNewDemoJsonController(QRouterItem: TOneRouterWorkItem): TObject; 24 | 25 | implementation 26 | 27 | function CreateNewDemoJsonController(QRouterItem: TOneRouterWorkItem): TObject; 28 | var 29 | lController: TDemoJsonController; 30 | begin 31 | // 自定义创建控制器类,否则会按 TPersistentclass.create 32 | // 最好自定义一个好 33 | lController := TDemoJsonController.Create; 34 | // 挂载RTTI信息 35 | lController.RouterItem := QRouterItem; 36 | result := lController; 37 | end; 38 | 39 | function TDemoJsonController.GetJsonObject(): TJsonObject; 40 | begin 41 | result := TJsonObject.Create; 42 | result.AddPair('name', 'flm'); 43 | end; 44 | 45 | function TDemoJsonController.GetJsonArray(): TJsonArray; 46 | var 47 | lJsonObj: TJsonObject; 48 | i: integer; 49 | begin 50 | result := TJsonArray.Create; 51 | for i := 0 to 9 do 52 | begin 53 | lJsonObj := TJsonObject.Create; 54 | lJsonObj.AddPair('name', 'flm' + i.ToString); 55 | result.Add(lJsonObj); 56 | end; 57 | end; 58 | 59 | function TDemoJsonController.GetJsonParam(QJsonObj: TJsonObject): string; 60 | begin 61 | result := QJsonObj.ToString; 62 | end; 63 | 64 | // 注册到路由 65 | initialization 66 | 67 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 68 | // 多例模式注册 69 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoJson', 70 | TDemoJsonController, 10, CreateNewDemoJsonController); 71 | 72 | finalization 73 | 74 | end. 75 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoLogController.pas: -------------------------------------------------------------------------------- 1 | unit DemoLogController; 2 | 3 | // 结果返回是jsonobject,jsonArray事例 4 | interface 5 | 6 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 7 | System.Generics.Collections, System.Contnrs, System.Classes, 8 | FireDAC.Comp.Client, Data.DB, System.JSON, OneControllerResult; 9 | 10 | type 11 | TDemoLogController = class(TOneControllerBase) 12 | public 13 | function TestWrite(): boolean; 14 | end; 15 | 16 | function CreateNewDemoLogController(QRouterItem: TOneRouterWorkItem): TObject; 17 | 18 | implementation 19 | 20 | uses OneGlobal, OneZTManage; 21 | 22 | function CreateNewDemoLogController(QRouterItem: TOneRouterWorkItem): TObject; 23 | var 24 | lController: TDemoLogController; 25 | begin 26 | // 自定义创建控制器类,否则会按 TPersistentclass.create 27 | // 最好自定义一个好 28 | lController := TDemoLogController.Create; 29 | // 挂载RTTI信息 30 | lController.RouterItem := QRouterItem; 31 | result := lController; 32 | end; 33 | 34 | function TDemoLogController.TestWrite(): boolean; 35 | var 36 | lOneGlobal: TOneGlobal; 37 | begin 38 | lOneGlobal := TOneGlobal.GetInstance(); 39 | lOneGlobal.Log.WriteLog('当前时间:' + FormatDateTime 40 | ('yyyy-mm-dd hh:mm:ss zzz', now())); 41 | lOneGlobal.Log.WriteLog('写入数据测试12345678910'); 42 | result := true; 43 | end; 44 | 45 | // 注册到路由 46 | initialization 47 | 48 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 49 | // 多例模式注册 50 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoLog', 51 | TDemoLogController, 0, CreateNewDemoLogController); 52 | 53 | finalization 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoMyController.pas: -------------------------------------------------------------------------------- 1 | unit DemoMyController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB, System.JSON; 8 | 9 | type 10 | TMyClass = class 11 | public 12 | name: string; 13 | age: integer; 14 | end; 15 | 16 | TDemoMyController = class(TOneControllerBase) 17 | private 18 | public 19 | function test(name: string; age: integer): string; 20 | function testClass(myInfo: TMyClass): string; 21 | function testJson(QJson: TJsonObject): string; 22 | function OneGetTest(name: string; age: integer): string; 23 | function testGet(name: string): TMyClass; 24 | function getData(): TFDMemtable; 25 | end; 26 | 27 | implementation 28 | 29 | function CreateNewDemoMyController(QRouterItem: TOneRouterWorkItem): TObject; 30 | var 31 | lController: TDemoMyController; 32 | begin 33 | // 自定义创建控制器类,否则会按 TPersistentclass.create 34 | // 最好自定义一个好 35 | lController := TDemoMyController.Create; 36 | // 挂载RTTI信息 37 | lController.RouterItem := QRouterItem; 38 | result := lController; 39 | end; 40 | 41 | function TDemoMyController.test(name: string; age: integer): string; 42 | var 43 | lSt: string; 44 | begin 45 | result := '我接收到信息name:' + name + '年龄age:' + age.ToString; 46 | end; 47 | 48 | function TDemoMyController.testClass(myInfo: TMyClass): string; 49 | begin 50 | result := '我接收到信息name:' + myInfo.name + '年龄age:' + myInfo.age.ToString; 51 | end; 52 | 53 | function TDemoMyController.testJson(QJson: TJsonObject): string; 54 | begin 55 | result := '我接收到信息name:' + QJson.GetValue('name') + '年龄age:' + QJson.GetValue('age').ToString; 56 | end; 57 | 58 | function TDemoMyController.OneGetTest(name: string; age: integer): string; 59 | begin 60 | result := '我接收到信息name:' + name + '年龄age:' + age.ToString; 61 | end; 62 | 63 | function TDemoMyController.testGet(name: string): TMyClass; 64 | begin 65 | result := TMyClass.Create; 66 | result.name := '我接收到信息name:' + name; 67 | result.age := 9999; 68 | end; 69 | 70 | function TDemoMyController.getData(): TFDMemtable; 71 | var i:integer; 72 | begin 73 | result := TFDMemtable.Create(nil); 74 | result.FieldDefs.Add('name', ftString, 20, false); 75 | result.FieldDefs.Add('age', ftInteger, 0, True); 76 | result.CreateDataSet(); 77 | for i := 0 to 9 do 78 | begin 79 | result.Append; 80 | result.FieldByName('name').AsString := 'flm' + i.ToString(); 81 | result.FieldByName('age').AsInteger := i; 82 | result.Post; 83 | end; 84 | end; 85 | 86 | // 注册到路由 87 | initialization 88 | 89 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 90 | // 多例模式注册 91 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoMy', TDemoMyController, 10, CreateNewDemoMyController); 92 | 93 | finalization 94 | 95 | end. 96 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoOneWorkThread.pas: -------------------------------------------------------------------------------- 1 | unit DemoOneWorkThread; 2 | 3 | interface 4 | 5 | uses OneThread, OneHttpController, OneHttpRouterManage, system.SysUtils; 6 | 7 | type 8 | TDemoThreadController = class(TOneControllerBase) 9 | public 10 | function CreateWork(): string; 11 | function StarWork(): string; 12 | function FreeWork(): string; 13 | end; 14 | 15 | function CreateNewDemoController(QRouterItem: TOneRouterWorkItem): TObject; 16 | procedure doWork(); 17 | procedure createUnitWork(); 18 | 19 | var 20 | unit_WorkThread: TOneSingleWorkThread; 21 | 22 | implementation 23 | 24 | procedure doWork(); 25 | begin 26 | sleep(1000 * 2); 27 | end; 28 | 29 | procedure createUnitWork(); 30 | begin 31 | if unit_WorkThread = nil then 32 | begin 33 | unit_WorkThread := TOneSingleWorkThread.Create(nil, doWork); 34 | end; 35 | end; 36 | 37 | function TDemoThreadController.CreateWork(): string; 38 | begin 39 | if unit_WorkThread = nil then 40 | begin 41 | DemoOneWorkThread.createUnitWork(); 42 | Result := '启动成功'; 43 | end 44 | else 45 | begin 46 | Result := '已经启动'; 47 | end; 48 | 49 | end; 50 | 51 | function TDemoThreadController.StarWork(): string; 52 | begin 53 | if unit_WorkThread = nil then 54 | begin 55 | Result := '未启动,请先启动'; 56 | end 57 | else 58 | begin 59 | unit_WorkThread.StartWork; 60 | Result := '开始工作'; 61 | end; 62 | 63 | end; 64 | 65 | function TDemoThreadController.FreeWork(): string; 66 | begin 67 | if unit_WorkThread = nil then 68 | begin 69 | Result := '未启动,请先启动'; 70 | end 71 | else 72 | begin 73 | unit_WorkThread.Free; 74 | Result := '结束工作'; 75 | end; 76 | end; 77 | 78 | function CreateNewDemoController(QRouterItem: TOneRouterWorkItem): TObject; 79 | var 80 | lController: TDemoThreadController; 81 | begin 82 | // 自定义创建控制器类,否则会按 TPersistentclass.create 83 | // 最好自定义一个好 84 | lController := TDemoThreadController.Create; 85 | // 挂载RTTI信息 86 | lController.RouterItem := QRouterItem; 87 | Result := lController; 88 | end; 89 | 90 | // 注册到路由 91 | initialization 92 | 93 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 94 | // 多例模式注册 95 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoThread', 96 | TDemoThreadController, 100, CreateNewDemoController); 97 | 98 | finalization 99 | 100 | if unit_WorkThread <> nil then 101 | begin 102 | unit_WorkThread.Free; 103 | end 104 | 105 | end. 106 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoTestController.pas: -------------------------------------------------------------------------------- 1 | unit DemoTestController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, 7 | FireDAC.Comp.Client, Data.DB; 8 | 9 | type 10 | TDemoController = class(TOneControllerBase) 11 | 12 | end; 13 | 14 | implementation 15 | 16 | end. 17 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoUrlPathController.pas: -------------------------------------------------------------------------------- 1 | unit DemoUrlPathController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, 6 | system.Generics.Collections, system.StrUtils, system.SysUtils, Data.DB, 7 | FireDAC.Comp.Client, OneControllerResult; 8 | 9 | type 10 | 11 | TDemoUrlPathController = class(TOneControllerBase) 12 | public 13 | // 请求 url xxxx/DemoUrlPath/OnePathTest/flm123 14 | function OnePathTest(id: string): string; 15 | // 请求 url xxxx/DemoUrlPath/OnePathTest/flm123/18 16 | function OnePathTest2(id: string; age: integer): string; 17 | end; 18 | 19 | function CreateNewDemoUrlPathController(QRouterItem: TOneRouterWorkItem): TObject; 20 | 21 | implementation 22 | 23 | uses OneGlobal; 24 | 25 | function CreateNewDemoUrlPathController(QRouterItem: TOneRouterWorkItem) 26 | : TObject; 27 | var 28 | lController: TDemoUrlPathController; 29 | begin 30 | // 自定义创建控制器类,否则会按 TPersistentclass.create 31 | // 最好自定义一个好 32 | lController := TDemoUrlPathController.Create; 33 | // 挂载RTTI信息 34 | lController.RouterItem := QRouterItem; 35 | result := lController; 36 | end; 37 | 38 | function TDemoUrlPathController.OnePathTest(id: string): string; 39 | begin 40 | result := 'UrlPath参数:id=' + id; 41 | end; 42 | 43 | function TDemoUrlPathController.OnePathTest2(id: string; age: integer): string; 44 | begin 45 | result := 'UrlPath参数:id1=' + id + ';age=' + age.ToString; 46 | end; 47 | 48 | initialization 49 | 50 | // 单例模式注册 51 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoUrlPath', TDemoUrlPathController, 0, CreateNewDemoUrlPathController); 52 | 53 | finalization 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoVersionController.pas: -------------------------------------------------------------------------------- 1 | unit DemoVersionController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, System.IOUtils, 7 | FireDAC.Comp.Client, Data.DB, System.JSON, OneControllerResult, OneFileHelper; 8 | 9 | type 10 | TDemoV1Controller = class(TOneControllerBase) 11 | public 12 | function test(): string; 13 | end; 14 | 15 | TDemoV2Controller = class(TOneControllerBase) 16 | public 17 | function test(): string; 18 | end; 19 | 20 | implementation 21 | 22 | function TDemoV1Controller.test(): string; 23 | 24 | begin 25 | result := '我是v1版本'; 26 | end; 27 | 28 | function TDemoV2Controller.test(): string; 29 | 30 | begin 31 | result := '我是v2版本'; 32 | end; 33 | 34 | // 注册到路由 35 | initialization 36 | 37 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('v1/demo', TDemoV1Controller, 10, nil); 38 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('v2/demo', TDemoV2Controller, 10, nil); 39 | 40 | finalization 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoWebFileController.pas: -------------------------------------------------------------------------------- 1 | unit DemoWebFileController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 6 | System.Generics.Collections, System.Contnrs, System.Classes, System.IOUtils, 7 | FireDAC.Comp.Client, Data.DB, System.JSON, OneControllerResult, OneFileHelper, Web.ReqMulti, 8 | OneMultipart, Web.ReqFiles; 9 | 10 | type 11 | TDemoWebFileController = class(TOneControllerBase) 12 | public 13 | // OneGet取url参数。通过web预览图片 14 | function OneGetFile(fileName: string): TActionResult; 15 | // 解析 multipart/form-data提交的数据,只需要参数类型是 TOneMultipartDecode就行,其它的交给底程处理解析 16 | function WebPostFormData(QFormData: TOneMultipartDecode): TActionResult; 17 | end; 18 | 19 | implementation 20 | 21 | function CreateNewDemoWebFileController(QRouterItem: TOneRouterWorkItem): TObject; 22 | var 23 | lController: TDemoWebFileController; 24 | begin 25 | // 自定义创建控制器类,否则会按 TPersistentclass.create 26 | // 最好自定义一个好 27 | lController := TDemoWebFileController.Create; 28 | // 挂载RTTI信息 29 | lController.RouterItem := QRouterItem; 30 | result := lController; 31 | end; 32 | 33 | function TDemoWebFileController.OneGetFile(fileName: string): TActionResult; 34 | var 35 | lFileName: string; 36 | begin 37 | result := TActionResult.Create(true, false); 38 | // 比如 D:\test目录下 39 | lFileName := OneFileHelper.CombinePath('D:\test', fileName); 40 | if not TFile.Exists(lFileName) then 41 | begin 42 | result.ResultMsg := '文件不存在'; 43 | exit; 44 | end; 45 | // 返回的文件物理路径放在这 46 | result.ResultData := lFileName; 47 | // 代表返回文件 48 | result.SetResultTrueFile(); 49 | end; 50 | 51 | function TDemoWebFileController.WebPostFormData(QFormData: TOneMultipartDecode): TActionResult; 52 | var 53 | i: integer; 54 | lWebRequestFile: TOneRequestFile; 55 | tempStream: TCustomMemoryStream; 56 | begin 57 | result := TActionResult.Create(false, false); 58 | // 接收到的文件 59 | for i := 0 to QFormData.Files.count - 1 do 60 | begin 61 | lWebRequestFile := TOneRequestFile(QFormData.Files.items[i]); 62 | result.ResultData := result.ResultData + '当前接收到文件参数[' + lWebRequestFile.FieldName + ']' + '文件名称[' + lWebRequestFile.fileName + ']' + #10#13; 63 | // 文件流 ,至于要咱样是业务问题 64 | tempStream := TCustomMemoryStream(lWebRequestFile.Stream); 65 | tempStream.Position := 0; 66 | tempStream.SaveToFile(lWebRequestFile.fileName); 67 | end; 68 | // 接收到的参数,自已的业务自已分析 69 | for i := 0 to QFormData.ContentFields.count - 1 do 70 | begin 71 | result.ResultData := result.ResultData + '当前接收到参数[' + QFormData.ContentFields[i] + ']' + #10#13; 72 | end; 73 | result.SetResultTrue(); 74 | end; 75 | 76 | // 注册到路由 77 | initialization 78 | 79 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 80 | // 多例模式注册 81 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoWebFile', TDemoWebFileController, 10, CreateNewDemoWebFileController); 82 | 83 | finalization 84 | 85 | end. 86 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/DemoWorkCustErrResult.pas: -------------------------------------------------------------------------------- 1 | unit DemoWorkCustErrResult; 2 | 3 | { 未执行到业务层Controll自定义输出错误 消息 } 4 | 5 | interface 6 | 7 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 8 | System.Generics.Collections, System.Contnrs, System.Classes, 9 | FireDAC.Comp.Client, Data.DB, System.JSON; 10 | 11 | type 12 | 13 | TDemoErrController = class(TOneControllerBase) 14 | private 15 | procedure DoWorkCustErrResult(QHTTPCtxt: THTTPCtxt; QHTTPResult: THTTPResult); override; 16 | public 17 | function test(name: string; age: integer): string; 18 | end; 19 | 20 | implementation 21 | 22 | function CreateNewDemoErrorController(QRouterItem: TOneRouterWorkItem): TObject; 23 | var 24 | lController: TDemoErrController; 25 | begin 26 | // 自定义创建控制器类,否则会按 TPersistentclass.create 27 | // 最好自定义一个好 28 | lController := TDemoErrController.Create; 29 | // 挂载RTTI信息 30 | lController.RouterItem := QRouterItem; 31 | result := lController; 32 | end; 33 | 34 | procedure TDemoErrController.DoWorkCustErrResult(QHTTPCtxt: THTTPCtxt; QHTTPResult: THTTPResult); 35 | var 36 | lJson: TJsonObject; 37 | begin 38 | lJson := TJsonObject.Create; 39 | try 40 | lJson.AddPair('code', '211'); 41 | lJson.AddPair('msg', QHTTPResult.ResultMsg); 42 | QHTTPCtxt.OutContent := UTF8EnCode(lJson.ToString()); 43 | finally 44 | lJson.Free; 45 | end; 46 | end; 47 | 48 | function TDemoErrController.test(name: string; age: integer): string; 49 | var 50 | lSt: string; 51 | begin 52 | result := '我接收到信息name:' + name + '年龄age:' + age.ToString; 53 | end; 54 | 55 | // 注册到路由 56 | initialization 57 | 58 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 59 | // 多例模式注册 60 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoErr', TDemoErrController, 10, CreateNewDemoErrorController); 61 | 62 | finalization 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/Demo/backup/DemoDataController.pas.bak: -------------------------------------------------------------------------------- 1 | unit DemoDataController; 2 | 3 | // 结果返回是jsonobject,jsonArray事例 4 | interface 5 | 6 | uses OneHttpController, OneHttpCtxtResult, OneHttpRouterManage, System.SysUtils, 7 | System.Generics.Collections, System.Contnrs, System.Classes, 8 | FireDAC.Comp.Client, Data.DB, System.JSON; 9 | 10 | type 11 | TDemoDataController = class(TOneControllerBase) 12 | public 13 | // 返回结果 [{"name":"flm0"},{"name":"flm1"},{"name":"flm2"}] 14 | function GetData(): TFDMemtable; 15 | // 返回结果 [{"name":"flm0"},{"name":"flm1"},{"name":"flm2"}] 16 | function GetQuery(): TFDQuery; 17 | end; 18 | 19 | function CreateNewDemoDataController(QRouterItem: TOneRouterItem): TObject; 20 | 21 | implementation 22 | 23 | function CreateNewDemoDataController(QRouterItem: TOneRouterItem): TObject; 24 | var 25 | lController: TDemoDataController; 26 | begin 27 | // 自定义创建控制器类,否则会按 TPersistentclass.create 28 | // 最好自定义一个好 29 | lController := TDemoDataController.Create; 30 | // 挂载RTTI信息 31 | lController.RouterItem := QRouterItem; 32 | result := lController; 33 | end; 34 | 35 | function TDemoDataController.GetData(): TFDMemtable; 36 | var 37 | i: integer; 38 | begin 39 | result := TFDMemtable.Create(nil); 40 | result.FieldDefs.Add('name', ftString, 20, false); 41 | result.FieldDefs.Add('age', ftInteger, 0, True); 42 | result.CreateDataSet(); 43 | for i := 0 to 9 do 44 | begin 45 | result.Append; 46 | result.FieldByName('name').AsString := 'flm' + i.ToString(); 47 | result.FieldByName('age').AsInteger := i; 48 | result.Post; 49 | end; 50 | end; 51 | 52 | function TDemoDataController.GetQuery(): TFDQuery; 53 | var 54 | i: integer; 55 | begin 56 | result := TFDQuery.Create(nil); 57 | // 当着本地缓存,否则要连接数据库 58 | result.CachedUpdates := True; 59 | result.FieldDefs.Add('name', ftString, 20, false); 60 | result.FieldDefs.Add('age', ftInteger, 0, True); 61 | result.CreateDataSet(); 62 | for i := 0 to 9 do 63 | begin 64 | result.Append; 65 | result.FieldByName('name').AsString := 'flm' + i.ToString(); 66 | result.FieldByName('age').AsInteger := i; 67 | result.Post; 68 | end; 69 | end; 70 | 71 | // 注册到路由 72 | initialization 73 | 74 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 75 | // 多例模式注册 76 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoData', 77 | TDemoDataController, 10, CreateNewDemoDataController); 78 | 79 | finalization 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/DemoController.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/httpServer/Controller/DemoController.pas -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/OneWsChatController.pas: -------------------------------------------------------------------------------- 1 | unit OneWsChatController; 2 | 3 | { Ws互发消息单元 } 4 | interface 5 | 6 | uses 7 | system.StrUtils, system.SysUtils, Math, system.JSON, system.Threading, system.Classes, 8 | OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, OneHttpConst, 9 | system.Generics.Collections, OneControllerResult, FireDAC.Comp.Client, Data.DB, OneGuID, 10 | OneMultipart; 11 | 12 | type 13 | TWsChatController = class(TOneControllerBase) 14 | public 15 | // 获取在线用户 16 | function GetOnLineUsers(): TActionResult>; 17 | // 发消息给其它用户 18 | function SendMsgToUser(QMsgID: string; QToUserID: int64; QToUserMsg: string): TActionResult; 19 | end; 20 | 21 | implementation 22 | 23 | uses OneGlobal, OneFastLshManage, OneWebSocketServer; 24 | 25 | function CreateNewWsChatController(QRouterItem: TOneRouterWorkItem): Tobject; 26 | var 27 | lController: TWsChatController; 28 | begin 29 | // 自定义创建控制器类,否则会按 TPersistentclass.create 30 | // 最好自定义一个好 31 | lController := TWsChatController.Create; 32 | // 挂载RTTI信息 33 | lController.RouterItem := QRouterItem; 34 | result := lController; 35 | end; 36 | 37 | function TWsChatController.GetOnLineUsers(): TActionResult>; 38 | var 39 | lErrMsg: string; 40 | lOneGlobal: TOneGlobal; 41 | lWsServer: TOneWebSocketServer; 42 | begin 43 | result := TActionResult < TList < TWsToken >>.Create(true, true); 44 | lOneGlobal := OneGlobal.TOneGlobal.GetInstance(); 45 | lWsServer := lOneGlobal.WsServer; 46 | result.ResultData := lWsServer.GetWsTokenList(); 47 | result.SetResultTrue(); 48 | end; 49 | 50 | function TWsChatController.SendMsgToUser(QMsgID: string; QToUserID: int64; QToUserMsg: string): TActionResult; 51 | var 52 | lErrMsg: string; 53 | lOneGlobal: TOneGlobal; 54 | lWsServer: TOneWebSocketServer; 55 | begin 56 | result := TActionResult.Create(false, false); 57 | lOneGlobal := OneGlobal.TOneGlobal.GetInstance(); 58 | lWsServer := lOneGlobal.WsServer; 59 | // 这边一般放在消息队列好点,由服务端队列发送,同时客户端确认收到消息,返回客户端 60 | // 后面在搞吧 61 | lWsServer.SendMsg(QToUserID, QToUserMsg); 62 | result.SetResultTrue; 63 | end; 64 | 65 | initialization 66 | 67 | // 单例模式注册 68 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('OneServer/WsChat', TWsChatController, 69 | 0, CreateNewWsChatController); 70 | 71 | finalization 72 | 73 | end. 74 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/TestApiController.pas: -------------------------------------------------------------------------------- 1 | unit TestApiController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpRouterManage, system.JSON, FireDAC.Comp.Client, data.DB, 6 | system.Classes, system.StrUtils, system.SysUtils; 7 | 8 | type 9 | TTestApiController = class(TOneControllerBase) 10 | public 11 | function TestApi(): string; 12 | function TestName(name: string): string; 13 | function TestJson(QJson: TJsonObject): TJsonObject; 14 | function TestData(): TFDMemTable; 15 | end; 16 | 17 | implementation 18 | 19 | function CreateNewTestApiController(QRouterItem: TOneRouterWorkItem): TObject; 20 | var 21 | lController: TTestApiController; 22 | begin 23 | // 自定义创建控制器类,否则会按 TPersistentclass.create 24 | // 最好自定义一个好 25 | lController := TTestApiController.Create; 26 | // 挂载RTTI信息 27 | lController.RouterItem := QRouterItem; 28 | result := lController; 29 | end; 30 | 31 | function TTestApiController.TestApi(): string; 32 | begin 33 | result := '欢迎您来到TestApi服务'; 34 | end; 35 | 36 | function TTestApiController.TestName(name: string): string; 37 | begin 38 | result := '欢迎您来到TestApi服务[' + name + ']'; 39 | end; 40 | 41 | function TTestApiController.TestJson(QJson: TJsonObject): TJsonObject; 42 | begin 43 | result := TJsonObject.Create; 44 | result.AddPair('QJson', QJson.ToString); 45 | end; 46 | 47 | function TTestApiController.TestData(): TFDMemTable; 48 | var 49 | i: integer; 50 | begin 51 | result := TFDMemTable.Create(nil); 52 | result.FieldDefs.Add('ID', ftInteger, 0, True); 53 | result.FieldDefs.Add('Name', ftString, 20, false); 54 | result.CreateDataSet(); 55 | for i := 0 to 10 do 56 | begin 57 | result.Append; 58 | result.Fields[0].AsInteger := i; 59 | result.Fields[1].AsString := 'name' + inttostr(i); 60 | result.Post; 61 | end; 62 | 63 | end; 64 | 65 | // 注册到路由 66 | initialization 67 | 68 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 69 | // 多例模式注册 70 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('TestApi/myTest', TTestApiController, 0, CreateNewTestApiController); 71 | 72 | finalization 73 | 74 | end. 75 | -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/UniDemoController.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/OneServer/httpServer/Controller/UniDemoController.pas -------------------------------------------------------------------------------- /OneServer/httpServer/Controller/ZTManageController.pas: -------------------------------------------------------------------------------- 1 | unit ZTManageController; 2 | 3 | interface 4 | 5 | uses OneHttpController, OneHttpRouterManage, OneHttpCtxtResult, OneTokenManage, 6 | system.Generics.Collections, OneControllerResult; 7 | 8 | type 9 | 10 | TZTInfo = class 11 | private 12 | FZTCode: string; 13 | FZTCaption: string; 14 | public 15 | property ZTCode: string read FZTCode write FZTCode; 16 | property ZTCaption: string read FZTCaption write FZTCaption; 17 | end; 18 | 19 | TOneZTController = class(TOneControllerBase) 20 | public 21 | function OneGetZTList(): TActionResult>; 22 | end; 23 | 24 | function CreateNewOneZTController(QRouterItem: TOneRouterWorkItem): TObject; 25 | 26 | implementation 27 | 28 | uses OneGlobal, OneZTManage; 29 | 30 | function CreateNewOneZTController(QRouterItem: TOneRouterWorkItem): TObject; 31 | var 32 | lController: TOneZTController; 33 | begin 34 | // 自定义创建控制器类,否则会按 TPersistentclass.create 35 | // 最好自定义一个好 36 | lController := TOneZTController.Create; 37 | // 挂载RTTI信息 38 | lController.RouterItem := QRouterItem; 39 | result := lController; 40 | end; 41 | 42 | function TOneZTController.OneGetZTList(): TActionResult>; 43 | var 44 | lOneGlobal: TOneGlobal; 45 | lZTList: TList; 46 | lZTInfo: TZTInfo; 47 | i: integer; 48 | begin 49 | // 结构体会自动释放,设成true,false多一样 50 | result := TActionResult < TList < TZTInfo >>.Create(true, true); 51 | lOneGlobal := TOneGlobal.GetInstance(); 52 | lZTList := lOneGlobal.ZTMangeSet.ZTSetList; 53 | result.ResultData := TList.Create; 54 | for i := 0 to lZTList.Count - 1 do 55 | begin 56 | lZTInfo := TZTInfo.Create; 57 | result.ResultData.Add(lZTInfo); 58 | lZTInfo.ZTCode := lZTList[i].ZTCode; 59 | lZTInfo.ZTCaption := lZTList[i].ZTCaption; 60 | end; 61 | result.SetResultTrue(); 62 | end; 63 | 64 | initialization 65 | 66 | // 单例模式注册 67 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('/OneServer/ZTManage', TOneZTController, 0, CreateNewOneZTController); 68 | 69 | finalization 70 | 71 | end. 72 | -------------------------------------------------------------------------------- /OneServer/httpServer/OneControllerResult.pas: -------------------------------------------------------------------------------- 1 | unit OneControllerResult; 2 | 3 | interface 4 | 5 | uses system.Generics.Collections, system.Rtti, OneRttiHelper, OneHttpConst; 6 | 7 | type 8 | IActionResult = interface; 9 | 10 | IActionResult = interface 11 | ['{FBE2DEB1-9319-4DD4-93EC-17FF6E68A2C3}'] 12 | 13 | end; 14 | 15 | // 16 | 17 | TActionResult = class 18 | private 19 | FResultSuccess: boolean; 20 | FResultCode: string; 21 | FResultMsg: string; 22 | FResultData: T; 23 | FIsFile: boolean; // 是否文件返回 24 | FFreeResultData: boolean; 25 | FFreeListItem: boolean; 26 | private 27 | function GetData(): T; 28 | public 29 | /// 30 | /// 创建一个结果集,QFreeResultData是否释放ResultData数据, 31 | /// QFreeListItem如果ReslutData是List等容器,是否释放item里面对象 32 | /// 33 | /// 34 | constructor Create(QFreeResultData: boolean; QFreeListItem: boolean); 35 | destructor Destroy; override; 36 | procedure SetResultTrue(); 37 | // 文件相关 38 | procedure SetResultTrueFile(); 39 | function IsResultFile(): boolean; 40 | procedure SetTokenFail(); 41 | public 42 | // 和前端保持一至小写 43 | property ResultSuccess: boolean read FResultSuccess write FResultSuccess; 44 | property ResultCode: string read FResultCode write FResultCode; 45 | property ResultMsg: string read FResultMsg write FResultMsg; 46 | property ResultData: T read FResultData write FResultData; 47 | end; 48 | 49 | implementation 50 | 51 | constructor TActionResult.Create(QFreeResultData: boolean; QFreeListItem: boolean); 52 | begin 53 | inherited Create; 54 | self.FFreeResultData := QFreeResultData; 55 | self.FFreeListItem := QFreeListItem; 56 | self.FResultSuccess := false; 57 | self.ResultCode := HTTP_ResultCode_Fail; 58 | self.FIsFile := false; 59 | end; 60 | 61 | destructor TActionResult.Destroy; 62 | var 63 | lTValue: TValue; 64 | begin 65 | 66 | if FFreeResultData then 67 | begin 68 | // 判断是不是对象 69 | // 要自动释放类的,需要释放 70 | TValue.Make(@self.ResultData, system.TypeInfo(T), lTValue); 71 | OneRttiHelper.FreeTValue(lTValue, self.FFreeListItem); 72 | end; 73 | inherited Destroy; 74 | end; 75 | 76 | procedure TActionResult.SetResultTrue(); 77 | begin 78 | self.FResultSuccess := true; 79 | self.ResultCode := HTTP_ResultCode_True; 80 | end; 81 | 82 | procedure TActionResult.SetResultTrueFile(); 83 | begin 84 | self.FIsFile := true; 85 | self.FResultSuccess := true; 86 | self.ResultCode := HTTP_ResultCode_True; 87 | end; 88 | 89 | function TActionResult.GetData(): T; 90 | begin 91 | Result := self.FResultData 92 | end; 93 | 94 | function TActionResult.IsResultFile(): boolean; 95 | begin 96 | Result := self.FIsFile; 97 | end; 98 | 99 | procedure TActionResult.SetTokenFail(); 100 | begin 101 | self.FResultCode := HTTP_ResultCode_TokenFail; 102 | self.FResultMsg := 'Token验证失败,请重新登陆'; 103 | end; 104 | 105 | end. 106 | -------------------------------------------------------------------------------- /OneServer/httpServer/OneHttpConst.pas: -------------------------------------------------------------------------------- 1 | unit OneHttpConst; 2 | 3 | interface 4 | 5 | uses system.StrUtils, system.SysUtils; 6 | 7 | const 8 | HTTP_Status_TokenFail = 498; 9 | HTTP_ResultCode_True = '0001'; 10 | HTTP_ResultCode_Fail = '0002'; 11 | HTTP_ResultCode_TokenFail = 'TokenFail'; 12 | HTTP_ResultCode_TokenSignFail = 'TokenSignFail'; 13 | HTTP_URL_TokenName = 'token'; 14 | HTTP_URL_TokenTime = 'time'; 15 | HTTP_URL_TokenSign = 'sign'; 16 | 17 | type 18 | emRowState = (unknowState, selectState, editState, insertState, delState); 19 | 20 | TOneOrmRowState = class 21 | private 22 | FRowState_sys: emRowState; 23 | public 24 | function GetRowState(): emRowState; 25 | procedure SetRowState(QRowState: emRowState); overload; 26 | procedure SetRowState(QID: string); overload; 27 | end; 28 | 29 | implementation 30 | 31 | function TOneOrmRowState.GetRowState(): emRowState; 32 | begin 33 | result := FRowState_sys; 34 | end; 35 | 36 | procedure TOneOrmRowState.SetRowState(QRowState: emRowState); 37 | begin 38 | FRowState_sys := QRowState; 39 | end; 40 | 41 | procedure TOneOrmRowState.SetRowState(QID: string); 42 | begin 43 | FRowState_sys := emRowState.unknowState; 44 | QID := Trim(QID); 45 | if (QID = '-1') or (QID = '') then 46 | begin 47 | FRowState_sys := emRowState.insertState; 48 | end 49 | else 50 | begin 51 | FRowState_sys := emRowState.editState; 52 | end; 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /OneServer/httpServer/OneWebSocketConst.pas: -------------------------------------------------------------------------------- 1 | unit OneWebSocketConst; 2 | 3 | interface 4 | 5 | const 6 | WsMsg_cmd_toUserMsg = 'ToUserMsg'; 7 | WsMsg_cmd_ServerNotify = 'ServerNotify'; 8 | WsMsg_cmd_WsUserIDGet = 'WsUserIDGet'; 9 | 10 | type 11 | TWsMsg = class 12 | private 13 | // 消息ID 14 | FMsgID: string; 15 | // 16 | FControllerRoot: string; 17 | // 发送者ConnectionID,'-1'代表发送出去,基它值代表是接收到消息 18 | FFromUserID: string; 19 | FFromUserName: string; 20 | // 接收者ConnectionID 21 | FToUserID: string; 22 | // 消息成功失败代码 23 | FMsgCode: string; 24 | // 消息命令 25 | FMsgCmd: string; 26 | // 消息 27 | FMsgData: string; 28 | // 消息时间 29 | FMsgTime: string; 30 | published 31 | property MsgID: string read FMsgID write FMsgID; 32 | property ControllerRoot: string read FControllerRoot write FControllerRoot; 33 | property FromUserID: string read FFromUserID write FFromUserID; 34 | property FromUserName: string read FFromUserName write FFromUserName; 35 | property ToUserID: string read FToUserID write FToUserID; 36 | property MsgCode: string read FMsgCode write FMsgCode; 37 | property MsgCmd: string read FMsgCmd write FMsgCmd; 38 | property MsgData: string read FMsgData write FMsgData; 39 | property MsgTime: string read FMsgTime write FMsgTime; 40 | end; 41 | 42 | implementation 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /OneServer/使用前说明.txt: -------------------------------------------------------------------------------- 1 | 本人环境是基于 D11的,其它低版本,可能系统库 部份不兼容,不兼容的联系作者纠正 2 | 1.控件包mormot2下载 3 | https://github.com/synopse/mORMot2 4 | 2.控件包mormot2源码路径加到Lib 5 | ----以上多是基础操作不会的不要问,没时间回答----- 6 | 3.打开 OneService.dpr 工程 7 | 4.编译,运行 即可 8 | 5.目前做好了MVC基础功能看源码单元httpServer->Controller->Demo-> DemoController.pas 9 | MVC服务端相关例子写法全在Controller.Demo目录 10 | // 注册到路由 DemoController.initialization部份,路由如何注册 11 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 12 | // 多例模式注册 13 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoA',TDemoController, 100, CreateNewDemoController); 14 | // 单例模式注册 15 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoB',TDemoController, 100, CreateNewDemoController); 16 | // 方法注册 17 | OneHttpRouterManage.GetInitRouterManage().AddHTTPEvenWork('DemoEven',HelloWorldEven, 10); 18 | 6.直接用http页面输入地址请求相关url或者相关HTTP请求工具 19 | 例: http://127.0.0.1:9090/DemoA/GetPersonListT -------------------------------------------------------------------------------- /OneServer/相关脚本.txt: -------------------------------------------------------------------------------- 1 | ---微信账号管理表---- 2 | create table onefast_weixin 3 | ( 4 | [FAccountID] [varchar] primary key, 5 | [FSourceID] [varchar](50) NULL, 6 | [FAppID] [varchar](100) NULL, 7 | [FAppSecret] [varchar](255) NULL, 8 | [FMessageToken] [varchar](30) NULL, 9 | [FMessageEncodingAESKey] [varchar](255) NULL, 10 | [FAccessTokenExpireIn] [int] NULL, 11 | [FAccessToken] [varchar](250) NULL, 12 | [FAccessTokenLastTime] [datetime] NULL, 13 | [FGetAuthorCodeUrl] [varchar](200) NULL, 14 | [FErrWebUrl] [varchar](200) NULL, 15 | [FAccessTokenErrMsg] [varchar](1000) NULL, 16 | [FCreateTime] [datetime] NULL, 17 | [FJsApiTicket] [varchar](250) NULL, 18 | [FJsApiLastTime] [datetime] NULL, 19 | [FGetAuthorCodeAPI] [varchar](200) NULL, 20 | ) -------------------------------------------------------------------------------- /mORMot2-master.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xenli/OneDelphi/9726152259e04b23d615c445b925bd6d06728cbe/mORMot2-master.rar -------------------------------------------------------------------------------- /使用前说明.txt: -------------------------------------------------------------------------------- 1 | 本人环境是基于 D11的,其它低版本,可能系统库 部份不兼容 2 | 1.控件包mormot2下载,群文件里面也有直接到群下载也行 3 | https://github.com/synopse/mORMot2 4 | 2.控件包mormot2源码路径加到Lib 5 | ----以上多是基础操作不会的不要问,没时间回答----- 6 | 3.打开 OneService.dpr 工程 7 | 4.编译,运行 即可 8 | 5.目前做好了MVC基础功能看源码单元httpServer->Controller->Demo-> DemoController.pas 9 | // 注册到路由 DemoController.initialization部份,路由如何注册 10 | // 注意,路由名称 不要一样,否则会判定已注册过,跳过 11 | // 多例模式注册 12 | OneHttpRouterManage.GetInitRouterManage().AddHTTPPoolWork('DemoA',TDemoController, 100, CreateNewDemoController); 13 | // 单例模式注册 14 | OneHttpRouterManage.GetInitRouterManage().AddHTTPSingleWork('DemoB',TDemoController, 100, CreateNewDemoController); 15 | // 方法注册 16 | OneHttpRouterManage.GetInitRouterManage().AddHTTPEvenWork('DemoEven',HelloWorldEven, 10); 17 | 6.直接用http页面输入地址请求相关url或者相关HTTP请求工具 18 | 例: http://127.0.0.1:9090/DemoA/GetPersonListT 19 | 20 | 21 | 22 | 目前传统客户端基本已完成; 23 | 1.数据打开保存,执行DML执行存储过程-对应Demo->OneClientDemo.dproj 24 | 2.客户端事务自由控制-对应Demo->OneCleintDemoCustTran.dproj 25 | 3.多个数据批量打开,批量保存-对应Demo->OneCleintDemoDatas.dproj 26 | 4.客户端post,get请求-对应Demo->OneCleintDemoPostGet.dproj 27 | 5.异步打开数据及保存-对应Demo->OneCleintDemoAsync.dproj 28 | 6.虚拟文件上传下载-对应Demo->OneClientDemoVirtualFile.dproj 29 | 7.大文件上传下载-对应Demo->OneClientDemoVirtualFile.dproj --------------------------------------------------------------------------------