xyc
2024-10-28 7acc9ddf4e0ee4211c38d56dbf1e0c3cddffdad4
修改
1个文件已修改
7 ■■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
@@ -25,6 +25,8 @@
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
/**
 * model_line
@@ -39,7 +41,9 @@
    private static final String URL_REPLACE_STR = "URL_PREFIX_URL";
    private static final String TOKEN_REPLACE_STR = "MY_TOKEN_MY";
    private static final String TIMESTAMP_REPLACE_STR = "MY_TIMESTAMP_MY";
    private static final String TOKEN_REPLACE_REGEX = "token=[0-9a-zA-Z]+&";
    private static final String TIMESTAMP_REPLACE_REGEX = "&t=[0-9]+";
    @Autowired
    private ModelLineService modelLineService;
@@ -76,6 +80,7 @@
        if (data.getContent() != null) {
            data.setContent(data.getContent().replace(URL_REPLACE_STR, urlPref));
            data.setContent(data.getContent().replace(TOKEN_REPLACE_STR, "token="+token+"&"));
            data.setContent(data.getContent().replace(TIMESTAMP_REPLACE_STR, "&t="+(new Date()).getTime()));
        }
        return Result.ok(data);
    }
@@ -88,6 +93,7 @@
        ValidatorUtils.validateEntity(modelRbd, AddGroup.class, DefaultGroup.class);
        modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR));
        modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR));
        modelRbd.setContent(modelRbd.getContent().replaceAll(TIMESTAMP_REPLACE_REGEX, TIMESTAMP_REPLACE_STR));
        modelRbdNodeService.saveNodeArr(modelRbd);
        modelLineService.insert(modelRbd);
        return Result.ok();
@@ -101,6 +107,7 @@
        ValidatorUtils.validateEntity(modelRbd, UpdateGroup.class, DefaultGroup.class);
        modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR));
        modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR));
        modelRbd.setContent(modelRbd.getContent().replaceAll(TIMESTAMP_REPLACE_REGEX, TIMESTAMP_REPLACE_STR));
        modelRbdNodeService.saveNodeArr(modelRbd);
        modelLineService.update(modelRbd);