Fakultas Ilmu Komputer UI

Commit c1bc9f00 authored by MUHAMMAD AAQIL ABDULLAH's avatar MUHAMMAD AAQIL ABDULLAH
Browse files

Remove timed methods

parent fab3526f
......@@ -4,7 +4,6 @@ import id.ac.ui.cs.advprog.landiandfriends.forms.RegisterForm;
import id.ac.ui.cs.advprog.landiandfriends.model.User;
import id.ac.ui.cs.advprog.landiandfriends.service.PaymentServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.UserServiceImpl;
import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
......@@ -25,7 +24,6 @@ public class AdminController {
String usernameAttr = "username";
@GetMapping(path={"/list-user"})
@Timed("allusers")
public String allUser(Principal principal, Model model){
model.addAttribute(usernameAttr,principal != null ? principal.getName() : "");
......@@ -65,7 +63,6 @@ public class AdminController {
}
@GetMapping(path="/list-payment")
@Timed("allpayments")
public String paymentList(Model model){
model.addAttribute("payments", paymentService.getAllPayments());
return "admin-payment-list";
......@@ -77,7 +74,4 @@ public class AdminController {
return "redirect:/admin/list-payment";
}
}
......@@ -6,7 +6,6 @@ import id.ac.ui.cs.advprog.landiandfriends.model.productcard.BookProductCard;
import id.ac.ui.cs.advprog.landiandfriends.service.ArticleServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.BookServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.UserServiceImpl;
import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,7 +31,6 @@ public class BaseController {
private final Logger logger = LoggerFactory.getLogger(BaseController.class);
@GetMapping(path = "/")
@Timed("home")
public String getHomePage(Principal principal, Model model) {
model.addAttribute("products",
......@@ -46,7 +44,6 @@ public class BaseController {
}
@GetMapping(path = "/articles")
@Timed("allarticles")
public String getArticles(Model model,Principal principal) {
String username;
if (principal != null) {
......@@ -79,7 +76,6 @@ public class BaseController {
@GetMapping(path = "/search/{title}")
@Timed("search")
public String getSearch(Principal principal, Model model, @PathVariable(name = "title")String title) {
model.addAttribute(usernameAttr, (principal != null) ? principal.getName() : "");
model.addAttribute("searched",
......
......@@ -6,7 +6,6 @@ import id.ac.ui.cs.advprog.landiandfriends.model.User;
import id.ac.ui.cs.advprog.landiandfriends.service.BookOrderServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.CartServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.UserServiceImpl;
import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -69,7 +68,6 @@ public class CartController {
}
@GetMapping(path = "/purchase")
@Timed("purchase")
public String purchaseCart(Principal principal, Model model) {
String username;
if (principal != null) {
......
......@@ -3,11 +3,9 @@ package id.ac.ui.cs.advprog.landiandfriends.controller;
import id.ac.ui.cs.advprog.landiandfriends.forms.CreateArticleForm;
import id.ac.ui.cs.advprog.landiandfriends.forms.CreateBookForm;
import id.ac.ui.cs.advprog.landiandfriends.forms.CreateGenreForm;
import id.ac.ui.cs.advprog.landiandfriends.model.Genre;
import id.ac.ui.cs.advprog.landiandfriends.service.ArticleServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.BookServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.GenreServiceImpl;
import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......@@ -38,7 +36,6 @@ public class CuratorController {
}
@GetMapping(path={"/book-list/{page}", "/book-list"})
@Timed("booklist")
public String bookList(Principal principal, Model model, @PathVariable(required = false) Integer page){
model.addAttribute("username", (principal != null) ? principal.getName() : "");
if(page == null) page = 0;
......@@ -130,7 +127,6 @@ public class CuratorController {
@GetMapping(path={"/genre-list/{page}", "/genre-list"})
@Timed("genrelist")
public String genreList(Principal principal, Model model, @PathVariable(required = false) Integer page){
if(page == null) page = 0;
model.addAttribute("username", (principal != null) ? principal.getName() : "");
......
......@@ -3,7 +3,6 @@ package id.ac.ui.cs.advprog.landiandfriends.controller;
import id.ac.ui.cs.advprog.landiandfriends.service.UserServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.util.Utility;
import io.micrometer.core.annotation.Timed;
import net.bytebuddy.utility.RandomString;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,7 +36,6 @@ public class ForgotPasswordController {
}
@PostMapping("/forgot_password")
@Timed("forgotpassword")
public String processForgotPassword(HttpServletRequest request, Model model) {
String email = request.getParameter("email");
var token = RandomString.make(30);
......
......@@ -4,7 +4,6 @@ import id.ac.ui.cs.advprog.landiandfriends.forms.RegisterForm;
import id.ac.ui.cs.advprog.landiandfriends.service.CartServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.UserServiceImpl;
import id.ac.ui.cs.advprog.landiandfriends.service.WishlistServiceImpl;
import io.micrometer.core.annotation.Timed;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -39,7 +38,6 @@ public class RegisterController {
}
@PostMapping({ "","/"})
@Timed("registerpost")
public ResponseEntity<String> registerUser(HttpServletRequest request, @RequestBody RegisterForm form) {
try{
var user = userService.createUser(form.getEmail(), form.getUsername(), form.getPassword());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment