Compare commits
2 Commits
264b9a528a
...
41931a7f9a
Author | SHA1 | Date | |
---|---|---|---|
41931a7f9a | |||
76102067ab |
@ -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
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package co.jp.app.common;
|
package co.jp.app.common;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class ApiResponse<T> {
|
public class ApiResponse<T> {
|
||||||
private boolean success;
|
private boolean success;
|
||||||
private String message;
|
private String message;
|
||||||
@ -20,6 +18,7 @@ public class ApiResponse<T> {
|
|||||||
public ApiResponse() {
|
public ApiResponse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ApiResponse(boolean success, String message, T data) {
|
public ApiResponse(boolean success, String message, T data) {
|
||||||
this.success = success;
|
this.success = success;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
package co.jp.app.controller;
|
package co.jp.app.controller;
|
||||||
|
|
||||||
import co.jp.app.common.ApiResponse;
|
import java.util.HashMap;
|
||||||
import co.jp.app.dto.LoginDto;
|
import java.util.Map;
|
||||||
import co.jp.app.dto.RegistrationDto;
|
|
||||||
import co.jp.app.service.JwtService;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
@ -13,15 +11,18 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
|
|||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import co.jp.app.entity.ErrorEntity;
|
import co.jp.app.common.ApiResponse;
|
||||||
|
import co.jp.app.dto.LoginDto;
|
||||||
|
import co.jp.app.dto.RegistrationDto;
|
||||||
import co.jp.app.entity.UserEntity;
|
import co.jp.app.entity.UserEntity;
|
||||||
import co.jp.app.service.ErraService;
|
import co.jp.app.service.JwtService;
|
||||||
import co.jp.app.service.UserService;
|
import co.jp.app.service.UserService;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/user")
|
@RequestMapping("/api/user")
|
||||||
|
@ -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> {
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user