Browse Source

对接微服务接口

master
张剑 2 years ago
parent
commit
fada16196c

+ 3
- 3
XHWK.WKTool/App.config View File

5
   </startup>
5
   </startup>
6
   <appSettings>
6
   <appSettings>
7
     <!--0正式 1测试-->
7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="0" />
8
+    <add key="IsDebug" value="1" />
9
     <!--参数是否加密 0不加密 1加密-->
9
     <!--参数是否加密 0不加密 1加密-->
10
     <add key="IsParameterEncryption" value="0" />
10
     <add key="IsParameterEncryption" value="0" />
11
     <!--版本号-->
11
     <!--版本号-->
12
-    <add key="VersionCode" value="108" />
13
-    <add key="VersionName" value="3.1.14" />
12
+    <add key="VersionCode" value="109" />
13
+    <add key="VersionName" value="3.2.0" />
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15
     <add key="SkinStyle" value="0" />
15
     <add key="SkinStyle" value="0" />
16
     <!--是否输出视频记录日志:0否-->
16
     <!--是否输出视频记录日志:0否-->

+ 2
- 3
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

8
 using System.Windows.Input;
8
 using System.Windows.Input;
9
 
9
 
10
 using XHWK.Model;
10
 using XHWK.Model;
11
-using XHWK.WKTool.Skin;
12
 
11
 
13
 namespace XHWK.WKTool
12
 namespace XHWK.WKTool
14
 {
13
 {
47
                 debugStr = "正式版";
46
                 debugStr = "正式版";
48
             }
47
             }
49
 
48
 
50
-            versionLabel.Content = debugStr+" v" + versionName + "(" + versionCode + ")";
49
+            versionLabel.Content = debugStr + " v" + versionName + "(" + versionCode + ")";
51
 
50
 
52
             LoadingCarouseImg();
51
             LoadingCarouseImg();
53
         }
52
         }
340
                     //软件是否更新,版本号小于0不更新
339
                     //软件是否更新,版本号小于0不更新
341
                     return;
340
                     return;
342
                 }
341
                 }
343
-                string url = APP.apiUrl + "/apprecord/get_new";
342
+                string url = APP.apiUrl + "/sapi/apprecord/get_new";
344
 
343
 
345
                 string result = HttpHelper.PostAndRespStr(url, "{}");
344
                 string result = HttpHelper.PostAndRespStr(url, "{}");
346
                 Model.ResultVo<Model_App> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_App>>(result);
345
                 Model.ResultVo<Model_App> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_App>>(result);

+ 39
- 31
XHWK.WKTool/DAL/DAL_Upload.cs View File

12
 namespace XHWK.WKTool.DAL
12
 namespace XHWK.WKTool.DAL
