purged or commented out redundant code

This commit is contained in:
Zhongheng Liu 2024-01-17 23:50:06 +02:00
commit 2e73088d2a
No known key found for this signature in database
3 changed files with 13 additions and 15 deletions

View file

@ -1,4 +1,5 @@
package me.imsonmia.epqapi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@ -7,10 +8,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class EpqapiApplication extends Thread {
private static Logger logger = LoggerFactory.getLogger(EpqapiApplication.class);
public static void main(String[] args) {
logger.info("Main Spring Boot process running in thread!");
SpringApplication.run(EpqapiApplication.class, args);
}
}

View file

@ -4,8 +4,6 @@ import java.time.Instant;
import java.util.ArrayList;
import java.util.Optional;
import javax.swing.text.html.Option;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
@ -87,13 +85,13 @@ public class UserController {
}
return messages;
}
@PatchMapping("/user/{id}")
boolean changeUserProperties(@PathVariable(value = "id") Long userId, @RequestBody User newUser) {
if (!userRepository.existsById(userId)) {
return false;
}
userRepository.save(newUser);
return true;
}
// @PatchMapping("/user/{id}")
// boolean changeUserProperties(@PathVariable(value = "id") Long userId,
// @RequestBody User newUser) {
// if (!userRepository.existsById(userId)) {
// return false;
// }
// userRepository.save(newUser);
// return true;
// }
}

View file

@ -7,7 +7,6 @@ import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import me.imsonmia.epqapi.model.Message;
public class MessageSpecification implements Specification {