end-point createPassing added
This commit is contained in:
parent
6379a900ad
commit
06fca48446
@ -8,6 +8,7 @@ import org.example.service.UserService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -51,8 +52,8 @@ public class UserController {
|
||||
return ResponseEntity.ok(passingService.getAllPassingPaginated(pageable));
|
||||
}
|
||||
|
||||
// @PostMapping("/passing/new")
|
||||
// public ResponseEntity<PassingDTO> createPassing(@RequestBody PassingDTO dto) {
|
||||
// return ResponseEntity.ok
|
||||
// }
|
||||
@PostMapping("/passing/new")
|
||||
public ResponseEntity<PassingDTO> createPassing(@RequestBody PassingDTO dto) {
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(passingService.createPassing(dto));
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class PassingServiceImpl implements PassingService {
|
||||
passing.setId(dto.getId());
|
||||
passing.setUsername(dto.getUsername());
|
||||
passing.setType(dto.getType());
|
||||
passing.setTime(dto.getType());
|
||||
passing.setTime(dto.getTime());
|
||||
passing.setCode(dto.getCode());
|
||||
|
||||
return PassingMapper.convertToDto(passingRepository.save(passing));
|
||||
|
@ -18,10 +18,10 @@
|
||||
<column name="username" type="VARCHAR(100)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="time" type="VARCHAR(50)">
|
||||
<column name="type" type="VARCHAR(100)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="type" type="VARCHAR(100)">
|
||||
<column name="time" type="VARCHAR(50)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="code" type="BIGINT">
|
||||
|
Loading…
x
Reference in New Issue
Block a user