package rule import ( "strings" "git.apinb.com/quant/gostock/internal/logic/types" ) var ( // 热门行业 hotIndustries = "半导体,软件服务,互联网,IT设备,通信设备,元器件,电气设备,汽车配件,汽车整车,生物制药,化学制药,中成药,医疗保健,环境保护,新型电力,仓储物流,小金属,黄金,航空,铅锌,铝,铜" // 夕阳行业 sunsetIndustries = "全国地产,区域地产,房产服务,火力发电,煤炭开采,焦炭加工,普钢,钢加工,纺织,纺织机械,染料涂料,化纤,造纸,陶瓷,玻璃,百货,超市连锁,电器连锁,公路,铁路,出版业,摩托车" // 中性/周期型行业 neutralIndustries = "银行,证券,保险,建筑工程,装修装饰,水泥,其他建材,化工原料,农药化肥,汽车服务,运输设备,旅游服务,酒店餐饮,旅游景点,食品,乳制品,白酒,啤酒,家用电器,家居用品,港口,水运,空运,农业综合,种植业,渔业,多元金融,工程机械,轻工机械,机械基件,机床制造,专用机械,化工机械,电器仪表,塑料,橡胶,化纤,服饰,日用化工,文教休闲,影视音像,广告包装,批发业,商贸代理,其他商业,商品城,电信运营,供气供热,软饮料,红黄酒,公共交通,机场,路桥,水力发电,石油加工,石油开采,石油贸易,园区开发,综合类,林业,特种钢" ) type Industry struct { Key string Name string } func NewIdustry() *Industry { return &Industry{ Key: "industry", Name: "行业", } } func (r *Industry) Run(in string) *types.RuleResult { score := 0 desc := "中性/周期型行业" if strings.Contains(hotIndustries, in) { score = 1 desc = "热门行业" } else if strings.Contains(sunsetIndustries, in) { score = -1 desc = "夕阳行业" } return &types.RuleResult{Key: r.Key, Name: r.Name, Score: score, Desc: desc} }