buf fixed, merged

This commit is contained in:
leedongmyung 2023-12-13 08:31:58 +09:00
parent ea2526c27c
commit d996d61213
4 changed files with 22 additions and 21 deletions

View file

@ -15,17 +15,16 @@ class Slack extends Command {
var data = DataSlackSender.fromJson(command.param);
var sender = SlackSender(data.token);
DataSlack? message = null;
if(data.property != null) {
if (data.property != null) {
var value = replaceSingleTag(data.property!);
if(value != null)
{
if (value != null) {
message = value as DataSlack;
}
} else if(data.message != null) {
} else if (data.message != null) {
message = data.message;
}
if(message != null) {
if (message != null) {
await sender.send(message);
} else {
throw Exception('property or message field should not be null');
@ -40,10 +39,11 @@ class SlackBuild extends Command {
Future execute(DataCommand command) async {
var data = DataSlackBuild.fromJson(command.param);
var token = replaceTag(data.token);
var version = replaceTag(data.version);
var download = replaceTag(data.downloadURL);
var color = Color.hex(data.color);
var sender = SlackSender(data.token);
var sender = SlackSender(token);
await sender.sendBuild(data.appName, data.type, color, version, download);

View file

@ -268,9 +268,9 @@ class DataRename extends DataFile {
class DataSlackSender extends DataParam {
DataSlackSender();
late String? token;
late String token;
late String? property;
late DataSlack? message;
late DataSlack message;
factory DataSlackSender.fromJson(Map<String, dynamic> json) =>
_$DataSlackSenderFromJson(json);

View file

@ -306,11 +306,9 @@ Map<String, dynamic> _$DataRenameToJson(DataRename instance) =>
DataSlackSender _$DataSlackSenderFromJson(Map<String, dynamic> json) =>
DataSlackSender()
..workspace = json['workspace'] as String?
..token = json['token'] as String?
..token = json['token'] as String
..property = json['property'] as String?
..message = json['message'] == null
? null
: DataSlack.fromJson(json['message'] as Map<String, dynamic>);
..message = DataSlack.fromJson(json['message'] as Map<String, dynamic>);
Map<String, dynamic> _$DataSlackSenderToJson(DataSlackSender instance) =>
<String, dynamic>{
@ -323,11 +321,9 @@ Map<String, dynamic> _$DataSlackSenderToJson(DataSlackSender instance) =>
DataSlackBuild _$DataSlackBuildFromJson(Map<String, dynamic> json) =>
DataSlackBuild()
..workspace = json['workspace'] as String?
..token = json['token'] as String?
..token = json['token'] as String
..property = json['property'] as String?
..message = json['message'] == null
? null
: DataSlack.fromJson(json['message'] as Map<String, dynamic>)
..message = DataSlack.fromJson(json['message'] as Map<String, dynamic>)
..appName = json['appName'] as String
..type = $enumDecode(_$SlackBuildTypeEnumMap, json['type'])
..color = json['color'] as String

View file

@ -26,13 +26,18 @@ class PipelineExe extends PipelineExecutor {
@override
PipelineValidateResult initialize(Map<String, dynamic> set) {
var result = PipelineValidateResult();
commandID = set.values.first as String;
if (!Application.instance.dataCommandMap.containsKey(commandID)) {
if (set.values.first == null) {
result.enable = false;
result.message =
'The "$commandID" command does not exist in the command list.';
result.message = 'Pipeline Workflow\'s "Command ID" is (null)';
} else {
commandID = set.values.first as String;
if (!Application.instance.dataCommandMap.containsKey(commandID)) {
result.enable = false;
result.message =
'The "$commandID" command does not exist in the command list.';
}
updateState(CommandState.ready);
}
updateState(CommandState.ready);
return result;
}