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:
2025-05-13 11:40:25 +09:00
14 changed files with 21 additions and 22 deletions

View File

@ -1,5 +1,2 @@
eclipse.preferences.version=1 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 encoding/<project>=UTF-8

View File

@ -14,10 +14,10 @@ public class DownloadController {
@Autowired @Autowired
private PetService service; private PetService service;
@GetMapping("/api/dogs/pet") @GetMapping("/api/dogs/download")
public String downloadById(@RequestParam List<Integer> id) { public String downloadById(@RequestParam List<Integer> id) {
service.getPetByID(id); service.getPetByID(id);
return "pet"; return "download";
} }
} }

View File

@ -1,13 +1,12 @@
package co.jp.app.repository; package co.jp.app.repository;
import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional;
import org.springframework.data.repository.query.Param;
import co.jp.app.entity.UserEntity; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Optional; import co.jp.app.entity.UserEntity;
@Repository @Repository
public interface UserRepository extends JpaRepository<UserEntity, Integer> { public interface UserRepository extends JpaRepository<UserEntity, Integer> {

View File

@ -3,9 +3,6 @@ package co.jp.app.service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; 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.jetbrains.annotations.NotNull;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority; 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.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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 @Service
public class UserService implements UserDetailsService { public class UserService implements UserDetailsService {
@ -50,7 +50,8 @@ public class UserService implements UserDetailsService {
UserEntity userEntity = userRepository.findByEmail(email) UserEntity userEntity = userRepository.findByEmail(email)
.orElseThrow(() -> new UsernameNotFoundException(email + " not found")); .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( return new User(
userEntity.getEmail(), userEntity.getEmail(),

2
target/classes/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/META-INF/
/co/

View File

@ -1,6 +1,6 @@
#Generated by Maven Integration for Eclipse #Generated by Maven Integration for Eclipse
#Mon May 12 14:19:16 JST 2025 #Mon May 12 15:57:02 JST 2025
m2e.projectLocation=C\:\\Users\\ichbi\\OneDrive\\\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\\dog-1 m2e.projectLocation=C\:\\Users\\Administrator\\git\\Dog-1
m2e.projectName=dog-1 m2e.projectName=dog-1
groupId=co.jp.app groupId=co.jp.app
artifactId=dog-2 artifactId=dog-2