Changeset 9868304 for src/main/java/com/example/skychasemk/controller/ApplicationUserController.java
- Timestamp:
- 02/17/25 01:39:28 (4 months ago)
- Branches:
- master
- Children:
- de83113
- Parents:
- a70b5a4
- git-author:
- ste08 <sjovanoska@…> (02/17/25 01:39:02)
- git-committer:
- ste08 <sjovanoska@…> (02/17/25 01:39:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/skychasemk/controller/ApplicationUserController.java
ra70b5a4 r9868304 2 2 3 3 import com.example.skychasemk.dto.ApplicationUserDTO; 4 import com.example.skychasemk.dto.ApplicationUserLoginDTO; 4 5 import com.example.skychasemk.model.ApplicationUser; 5 6 import com.example.skychasemk.services.ApplicationUserService; … … 8 9 import org.springframework.http.ResponseEntity; 9 10 import org.springframework.web.bind.annotation.*; 11 12 import java.util.HashMap; 13 import java.util.Map; 10 14 11 15 @RestController … … 22 26 return ResponseEntity.ok("User saved successfully"); 23 27 } 24 28 @PostMapping("/login") 29 public ResponseEntity<Map<String,Long>> loginUser(@Valid @RequestBody ApplicationUserLoginDTO userDTO) { 30 ApplicationUser loginUser = userService.findByEmail(userDTO); 31 Map<String,Long> response = new HashMap<>(); 32 response.put("userId",loginUser.getUserid()); 33 return ResponseEntity.ok(response); 34 } 25 35 }
Note:
See TracChangeset
for help on using the changeset viewer.