13
 {
13
 {
14
     /// <summary>
14
     /// <summary>
15
-    /// 上传相关方法
16
-    /// 创建人:赵耀
17
-    /// 创建时间:2020年9月4日
15
+    /// 上传相关方法 创建人:赵耀 创建时间:2020年9月4日
18
     /// </summary>
16
     /// </summary>
19
     public class DAL_Upload
17
     public class DAL_Upload
20
     {
18
     {
21
-        //private string APIRequestAddress = APP.apiUrl;
22
         private string FileRequestAddress = APP.uploadUrl;
19
         private string FileRequestAddress = APP.uploadUrl;
20
+
23
         //private string schoolfileRequestAddress = APP.showImageUrl;
21
         //private string schoolfileRequestAddress = APP.showImageUrl;
24
         /// <summary>
22
         /// <summary>
25
         /// 文件是否允许上传
23
         /// 文件是否允许上传
26
         /// </summary>
24
         /// </summary>
27
-        /// <param name="MD5">MD5</param>
28
-        /// <param name="Message">错误消息</param>
29
-        /// <returns></returns>
25
+        /// <param name="MD5">
26
+        /// MD5
27
+        /// </param>
28
+        /// <param name="Message">
29
+        /// 错误消息
30
+        /// </param>
31
+        /// <returns>
32
+        /// </returns>
30
         public bool IsAllowUploaded(string MD5, out string Message)
33
         public bool IsAllowUploaded(string MD5, out string Message)
31
         {
34
         {
32
             Exception ex = null;
35
             Exception ex = null;
52
                         APP.ResourceAddTwo = resultObj.obj;
55
                         APP.ResourceAddTwo = resultObj.obj;
53
                         //已存在 不允许上传
56
                         //已存在 不允许上传
54
                         return false;
57
                         return false;
55
-                        //    if (string.IsNullOrWhiteSpace(jo["obj"].ToString()))
56
-                        //    {
57
-                        //        //不存在 允许上传
58
-                        //        return true;
59
-                        //    }
60
-                        //    else
61
-                        //    {
62
-                        //        //已存在 不允许上传
63
-                        //        return false;
64
-                        //    }
58
+                        // if (string.IsNullOrWhiteSpace(jo["obj"].ToString())) { //不存在 允许上传 return
59
+                        // true; } else { //已存在 不允许上传 return false; }
65
                     }
60
                     }
66
                     else
61
                     else
67
                     {
62
                     {
81
             LogHelper.WriteErrLog(ErrMessage, ex);
76
             LogHelper.WriteErrLog(ErrMessage, ex);
82
             return false;
77
             return false;
83
         }
78
         }
79
+
84
         /// <summary>
80
         /// <summary>
85
         /// 上报文件合并指令
81
         /// 上报文件合并指令
86
         /// </summary>
82
         /// </summary>
87
-        /// <param name="Savefolder">保存文件位置  学校id/resource</param>
88
-        /// <param name="FileCode">文件唯一编号 Guid</param>
89
-        /// <param name="Message">错误信息</param>
90
-        /// <returns></returns>
83
+        /// <param name="Savefolder">
84
+        /// 保存文件位置 学校id/resource
85
+        /// </param>
86
+        /// <param name="FileCode">
87
+        /// 文件唯一编号 Guid
88
+        /// </param>
89
+        /// <param name="Message">
90
+        /// 错误信息
91
+        /// </param>
92
+        /// <returns>
93
+        /// </returns>
91
         public bool ReportFileMerge(string Savefolder, string FileCode, out string Message)
94
         public bool ReportFileMerge(string Savefolder, string FileCode, out string Message)
92
         {
95
         {
93
             Exception ex = null;
96
             Exception ex = null;
147
         /// <summary>
150
         /// <summary>
148
         /// 上传视频
151
         /// 上传视频
149
         /// </summary>
152
         /// </summary>
150
-        /// <returns></returns>
153
+        /// <returns>
154
+        /// </returns>
151
         public bool UploadVideo(string VideoGuid, out string ErrMessage)
155
         public bool UploadVideo(string VideoGuid, out string ErrMessage)
152
         {
156
         {
153
             ErrMessage = "";
157
             ErrMessage = "";
189
                 {
193
                 {
190
                     return true;
194
                     return true;
191
                 }
195
                 }
192
-
193
             }
196
             }
194
             catch (Exception ex)
197
             catch (Exception ex)
195
             {
198
             {
197
             }
200
             }
198
             return false;
201
             return false;
199
         }
202
         }
203
+
200
         /// <summary>
204
         /// <summary>
201
         /// 上传视频
205
         /// 上传视频
202
         /// </summary>
206
         /// </summary>
203
-        /// <returns></returns>
207
+        /// <returns>
208
+        /// </returns>
204
         public bool UploadVideoTwo(string VideoGuid, out string ErrMessage)
209
         public bool UploadVideoTwo(string VideoGuid, out string ErrMessage)
205
         {
210
         {
206
             ErrMessage = "";
211
             ErrMessage = "";
252
                     string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);
257
                     string fileName = FileToolsCommon.GetFileName(VideoInfo.VideoPath);
253
                     //是否续传
258
                     //是否续传
254
                     bool IsSequel = true;
259
                     bool IsSequel = true;
255
-                    //分块数为0时 从未上传过 
260
+                    //分块数为0时 从未上传过
256
                     if (VideoInfo.Block > 0)
261
                     if (VideoInfo.Block > 0)
257
                     {
262
                     {
258
                         //是否已上传所有分块
263
                         //是否已上传所有分块
267
                             IsSequel = false;
272
                             IsSequel = false;
268
 
273
 
269
                             #region 合并文件
274
                             #region 合并文件
275
+
270
                             //合并文件
276
                             //合并文件
271
                             bool isres = ReportFileMerge(APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource", VideoInfo.FileGuid, out ErrMessage);
277
                             bool isres = ReportFileMerge(APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource", VideoInfo.FileGuid, out ErrMessage);
272
                             if (isres)
278
                             if (isres)
278
                             {
284
                             {
279
                                 return false;
285
                                 return false;
280
                             }
286
                             }
281
-                            #endregion
282
 
287
 
288
+                            #endregion 合并文件
283
                         }
289
                         }
284
                     }
290
                     }
285
                     else
291
                     else
304
                             VideoInfo.IsUpload = true;
310
                             VideoInfo.IsUpload = true;
305
                             return true;
311
                             return true;
306
                         }
312
                         }
307
-
308
                     }
313
                     }
309
 
314
 
310
                     ////临时修改 没有断点续传,每次上传都重新上传。
315
                     ////临时修改 没有断点续传,每次上传都重新上传。
315
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
320
                         long len = VideoInfo.Uploaded * VideoInfo.SliceLen;
316
 
321
 
317
                         #region 废弃
322
                         #region 废弃
323
+
318
                         ////分块
324
                         ////分块
319
                         //for (; len + VideoInfo.SliceLen < filelen; VideoInfo.Uploaded++)
325
                         //for (; len + VideoInfo.SliceLen < filelen; VideoInfo.Uploaded++)
320
                         //{
326
                         //{
336
                         //        return false;
342
                         //        return false;
337
                         //    }
343
                         //    }
338
                         //}
344
                         //}
339
-                        #endregion
345
+
346
+                        #endregion 废弃
340
 
347
 
341
                         //分块
348
                         //分块
342
                         do
349
                         do
373
                         } while (len + VideoInfo.SliceLen < filelen);
