Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/co/jp/app/common/ApiResponse.java # src/main/java/co/jp/app/controller/UserController.java
This commit is contained in:
@ -1,5 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
|
@ -14,10 +14,10 @@ public class DownloadController {
|
||||
@Autowired
|
||||
private PetService service;
|
||||
|
||||
@GetMapping("/api/dogs/pet")
|
||||
@GetMapping("/api/dogs/download")
|
||||
public String downloadById(@RequestParam List<Integer> id) {
|
||||
service.getPetByID(id);
|
||||
return "pet";
|
||||
return "download";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
package co.jp.app.repository;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import java.util.Optional;
|
||||
|
||||
import co.jp.app.entity.UserEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
import co.jp.app.entity.UserEntity;
|
||||
|
||||
@Repository
|
||||
public interface UserRepository extends JpaRepository<UserEntity, Integer> {
|
||||
|
@ -3,9 +3,6 @@ package co.jp.app.service;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import co.jp.app.dto.RegistrationDto;
|
||||
import co.jp.app.entity.UserEntity;
|
||||
import co.jp.app.repository.UserRepository;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
@ -15,9 +12,12 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import co.jp.app.dto.RegistrationDto;
|
||||
import co.jp.app.entity.UserEntity;
|
||||
import co.jp.app.repository.UserRepository;
|
||||
|
||||
@Service
|
||||
public class UserService implements UserDetailsService {
|
||||
|
||||
@ -50,7 +50,8 @@ public class UserService implements UserDetailsService {
|
||||
UserEntity userEntity = userRepository.findByEmail(email)
|
||||
.orElseThrow(() -> new UsernameNotFoundException(email + " not found"));
|
||||
|
||||
Collection<? extends GrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
Collection<? extends GrantedAuthority> authorities = Collections
|
||||
.singletonList(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
|
||||
return new User(
|
||||
userEntity.getEmail(),
|
||||
|
2
target/classes/.gitignore
vendored
Normal file
2
target/classes/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/META-INF/
|
||||
/co/
|
@ -1,6 +1,6 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Mon May 12 14:19:16 JST 2025
|
||||
m2e.projectLocation=C\:\\Users\\ichbi\\OneDrive\\\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\\dog-1
|
||||
#Mon May 12 15:57:02 JST 2025
|
||||
m2e.projectLocation=C\:\\Users\\Administrator\\git\\Dog-1
|
||||
m2e.projectName=dog-1
|
||||
groupId=co.jp.app
|
||||
artifactId=dog-2
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user