public IEnumerable<StockKLineDto> Post([FromBody]KLineArgs args)
 {
     #if DEBUG
     /*test code for communication * ************************************/
     var dto = new StockKLineDto()
     {
         Amount = 138887,
         High = 19.99,
         Open = 88.88
     };
     var result = new List<StockKLineDto>();
     result.Add(dto);
     return result;
     /*test code for communication************************************/
     #else
     var appService = new KLineAppService();
     return appService.Get(KLineType.Min60, args.StockCode, args.StartDate, args.EndDate).ToDto();
     #endif
 }
示例#2
0
        public static StockKLineDto ToDto(this IStockKLine self)
        {
            StockKLineDto outputData = new StockKLineDto
            {
                //
                // 摘要:
                //     成交额
                Amount = self.Amount,
                //
                // 摘要:
                //     收盘
                Close = self.Close,
                //
                // 摘要:
                //     最高
                High = self.High,
                //
                // 摘要:
                //     最低
                Low = self.Low,
                //
                // 摘要:
                //     今开
                Open = self.Open,
                //
                // 摘要:
                //     日期与时间
                Time = self.Time,
                //
                // 摘要:
                //     成交量
                Volume = self.Volume
            };

            return outputData;
        }