Ignore:
Timestamp:
02/17/25 01:39:28 (4 months ago)
Author:
ste08 <sjovanoska@…>
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)
Message:

Frontend + some backend changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/skychasemk/controller/ApplicationUserController.java

    ra70b5a4 r9868304  
    22
    33import com.example.skychasemk.dto.ApplicationUserDTO;
     4import com.example.skychasemk.dto.ApplicationUserLoginDTO;
    45import com.example.skychasemk.model.ApplicationUser;
    56import com.example.skychasemk.services.ApplicationUserService;
     
    89import org.springframework.http.ResponseEntity;
    910import org.springframework.web.bind.annotation.*;
     11
     12import java.util.HashMap;
     13import java.util.Map;
    1014
    1115@RestController
     
    2226        return ResponseEntity.ok("User saved successfully");
    2327    }
    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    }
    2535}
Note: See TracChangeset for help on using the changeset viewer.