-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from CodingWasabi/#10_admin
#10 admin
- Loading branch information
Showing
55 changed files
with
154 additions
and
58,770 deletions.
There are no files selected for viewing
39 changes: 35 additions & 4 deletions
39
src/main/java/com/codingwasabi/bigtong/admin/controller/AdminController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,54 @@ | ||
package com.codingwasabi.bigtong.admin.controller; | ||
|
||
import com.codingwasabi.bigtong.admin.entity.RoomType; | ||
import com.codingwasabi.bigtong.admin.service.ChatRoomService; | ||
import com.codingwasabi.bigtong.main.Account; | ||
import com.codingwasabi.bigtong.admin.service.AdminService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/admin") | ||
public class AdminController { | ||
|
||
private final AdminService adminService; | ||
private final ChatRoomService chatRoomService; | ||
|
||
|
||
// 바꿔야함 | ||
@GetMapping("/connecting") | ||
public List<Account> showConnectiongUser(){ | ||
return adminService.userConnecting(); | ||
public String showConnectiongUser(Model model){ | ||
|
||
List<Account> accountList = adminService.userConnecting(); | ||
|
||
model.addAttribute("accountList",accountList); | ||
model.addAttribute("count",accountList.size()); | ||
model.addAttribute("isNull","접속된 유저가 현재 없습니다."); | ||
|
||
return "connecting"; | ||
} | ||
|
||
|
||
@PostMapping("/create") | ||
public String create_chatRoom(){ | ||
|
||
if(!chatRoomService.checkRoomExist()){ | ||
chatRoomService.createChatRoom("GRAIN"); | ||
chatRoomService.createChatRoom("VEGETABLE"); | ||
chatRoomService.createChatRoom("FRUIT"); | ||
chatRoomService.createChatRoom("MEAT"); | ||
chatRoomService.createChatRoom("FISH"); | ||
} | ||
return "redirect:/"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.