Exemplo n.º 1
0
        public Result Close(string token)
        {
            if (token != ConfigurationManager.AppSettings["CloseToken"])
            {
                return(Result(ApiResultEnum.InvalidRequest));
            }

            int status_trade = MonitorRA.GetStatusTrade();

            UserRA.FlushDatabase(new List <int>()
            {
                7, 8, (int)DateTime.Now.AddDays(1).DayOfWeek
            });
            if (status_trade != 0)
            {
                if (LogTradeDA.Close("系统"))
                {
                    MonitorRA.SetStatusTrade((int)StatusTradeEnum.Closed);
                    OpenCloseBiz.Close();
                    NLog.Info("系统自动收盘");
                    return(Result(ApiResultEnum.Success));
                }
            }
            return(Result(ApiResultEnum.Order_Closed));
        }
Exemplo n.º 2
0
        public Result <List <LogTrade> > ListLogTrade()
        {
            List <LogTrade> lst          = LogTradeDA.List();
            int             status_trade = MonitorRA.GetStatusTrade();

            if (status_trade == 1)
            {
                lst.Last().state = "交易中";
            }
            else if (status_trade == 2)
            {
                lst.Last().state = "已暂停";
            }
            return(Result(lst));
        }