陶杰
2024-12-09 14900ee3d583e2d96da5c67770d4f30f8fac5969
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.mzl.flower.service.menber.impl;
 
import com.mzl.flower.service.menber.GrowthValueDeductionStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.HashMap;
import java.util.Map;
 
 
@Service
public class GrowthValueStrategyContext {
    @Autowired
    private final Map<String, GrowthValueDeductionStrategy> growthValueDeductionStrategyMap = new HashMap<>();
 
    public GrowthValueStrategyContext(Map<String, GrowthValueDeductionStrategy> growthValueDeductionStrategyMap) {
        this.growthValueDeductionStrategyMap.clear();
        growthValueDeductionStrategyMap.forEach((k, v) -> this.growthValueDeductionStrategyMap.put(k, v));
    }
 
    public GrowthValueDeductionStrategy getGrowthInfo(String growthInfo) {
        return growthValueDeductionStrategyMap.get(growthInfo);
    }
}