44import com .flink .streaming .web .enums .JobStatusEnum ;
55import com .flink .streaming .web .model .dto .JobRunLogDTO ;
66import lombok .Data ;
7+ import org .apache .commons .lang3 .StringUtils ;
78import org .springframework .util .CollectionUtils ;
89
910import java .io .Serializable ;
@@ -77,8 +78,13 @@ public class JobRunLogVO implements Serializable {
7778 */
7879 private String localLog ;
7980
81+ /**
82+ * 本地客户端日志
83+ */
84+ private String clinetJobUrl ;
8085
81- public static JobRunLogVO toVO (JobRunLogDTO jobRunLogDTO , boolean isLocalLog ) {
86+
87+ public static JobRunLogVO toVO (JobRunLogDTO jobRunLogDTO , boolean isLocalLog ,Integer port ) {
8288 if (jobRunLogDTO == null ) {
8389 return null ;
8490 }
@@ -97,6 +103,10 @@ public static JobRunLogVO toVO(JobRunLogDTO jobRunLogDTO, boolean isLocalLog) {
97103 if (isLocalLog ) {
98104 jobRunLogVO .setLocalLog (jobRunLogDTO .getLocalLog ());
99105 }
106+ if (port !=null && StringUtils .isNotEmpty (jobRunLogDTO .getRunIp ())){
107+ jobRunLogVO .setClinetJobUrl (String .format ("http://%s:%s/log/getFlinkLocalJobLog" ,
108+ jobRunLogDTO .getRunIp (),port ));
109+ }
100110
101111 return jobRunLogVO ;
102112 }
@@ -108,7 +118,7 @@ public static List<JobRunLogVO> toListVO(List<JobRunLogDTO> jobRunLogList, boole
108118 List <JobRunLogVO > list = new ArrayList <>();
109119
110120 for (JobRunLogDTO jobRunLog : jobRunLogList ) {
111- list .add (JobRunLogVO .toVO (jobRunLog , isLocalLog ));
121+ list .add (JobRunLogVO .toVO (jobRunLog , isLocalLog , null ));
112122 }
113123 return list ;
114124
0 commit comments