T139 removed old EvenetController code
This commit is contained in:
		@@ -3,8 +3,11 @@ package com.release11.klaus.controller;
 | 
			
		||||
import com.release11.klaus.model.Event;
 | 
			
		||||
import com.release11.klaus.model.EventRequestDto;
 | 
			
		||||
import com.release11.klaus.service.EtrackService;
 | 
			
		||||
import com.release11.klaus.service.KlausService;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.http.HttpStatus;
 | 
			
		||||
import org.springframework.http.ResponseEntity;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.ui.Model;
 | 
			
		||||
import org.springframework.validation.BindingResult;
 | 
			
		||||
@@ -14,6 +17,7 @@ import javax.validation.Valid;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.time.LocalTime;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.LinkedList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.UUID;
 | 
			
		||||
@@ -23,53 +27,20 @@ import java.util.UUID;
 | 
			
		||||
 * Class responds to request asking about history of messages.
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@Controller
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping(path = "/event")
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class EventController {
 | 
			
		||||
    private final EtrackService service;
 | 
			
		||||
 | 
			
		||||
    private final EtrackService etrackService;
 | 
			
		||||
    private final List<Event> eventList = new LinkedList<>();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//    @GetMapping("/etrack/{uuid}")
 | 
			
		||||
//    public String showEtrack(@Valid EventRequestDto eventRequestDto, @PathVariable UUID uuid, final Model model,
 | 
			
		||||
//                             BindingResult bindingResult){
 | 
			
		||||
//        model.addAttribute("clientUUID", uuid);
 | 
			
		||||
//        model.addAttribute("eventRequestDto", eventRequestDto);
 | 
			
		||||
//        return "etrack";
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//    @PostMapping("/etrack/{uuid}")
 | 
			
		||||
//    public String getLogs(@Valid EventRequestDto eventRequestDto, final Model model, BindingResult bindingResult,
 | 
			
		||||
//                          @PathVariable UUID uuid){
 | 
			
		||||
//        model.addAttribute("clientUUID", uuid);
 | 
			
		||||
//        populateModelWithLists(model, eventRequestDto, true);
 | 
			
		||||
//        return "etrack";
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//    private void populateModelWithLists(Model model, EventRequestDto eventRequestDto, boolean updateList){
 | 
			
		||||
//        if (updateList){
 | 
			
		||||
//            eventList.clear();
 | 
			
		||||
//            eventList.addAll(etrackService.getEventsByDateTimeAndBusinessKeys(eventRequestDto));
 | 
			
		||||
//        }
 | 
			
		||||
//        model.addAttribute("eventList", eventList);
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//    @ModelAttribute("eventRequestDto")
 | 
			
		||||
//    public EventRequestDto eventRequestDto() {
 | 
			
		||||
//        return EventRequestDto.builder()
 | 
			
		||||
//                .mockedResponseId(1)
 | 
			
		||||
//                .localDateTimeFrom(LocalDateTime.of(LocalDate.now(), LocalTime.MIN))
 | 
			
		||||
//                .localDateTimeTo(LocalDateTime.of(LocalDate.now().plusDays(1), LocalTime.MIDNIGHT))
 | 
			
		||||
//                .build();
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//
 | 
			
		||||
//    @ModelAttribute("eventList")
 | 
			
		||||
//    public List<Event> eventList() {
 | 
			
		||||
//        return eventList;
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping
 | 
			
		||||
    public ResponseEntity getHistory(@RequestBody(required = false) EventRequestDto event){
 | 
			
		||||
        event = EventRequestDto.builder()
 | 
			
		||||
                .localDateTimeFrom(LocalDateTime.of(2021, 3, 4, 10, 1))
 | 
			
		||||
                .localDateTimeTo(LocalDateTime.of(2021, 3, 4, 15, 40))
 | 
			
		||||
                .clientUUID(UUID.fromString("3482382d-76df-45bd-825e-1c742c989796"))
 | 
			
		||||
                .build();
 | 
			
		||||
        return new ResponseEntity<List<Event>>(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1,2 @@
 | 
			
		||||
redis.host = redis
 | 
			
		||||
redis.host = localhost
 | 
			
		||||
redis.port = 6379
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user