123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // Package fenwei
- // @Author gmy 2024/8/20 14:50:00
- package fenwei
- const (
- fenWeiUrl = "https://www.sxcoal.com/api/coalresource-adhoc/queryV1/data"
- fenWeiByUrl = "https://www.sxcoal.com/api/coalresource-adhoc/queryV1/byData"
- )
- type ProcessorFactory struct{}
- func (f *ProcessorFactory) CreateProcessor(module string) DataProcessor {
- switch module {
- case "动力煤供应量":
- return &ThermalCoalSupplyProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦精煤供应量":
- return &CokingCleanCoalSupplyProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "原煤分省分煤种产量":
- return &RawCoalProvinceProductionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "国有重点煤矿原煤产量":
- return &StateOwnedKeyCoalMineRawCoalProductionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦烟煤分煤种产量":
- return &CokingBituminousCoalProductionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "动力煤库存-全社会":
- return &ThermalCoalInventorySocietyProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "动力煤库存-生产企业":
- return &ThermalCoalInventoryProductionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "动力煤库存-六大电厂":
- return &ThermalCoalInventorySixPowerPlantProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦煤库存-全社会":
- return &CokingCoalInventorySocietyProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦煤库存-生产企业":
- return &CokingCoalInventoryProductionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦煤库存-下游企业":
- return &CokingCoalInventoryDownstreamProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "全国煤矿库存":
- return &NationalCoalMineInventoryProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "国有重点煤矿库存":
- return &StateOwnedKeyCoalMineInventoryProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "焦炭库存":
- return &CokeInventoryProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "港口数据-库存-北方港口":
- return &PortDataInventoryNorthernPortProcessor{
- BaseProcessor{URL: fenWeiByUrl},
- }
- case "港口数据-库存-江内港口":
- return &PortDataInventoryInlandPortProcessor{
- BaseProcessor{URL: fenWeiByUrl},
- }
- case "港口数据-调度-北方港口":
- return &PortDataDispatchNorthernPortProcessor{
- BaseProcessor{URL: fenWeiByUrl},
- }
- case "港口数据-运量":
- return &PortDataThroughputProcessor{
- BaseProcessor{URL: fenWeiByUrl},
- }
- case "大秦线日运量":
- return &DaqinLineDailyThroughputProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "动力煤港口价格":
- return &ThermalCoalPortPriceProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "动力煤消费量":
- return &ThermalCoalConsumptionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- case "炼焦精煤消费量":
- return &CokingCleanCoalConsumptionProcessor{
- BaseProcessor{URL: fenWeiUrl},
- }
- default:
- return nil
- }
- }
|