diff --git a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemController.java b/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemController.java deleted file mode 100644 index 41e0e33f4d81118f81743d987facb8108f70f8d0..0000000000000000000000000000000000000000 --- a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemController.java +++ /dev/null @@ -1,61 +0,0 @@ -package uk.ac.cf.spring.demo.sports.match; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/admin/matchitems") -public class MatchItemController { - - @Autowired - private MatchItemService matchItemService; - - @GetMapping - public List<Map<String, Object>> getAllMatchItems() { - return matchItemService.getAllMatchItems(); - } - - @PutMapping("/{id}") - public void updateMatchItemScore(@PathVariable long id, @RequestBody MatchItemUpdateRequest request) { - matchItemService.updateMatchItemScore(id, request.getScoreA(), request.getScoreB(), request.getWinnerId()); - } - - @DeleteMapping("/{id}") - public void deleteMatchItem(@PathVariable long id) { - matchItemService.deleteMatchItem(id); - } -} - -class MatchItemUpdateRequest { - private int scoreA; - private int scoreB; - private long winnerId; - - // Getters and setters - public int getScoreA() { - return scoreA; - } - - public void setScoreA(int scoreA) { - this.scoreA = scoreA; - } - - public int getScoreB() { - return scoreB; - } - - public void setScoreB(int scoreB) { - this.scoreB = scoreB; - } - - public long getWinnerId() { - return winnerId; - } - - public void setWinnerId(long winnerId) { - this.winnerId = winnerId; - } -} diff --git a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemRepository.java b/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemRepository.java deleted file mode 100644 index 11ca20fca76bd4a480825cad83fdbfec5f299fe0..0000000000000000000000000000000000000000 --- a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package uk.ac.cf.spring.demo.sports.match; - -import java.util.List; - -public interface MatchItemRepository { - // get match items - List<MatchItem> getMatchItems(); - // get Match Item by id - MatchItem getMatchItemById(Long id); - // get MatchItem by sport - List<MatchItem> getMatchItemBySport(String sport); - // add MatchItem - void addMatchItem(MatchItem matchItem); - // update MatchItem - void updateMatchItem(MatchItem matchItem); - // delete MatchItem - void deleteMatchItem(Long id); - -} \ No newline at end of file diff --git a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemService.java b/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemService.java deleted file mode 100644 index acb2dbbb8651e3f407b45b5f88b11d6a3ea6c404..0000000000000000000000000000000000000000 --- a/src/main/java/uk/ac/cf/spring/demo/sports/match/MatchItemService.java +++ /dev/null @@ -1,26 +0,0 @@ -package uk.ac.cf.spring.demo.sports.match; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service -public class MatchItemService { - - @Autowired - private MatchItemRepository matchItemRepository; - - public List<Map<String, Object>> getAllMatchItems() { - return matchItemRepository.getAllMatchItems(); - } - - public void updateMatchItemScore(long matchId, int scoreA, int scoreB, long winnerId) { - matchItemRepository.updateMatchItemScore(matchId, scoreA, scoreB, winnerId); - } - - public void deleteMatchItem(long matchId) { - matchItemRepository.deleteMatchItem(matchId); - } -} diff --git a/src/main/resources/static/html/navBar.html b/src/main/resources/static/html/navBar.html index 1a937f18bd87c3e896b2309ee2cee57b17859bf0..1714c606e7e43f48c70a1701ac8034f9794b263f 100644 --- a/src/main/resources/static/html/navBar.html +++ b/src/main/resources/static/html/navBar.html @@ -19,8 +19,8 @@ <!-- <button class="subscribe-btn">Subscribe</button>--> <!-- </div>--> <div class="auth-buttons"> - <a href="html/login.html" class="login-btn">Login</a> - <a href="html/signup.html" class="signup-btn">Sign Up</a> + <a href="http://localhost:8080/html/login.html" class="login-btn">Login</a> + <a href="http://localhost:8080/html/register.html" class="signup-btn">Sign Up</a> <a href="html/subscribe.html" class="subscribe-btn">Subscribe</a> </div>