380
                         } while (len + VideoInfo.SliceLen < filelen);
374
 
381
 
375
                         #region 合并文件
382
                         #region 合并文件
383
+
376
                         //合并文件
384
                         //合并文件
377
                         bool isres = ReportFileMerge(APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource", VideoInfo.FileGuid, out ErrMessage);
385
                         bool isres = ReportFileMerge(APP.UserInfo.cloudcode + "/" + APP.UserInfo.Schoolid.ToString() + "/resource", VideoInfo.FileGuid, out ErrMessage);
378
                         if (isres)
386
                         if (isres)
384
                         {
392
                         {
385
                             return false;
393
                             return false;
386
                         }
394
                         }
387
-                        #endregion
395
+
396
+                        #endregion 合并文件
388
                     }
397
                     }
389
                     else
398
                     else
390
                     {
399
                     {
399
                         }
408
                         }
400
                     }
409
                     }
401
                 }
410
                 }
402
-
403
             }
411
             }
404
             catch (Exception ex)
412
             catch (Exception ex)
405
             {
413
             {
408
             return false;
416
             return false;
409
         }
417
         }
410
     }
418
     }
411
-}
419
+}

+ 45
- 25
XHWK.WKTool/DAL/XHApi.cs View File

16
         /// <summary>
16
         /// <summary>
17
         /// 激活信息--添加
17
         /// 激活信息--添加
18
         /// </summary>
18
         /// </summary>
19
-        /// <param name="request"></param>
20
-        /// <returns></returns>
19
+        /// <param name="request">
20
+        /// </param>
21
+        /// <returns>
22
+        /// </returns>
21
         public int ActivationAdd(string mac, string device, string projectcode)
23
         public int ActivationAdd(string mac, string device, string projectcode)
22
         {
24
         {
23
             try
25
             try
74
                 return 1;
76
                 return 1;
75
             }
77
             }
76
         }
78
         }
79
+
77
         /// <summary>
80
         /// <summary>
78
         /// 激活信息--添加激活历史
81
         /// 激活信息--添加激活历史
79
         /// </summary>
82
         /// </summary>
80
-        /// <param name="request"></param>
81
-        /// <returns></returns>
83
+        /// <param name="request">
84
+        /// </param>
85
+        /// <returns>
86
+        /// </returns>
82
         public int ActivationAddHistory()
87
         public int ActivationAddHistory()
83
         {
88
         {
84
             try
89
             try
116
                 return 1;
121
                 return 1;
117
             }
122
             }
118
         }
123
         }
124
+
119
         /// <summary>
125
         /// <summary>
