mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 04:08:31 +08:00
[Fix-5714] When updating the existing alarm instance, the creation time should't be updated (#5715)
* add a new init method.
This commit is contained in:
parent
2ba569acd0
commit
cf99df3de0
@ -35,6 +35,7 @@ import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -109,11 +110,9 @@ public class AlertPluginInstanceServiceImpl extends BaseServiceImpl implements A
|
||||
@Override
|
||||
public Map<String, Object> update(User loginUser, int pluginInstanceId, String instanceName, String pluginInstanceParams) {
|
||||
|
||||
AlertPluginInstance alertPluginInstance = new AlertPluginInstance();
|
||||
String paramsMapJson = parsePluginParamsMap(pluginInstanceParams);
|
||||
alertPluginInstance.setPluginInstanceParams(paramsMapJson);
|
||||
alertPluginInstance.setInstanceName(instanceName);
|
||||
alertPluginInstance.setId(pluginInstanceId);
|
||||
AlertPluginInstance alertPluginInstance = new AlertPluginInstance(pluginInstanceId, paramsMapJson, instanceName, new Date());
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
int i = alertPluginInstanceMapper.updateById(alertPluginInstance);
|
||||
|
||||
|
@ -80,6 +80,13 @@ public class AlertPluginInstance {
|
||||
this.instanceName = instanceName;
|
||||
}
|
||||
|
||||
public AlertPluginInstance(int id, String pluginInstanceParams, String instanceName, Date updateDate) {
|
||||
this.id = id;
|
||||
this.pluginInstanceParams = pluginInstanceParams;
|
||||
this.updateTime = updateDate;
|
||||
this.instanceName = instanceName;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -49,4 +49,4 @@
|
||||
where instance_name = #{instanceName} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user