liurunyu
7 天以前 fcc1cf275578bd3aa08ef50c6a611fb206b7aac9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.dy.pipIrrParamSet.paramSet;
 
import com.dy.pipIrrParamSet.console.Command;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
 
/**
 * @Author: liurunyu
 * @Date: 2025/5/28 16:29
 * @Description
 */
@Slf4j
@Component
@Scope("prototype")
public class ParamSet {
    private Environment env ;
    private ParamSetMw paramSetMw ;
    private ParamSetWeb paramSetWeb ;
    @Autowired
    public void setBean(Environment env){
        this.env = env ;
    }
    @Autowired
    public void setBean(ParamSetMw paramSetMw){
        this.paramSetMw = paramSetMw ;
    }
    @Autowired
    public void setBean(ParamSetWeb paramSetWeb){
        this.paramSetWeb = paramSetWeb ;
    }
 
    public void dealCom(String[] comIn, Command command){
        if (comIn.length < 2) {
            command.outNoIdentify();
        }
        switch (comIn[0]) {
            case "mw" : {
                if (comIn.length != 3) {
                    command.outNoIdentify();
                }else{
                    this.paramSetMw.set(env, comIn, command);
                }
                break;
            }
            case "web" : {
                this.paramSetWeb.set(comIn, command);
                break;
            }
            default: command.outNoIdentify(); break;
        }
    }
 }