120
         /// 登录
126
         /// 登录
121
         /// </summary>
127
         /// </summary>
122
-        /// <param name="request"></param>
123
-        /// <returns></returns>
128
+        /// <param name="request">
129
+        /// </param>
130
+        /// <returns>
131
+        /// </returns>
124
         public int Login(string loginname, string loginpwd)
132
         public int Login(string loginname, string loginpwd)
125
         {
133
         {
126
-            Console.WriteLine(APP.isDebug);
127
-            Console.WriteLine(APP.apiUrl);
128
             Console.WriteLine(FileToolsCommon.GetConfigValue("APIRequestAddress"));
134
             Console.WriteLine(FileToolsCommon.GetConfigValue("APIRequestAddress"));
129
-            string url = APP.apiUrl + "/user/login";//地址
135
+            string url = APP.apiUrl + "/suser/user/login";//地址
130
 
136
 
131
             //1.193.37.200
137
             //1.193.37.200
132
             string Address = "";//河南 郑州
138
             string Address = "";//河南 郑州
159
                 return 1;
165
                 return 1;
160
             }
166
             }
161
         }
167
         }
168
+
162
         /// <summary>
169
         /// <summary>
163
         /// 下载头像
170
         /// 下载头像
164
         /// </summary>
171
         /// </summary>
165
-        /// <param name="headPortrait"></param>
166
-        /// <param name="SavePath"></param>
167
-        /// <returns></returns>
172
+        /// <param name="headPortrait">
173
+        /// </param>
174
+        /// <param name="SavePath">
175
+        /// </param>
176
+        /// <returns>
177
+        /// </returns>
168
         public bool DownloadAvatar(string headPortrait, string SavePath)
178
         public bool DownloadAvatar(string headPortrait, string SavePath)
169
         {
179
         {
170
             string url = APP.showImageUrl + headPortrait;
180
             string url = APP.showImageUrl + headPortrait;
171
             bool result = HttpHelper.GetDataGetHtml(url, SavePath, "");
181
             bool result = HttpHelper.GetDataGetHtml(url, SavePath, "");
172
             return result;
182
             return result;
173
         }
183
         }
184
+
174
         /// <summary>
185
         /// <summary>
175
         /// 教师教材列表
186
         /// 教师教材列表
176
         /// </summary>
187
         /// </summary>
177
-        /// <param name="request"></param>
178
-        /// <returns></returns>
188
+        /// <param name="request">
189
+        /// </param>
190
+        /// <returns>
191
+        /// </returns>
179
         public int TsubjectbookList()
192
         public int TsubjectbookList()
