-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
세미나 출석체크 구현 및 운영서버 에러 메세지 수정 #135
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.gdsc_knu.official_homepage.controller.admin; | ||
|
||
import com.gdsc_knu.official_homepage.dto.member.MemberResponse; | ||
import com.gdsc_knu.official_homepage.entity.enumeration.Track; | ||
import com.gdsc_knu.official_homepage.service.discord.DiscordClient; | ||
import com.gdsc_knu.official_homepage.service.admin.AdminMemberService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
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.RequestParam; | ||
|
||
import java.util.List; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
public class AdminMemberCheckController { | ||
private final AdminMemberService adminMemberService; | ||
private final DiscordClient discordClient; | ||
|
||
@GetMapping("members") | ||
public String getHtml(Model model) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. admin 페이지니깐 @TokenMember와 어드민 권한 검증이 필요해보입니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위와 같은 이유입니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 알겠습니다! 고생하셨습니다~ |
||
model.addAttribute("tracks", Track.values()); | ||
return "members"; | ||
} | ||
|
||
@GetMapping("api/member/check") | ||
public String getMemberByTrack(@RequestParam Track track, Model model) { | ||
List<MemberResponse.WithTrack> response = adminMemberService.getMembersByTrack(track); | ||
model.addAttribute("tracks", Track.values()); | ||
model.addAttribute("defaultTrack", track); | ||
model.addAttribute("members", response); | ||
return "members"; | ||
} | ||
|
||
@PostMapping("api/member/check/attendance") | ||
public ResponseEntity<String> check(@RequestParam List<String> memberNames, | ||
@RequestParam Track track) { | ||
discordClient.sendAttendance(memberNames, track.name()); | ||
return ResponseEntity.ok().body("출첵 완료!"); | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adminController 니깐 admin/members가 더 좋지 않을까요? 아래 api들도 api/admin/...이 좋아보입니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타임리프 바로 띄워서 사용하는거라 로그인 없이 쓸려고 admin prefix 안 붙였습니다
그럼 로그인 페이지까지 만들어야해서 ...