markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ 1d79913e
이력 | 보기 | 이력해설 | 다운로드 (3.43 KB)
1 | 53c9637d | taeseongkim | using log4net; |
---|---|---|---|
2 | using Markus.Message; |
||
3 | using Markus.Service.Extensions; |
||
4 | using Markus.Service.Helper; |
||
5 | using System; |
||
6 | using System.Collections.Generic; |
||
7 | using System.Linq; |
||
8 | using System.ServiceModel; |
||
9 | using System.Text; |
||
10 | using System.Threading.Tasks; |
||
11 | using System.Web.Script.Serialization; |
||
12 | using System.Windows.Forms; |
||
13 | using static Markus.Service.Extensions.Encrypt; |
||
14 | |||
15 | namespace Markus.Service.ConvertProcess |
||
16 | { |
||
17 | class Convert |
||
18 | { |
||
19 | protected static ILog logger; |
||
20 | protected static Service.Convert.ConvertService convert; |
||
21 | |||
22 | private static ProcessContext convetContext; |
||
23 | |||
24 | [MTAThread] |
||
25 | static void Main(string[] args) |
||
26 | { |
||
27 | try |
||
28 | { |
||
29 | d91efe5c | taeseongkim | logger = LogManager.GetLogger(typeof(Convert)); |
30 | #if PROCESS_TEST |
||
31 | args = new[] { "3054E239509C4ECCA223CB0C1FB393F8", "qjFwF/SI2PYVQtpVawnzYgN58eQ4aWgNDwMcLMJYQebeATd6eFMdM+0H1KgpOx8RVD4Sg00Gh+5Dfe+q/qwAeEtEk9++mw0U3tQx6J2M27v9b0WgLdjBR/5SKAqJzJ4uzpsboOQOxLg+sWtT+ttvwLNCLvfqcv9Gyw9nAHpmEbl63QP8Y0mLyLyAERGWkY8yK6f5aabgYUakNZieojJiQcvfFiKE3Oot3qmglXla8C6TG/+iA2dILAUSdIsVtDzR7ZxsjJOxPXhbETZNFSAA8qVDKPAS6MR9bls6XLLoEiRxxO+WKHdsa3QFAD9nxzvsV1GQaY7oTAKLhMBcvMKKtn6FkbNJXLwU0NT+/7RMWJDB6vz7KFzimbz7yRKUf1jvxQn22B8k4uVqtGP2Do6iV3GM2lkYqhvwks3i5euiOaBJYo5M90FkQIXgsd+YqM5g2OvNTfqlTFBurOY4K5LVPEc1ll6VGUApaOwau3TxOYAAf9rKf1UspDJKNWZplThCIgqtxePTa5oyE9h51MdVu5ugv7vzCwqBBa8SiCLbbO0gwMYRhhO+ltZBbx4sghCVUH62pae8wGghOyz8OMvHPA2g6w0nw2lIx7TZ7qbjV9knajzU7IZ9JgGj/PrBatlXRs0FTp+pSl9OwecwmM87X3ezVjjOc+8CULo9OhnH8U/tC2yr9AbbaIUi7HuY832wzpV/H8HOOo9w+19SQ8P6K7SYuB5ZirSwuAJzdkw7Q07Ih80TiaLjJIxCHbPpjAL4+RY5W7VarQEG6GJiIw8vAyDusuctHrfDZQDj5ZEPWC2vJQjA5WWADNYGfXu5iSO4jG9ifjmaI3QHWChfFFXsb6/O+6XSMP43ALGO0XB2o64CV+YmvC0VN3S4naIALh9zb5LEDvcZ1GSAk3AszUjVKehffl9jDE5hmCVIh0wSR4bcX4yqova6mrqiFocaXHmrZEfF62EXiOVcW24fqwMVqkaltMgj2aJThWzWoiSXsPI6dnpVzKL9oibMiB3We0+xIyqNvrRJTW4XaHEegShmGD4KbFFE4OnTaCnoQ4mEI5mpp9V3ZWFortsXL5G6hdQT3dOIffmY/3ha2KYMZQ/k7w==" }; |
||
32 | 950e6b84 | taeseongkim | #endif |
33 | 53c9637d | taeseongkim | if (args.Length == 2) |
34 | { |
||
35 | string ConvertID = args[0]; |
||
36 | |||
37 | 3aafb914 | taeseongkim | logger.Info($"Markus.Service.ConvertProcess ConvertID :{args[0]} param : {args[1]}"); |
38 | |||
39 | 53c9637d | taeseongkim | convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(args[1])); |
40 | d91efe5c | taeseongkim | #if PROCESS_TEST |
41 | 1d79913e | taeseongkim | convetContext.ConvertID = "b9dceab8fab66c765a38b3ebd6c6faae"; |
42 | convetContext.OriginFilePath = "http://192.168.0.67:5977/PDF/000005_app/lockfile1.pdf"; |
||
43 | d91efe5c | taeseongkim | convetContext.ServiceStationUri = "http://localhost:9991/StationService"; |
44 | #endif |
||
45 | 53c9637d | taeseongkim | |
46 | 43e1d368 | taeseongkim | |
47 | 53c9637d | taeseongkim | convert = new Service.Convert.ConvertService(convetContext); |
48 | |||
49 | 43e1d368 | taeseongkim | var convertFile = convert.SetFile(); |
50 | 53c9637d | taeseongkim | |
51 | 43e1d368 | taeseongkim | if(convertFile.Status != StatusCodeType.Completed) |
52 | 53c9637d | taeseongkim | { |
53 | logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}"); |
||
54 | } |
||
55 | f363a40e | taeseongkim | else |
56 | { |
||
57 | db0d3db3 | taeseongkim | |
58 | f363a40e | taeseongkim | } |
59 | 53c9637d | taeseongkim | } |
60 | } |
||
61 | catch (Exception ex) |
||
62 | { |
||
63 | logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}", ex); |
||
64 | } |
||
65 | finally |
||
66 | { |
||
67 | convert?.Dispose(); |
||
68 | d91efe5c | taeseongkim | #if PROCESS_TEST |
69 | Console.ReadLine(); |
||
70 | #else |
||
71 | 1d79913e | taeseongkim | System.Environment.Exit(1); |
72 | d91efe5c | taeseongkim | #endif |
73 | 53c9637d | taeseongkim | } |
74 | } |
||
75 | } |
||
76 | } |