Skip to content

Commit

Permalink
JIRA-91 #refac #comment "오타수정 및 리팩토링"
Browse files Browse the repository at this point in the history
  • Loading branch information
humang committed Oct 26, 2023
1 parent 6a08390 commit dc0c402
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -28,12 +29,14 @@ public Flux<SubTaskResolver> getTaskData(@RequestBody String taskName) {
@PostMapping(path = "/save")
public ResponseEntity<String> saveCode(@RequestBody TaskStep taskStep){
String response = taskSerivce.saveCode(taskStep);
HttpStatusCode status;
if(response.equals("not code")){
return ResponseEntity.badRequest().body("not code");
}else if(response.equals("sucess")){
return ResponseEntity.ok().body("sucess");
status = HttpStatus.BAD_REQUEST;
}else if(response.equals("success")){
status = HttpStatus.OK;
}else{
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
status = HttpStatus.INTERNAL_SERVER_ERROR;
}
return ResponseEntity.status(status).body(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public String saveCode(TaskStep taskStep){
return "not code";
}else{
databaseService.saveCode(taskStep);
return "sucess";
return "success";
}
}catch (Exception e){
return e.toString();
Expand Down

0 comments on commit dc0c402

Please sign in to comment.