|
32 | 32 | import org.springframework.http.HttpStatus; |
33 | 33 | import org.springframework.http.ResponseEntity; |
34 | 34 | import org.springframework.web.bind.annotation.GetMapping; |
35 | | -import org.springframework.web.bind.annotation.PathVariable; |
36 | 35 | import org.springframework.web.bind.annotation.RequestAttribute; |
37 | 36 | import org.springframework.web.bind.annotation.RequestMapping; |
38 | 37 | import org.springframework.web.bind.annotation.RequestParam; |
@@ -106,59 +105,4 @@ public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribut |
106 | 105 | .body(logBytes); |
107 | 106 | } |
108 | 107 |
|
109 | | - /** |
110 | | - * query task log in specified project |
111 | | - * |
112 | | - * @param loginUser login user |
113 | | - * @param projectCode project code |
114 | | - * @param taskInstanceId task instance id |
115 | | - * @param skipNum skip number |
116 | | - * @param limit limit |
117 | | - * @return task log content |
118 | | - */ |
119 | | - @Operation(summary = "queryLogInSpecifiedProject", description = "QUERY_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") |
120 | | - @Parameters({ |
121 | | - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), |
122 | | - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), |
123 | | - @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema = @Schema(implementation = int.class, example = "100")), |
124 | | - @Parameter(name = "limit", description = "LIMIT", required = true, schema = @Schema(implementation = int.class, example = "100")) |
125 | | - }) |
126 | | - @GetMapping(value = "/{projectCode}/detail") |
127 | | - @ResponseStatus(HttpStatus.OK) |
128 | | - @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR) |
129 | | - public Result<String> queryLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
130 | | - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, |
131 | | - @RequestParam(value = "taskInstanceId") int taskInstanceId, |
132 | | - @RequestParam(value = "skipLineNum") int skipNum, |
133 | | - @RequestParam(value = "limit") int limit) { |
134 | | - String log = loggerService.queryLog(loginUser, projectCode, taskInstanceId, skipNum, limit); |
135 | | - return Result.success(log); |
136 | | - } |
137 | | - |
138 | | - /** |
139 | | - * download log file |
140 | | - * |
141 | | - * @param loginUser login user |
142 | | - * @param projectCode project code |
143 | | - * @param taskInstanceId task instance id |
144 | | - * @return log file content |
145 | | - */ |
146 | | - @Operation(summary = "downloadTaskLogInSpecifiedProject", description = "DOWNLOAD_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") |
147 | | - @Parameters({ |
148 | | - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), |
149 | | - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) |
150 | | - }) |
151 | | - @GetMapping(value = "/{projectCode}/download-log") |
152 | | - @ResponseBody |
153 | | - @ApiException(DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR) |
154 | | - public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
155 | | - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, |
156 | | - @RequestParam(value = "taskInstanceId") int taskInstanceId) { |
157 | | - byte[] logBytes = loggerService.getLogBytes(loginUser, projectCode, taskInstanceId); |
158 | | - return ResponseEntity |
159 | | - .ok() |
160 | | - .header(HttpHeaders.CONTENT_DISPOSITION, |
161 | | - "attachment; filename=\"" + System.currentTimeMillis() + ".log" + "\"") |
162 | | - .body(logBytes); |
163 | | - } |
164 | 108 | } |
0 commit comments