프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ a5e5fff6

이력 | 보기 | 이력해설 | 다운로드 (3.48 KB)

1
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
               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
#endif
33
                if (args.Length == 2)
34
                {
35
                    string ConvertID = args[0];
36

    
37
                    logger.Info($"Markus.Service.ConvertProcess  ConvertID :{args[0]}  param : {args[1]}");
38

    
39
                    convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(args[1]));
40
#if PROCESS_TEST
41
                    convetContext.ConvertID = "F26E631A8A5C4130BAEB2884B840853A";
42
                    convetContext.OriginFilePath = "http://192.168.0.67:5977/PDF/000005_app/VP-UT-BC-E1-SPE-002.pdf";
43
                    convetContext.ServiceStationUri = "http://localhost:9991/StationService";
44
#endif
45

    
46
                    
47
                    convert = new Service.Convert.ConvertService(convetContext);
48

    
49
                    var convertFile = convert.SetFile();
50

    
51
                    if(convertFile.Status != StatusCodeType.Completed)
52
                    {
53
                        logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}");
54
                    }
55
                    else
56
                    {
57
                        
58
                    }
59
                }
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
#if PROCESS_TEST
69
                Console.ReadLine();
70
#else
71
                Application.ExitThread();
72
                System.Environment.Exit(1);
73
#endif
74
            }
75
        }
76
    }
77
}
클립보드 이미지 추가 (최대 크기: 500 MB)