180
         {
193
         {
181
             APP.TsubjectbookList = new List<Model_TsubjectbookList>();
194
             APP.TsubjectbookList = new List<Model_TsubjectbookList>();
182
             try
195
             try
183
             {
196
             {
184
-                string url = APP.apiUrl + "/tsubjectbook/list";//地址
197
+                string url = APP.apiUrl + "/sstudy/tsubjectbook/list";//地址
185
                 Dictionary<string, int> dic = new Dictionary<string, int>
198
                 Dictionary<string, int> dic = new Dictionary<string, int>
186
                 {
199
                 {
187
                     { "teacherid",APP.UserInfo.Userid}
200
                     { "teacherid",APP.UserInfo.Userid}
206
                 return 1;
219
                 return 1;
207
             }
220
             }
208
         }
221
         }
222
+
209
         /// <summary>
223
         /// <summary>
210
         /// 章节--列表
224
         /// 章节--列表
211
         /// </summary>
225
         /// </summary>
212
-        /// <param name="request"></param>
213
-        /// <returns></returns>
226
+        /// <param name="request">
227
+        /// </param>
228
+        /// <returns>
229
+        /// </returns>
214
         public int DirectorList(string lsbid, int belong, int createid)
230
         public int DirectorList(string lsbid, int belong, int createid)
215
         {
231
         {
216
             APP.DirectorList = new List<Model_DirectorList>();
232
             APP.DirectorList = new List<Model_DirectorList>();
217
             try
233
             try
218
             {
234
             {
219
-                string url = APP.apiUrl + "/director/list";//地址
235
+                string url = APP.apiUrl + "/sstudy/director/list";//地址
220
                 Dictionary<string, string> dic = new Dictionary<string, string>
236
                 Dictionary<string, string> dic = new Dictionary<string, string>
221
                 {
237
                 {
222
                     { "lsbid", lsbid },
238
                     { "lsbid", lsbid },
243
                 return 1;
259
                 return 1;
244
             }
260
             }
245
         }
261
         }
262
+
246
         /// <summary>
263
         /// <summary>
247
         /// 资源--添加
264
         /// 资源--添加
248
         /// </summary>
265
         /// </summary>
249
-        /// <param name="request"></param>
250
-        /// <returns></returns>
266
+        /// <param name="request">
267
+        /// </param>
268
+        /// <returns>
269
+        /// </returns>
251
         public int ResourceAdd(Model_ResourceAdd model)
270
         public int ResourceAdd(Model_ResourceAdd model)
252
         {
271
         {
253
             APP.DirectorList = new List<Model_DirectorList>();
272
             APP.DirectorList = new List<Model_DirectorList>();
254
             try
273
             try
255
             {
274
             {
256
-                string url = APP.apiUrl + "/resource/add";//地址
275
+                string url = APP.apiUrl + "/sstudy/resource/add";//地址
257
                 Dictionary<string, object> dic = new Dictionary<string, object>
276
                 Dictionary<string, object> dic = new Dictionary<string, object>
258
                 {
277
                 {
259
                     //            converted: 0
278
                     //            converted: 0
298
                 dic.Add("suffix", model.suffix);
317
                 dic.Add("suffix", model.suffix);
299
                 //dic.Add("uid", model.uid);
318
                 //dic.Add("uid", model.uid);
300
 
319
 
301
-
302
                 string body = JsonHelper.ToJson(dic);
320
                 string body = JsonHelper.ToJson(dic);
303
                 string xmlDoc = HttpHelper.HttpPost(body, url);
321
                 string xmlDoc = HttpHelper.HttpPost(body, url);
304
                 JObject obj = JObject.Parse(xmlDoc);
322
                 JObject obj = JObject.Parse(xmlDoc);
324
         /// <summary>
342
         /// <summary>
325
         /// 请求服务地址
343
         /// 请求服务地址
326
         /// </summary>
344
         /// </summary>
327
-        /// <param name="Schoolcode"></param>
328
-        /// <returns></returns>
345
+        /// <param name="Schoolcode">
346
+        /// </param>
347
+        /// <returns>
348
+        /// </returns>
329
         public bool GetServiceAddress(string Schoolcode, out string Message)
349
         public bool GetServiceAddress(string Schoolcode, out string Message)
330
         {
350
         {
331
             string url = APP.certapiUrl + "/school/find_code";//地址
351
             string url = APP.certapiUrl + "/school/find_code";//地址
366
             }
386
             }
367
         }
387
         }
368
     }
388
     }
369
-}
389
+}

+ 2
- 2
星火微课/星火微课-测试.iss View File

3
 
3
 
4
 #define MyAppName "星火微课"  
4
 #define MyAppName "星火微课"  
5
 #define MyAppDir "xhwk"
5
 #define MyAppDir "xhwk"
6
-#define MyAppVersion "3.1.14"
6
+#define MyAppVersion "3.2.0"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8
 #define MyAppURL "http://www.xhkjedu.com/"
8
 #define MyAppURL "http://www.xhkjedu.com/"
9
 #define MySourcePath "D:\Project\CSharp\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\CSharp\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
30
 ; 以下行取消注释,以在非管理安装模式下运行(仅为当前用户安装)。
30
 ; 以下行取消注释,以在非管理安装模式下运行(仅为当前用户安装)。
31
 ;PrivilegesRequired=lowest
31
 ;PrivilegesRequired=lowest
32
 OutputDir={#MyTargetPath}
32
 OutputDir={#MyTargetPath}
33
-OutputBaseFilename="{#MyAppName} v{#MyAppVersion}"
33
+OutputBaseFilename="{#MyAppName}v{#MyAppVersion}"
34
 SetupIconFile="{#MySourcePath}{#MyIcoName}"
34
 SetupIconFile="{#MySourcePath}{#MyIcoName}"
35
 Compression=lzma
35
 Compression=lzma
36
 SolidCompression=yes
36
 SolidCompression=yes

Loading…
Cancel
Save