Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 각 Controller Mapping종류 수정 #4

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public ResponseEntity<?> home(@RequestHeader("AccessToken") String AccessToken)

if(Objects.isNull(user))
return ResponseEntity.status(500).body("유저 정보를 가져오지 못 했습니다.");

System.out.print("User : ");
System.out.println(user.toString());

UserPet userPet = new UserPet(user.getPetName(), user.getPetWeight());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public ResponseEntity<?> register(
@RequestHeader("PetName") String PetName,
@RequestHeader("PetWeight") Integer PetWeight
) {
Integer status = 200;
try {
registerService.isUserRejoin(AccessToken, ExpiresIn, RefreshToken, RefreshTokenExpiresIn, PetName, PetWeight);
} catch (CException e) {
Expand All @@ -38,6 +37,6 @@ public ResponseEntity<?> register(
return ResponseEntity.status(500).body(e.toString());
}

return ResponseEntity.status(status).body(".");
return ResponseEntity.status(200).body(".");
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.example.server.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -21,7 +21,7 @@ public class ToothController {
private final InvalidTokenService invalidTokenService;

// 사용자가 애완견 이빨을 찍으면
@GetMapping("")
@PutMapping("")
public ResponseEntity<?> tooth(@RequestHeader("AccessToken") String AccessToken) {
try {
invalidTokenService.isTokenInvalid(AccessToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.example.server.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -19,7 +19,7 @@ public class UpdateAccessController {

// AccessToken을 새로 발급 받았을때 사용하는 API.
// 서버에 새로운 AccessToken을 제공.
@GetMapping("/accesstoken")
@PatchMapping("/accesstoken")
public ResponseEntity<?> updateAccessToken(@RequestHeader("AccessToken") String AccessToken,
@RequestHeader("ExpiresIn") Integer ExpiresIn) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand Down Expand Up @@ -57,7 +57,7 @@ public ResponseEntity<?> mypageGetinfo(@RequestHeader("AccessToken") String Acce
// 마이페이지를 수정하는 API
// Input : AccessToken, PetName, PetWeight
// Output : status(200, 401, 500)
@PutMapping("/setinfo")
@PatchMapping("/setinfo")
public ResponseEntity<?> mypageGetinfo(
@RequestHeader("AccessToken") String AccessToken,
@RequestHeader("PetName") String PetName,
Expand Down
Loading