package com.uas.demo.api; import com.uas.demo.model.ChatSession; import com.uas.demo.service.ChatSessionService; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping(value = "/api/chat/session") public class ChatSessionController { private Logger logger = Logger.getLogger(getClass()); private final ChatSessionService chatSessionService; @Autowired public ChatSessionController(ChatSessionService chatSessionService) { this.chatSessionService = chatSessionService; } @RequestMapping(value = "/{id}", method = RequestMethod.PUT) public List updateSessionStateWhenUserSwitchNewSession(@PathVariable("id") String id) { logger.info("Update session when user switch new session [" + id + "]"); return chatSessionService.updateSessionStateWhenUserSwitchNewSession(id); } }