¶Ô±ÈÐÂÎļþ |
| | |
| | | using ExportMap.cs; |
| | | using ExportMap.Models; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using System.IO; |
| | | |
| | | namespace ExportMap.Controllers |
| | | { |
| | | public class TBController : ApiController |
| | | { |
| | | [HttpGet] |
| | | public ResponseMsg<string> CreateMpt(string path, string token) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(path) || string.IsNullOrEmpty(token)) |
| | | return ResponseMsg<string>.fail("pathåtokenåæ°ä¸è½ä¸ºç©º"); |
| | | if (!ExportUtil.VerifyToken(token)) |
| | | return ResponseMsg<string>.fail("ä»¤çæ æ"); |
| | | if (!Directory.Exists(path)) |
| | | return ResponseMsg<string>.fail("æä»¶è·¯å¾ä¸åå¨"); |
| | | |
| | | string err = null; |
| | | string rs = TBUtils.CreateMpt(path, ref err); |
| | | |
| | | if (string.IsNullOrEmpty(rs)) |
| | | return ResponseMsg<string>.fail(null == err ? "失败" : err); |
| | | |
| | | return ResponseMsg<string>.success("æå", rs, 1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); |
| | | return ResponseMsg<string>.fail(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | [HttpGet] |
| | | public string GetTerrain(string path, int z, int x, int y) |
| | | { |
| | | |
| | | return ".terrain"; |
| | | } |
| | | |
| | | [HttpGet] |
| | | public string CreateMpt(string path, string token) |
| | | { |
| | | return path; |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="Controllers\ExportController.cs" /> |
| | | <Compile Include="Controllers\FloatServerController.cs" /> |
| | | <Compile Include="Controllers\licenseEncryptionController.cs" /> |
| | | <Compile Include="Controllers\TBController.cs" /> |
| | | <Compile Include="Controllers\TerraController.cs" /> |
| | | <Compile Include="cs\CacheUtils.cs" /> |
| | | <Compile Include="cs\ConvertUtils.cs" /> |
| | |
| | | <Compile Include="cs\NoBufferPolicySelector.cs" /> |
| | | <Compile Include="cs\OsgbUtils.cs" /> |
| | | <Compile Include="cs\SGUtils.cs" /> |
| | | <Compile Include="cs\TBUtils.cs" /> |
| | | <Compile Include="cs\TerraUtils.cs" /> |
| | | <Compile Include="cs\Tools.cs" /> |
| | | <Compile Include="cs\XYZUtils.cs" /> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace ExportMap.cs |
| | | { |
| | | public class TBUtils |
| | | { |
| | | /// <summary> |
| | | /// å建MPT |
| | | /// </summary> |
| | | public static string CreateMpt(string path, ref string err) |
| | | { |
| | | // |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | <script src="js/insertFiles.js"></script> |
| | | <script> |
| | | var app = {}; |
| | | var path = "20230621"; |
| | | var path = "20230627"; |
| | | var url = "http://127.0.0.1:12316/server/"; |
| | | //var token = "c36e4f94-dfde-401e-9967-2c4a449f1300"; |
| | | var token = "372253ed-0d4a-4f50-908f-d1892e4fe8e1"; |
| | | var token = "8a17604e-3865-43c8-a14f-d4b17ed33656"; |
| | | |
| | | $(function () { |
| | | $("#pathSpan").html(path); |
| | |
| | | |
| | | // ç»¼åæ°æ®å
¥åº |
| | | function insertAllFiles() { |
| | | app.mappers = metaFiles; |
| | | //app.mappers = metaFiles; |
| | | ajax(getUrl("dataUpload/insertFiles"), "POST", JSON.stringify(app.mappers), null, null, function (rs) { |
| | | console.log(rs); |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |