end-point createPassing added

This commit is contained in:
agavrilov 2025-02-20 10:56:08 +03:00 committed by SunZar
parent 6379a900ad
commit 06fca48446
3 changed files with 8 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import org.example.service.UserService;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -51,8 +52,8 @@ public class UserController {
return ResponseEntity.ok(passingService.getAllPassingPaginated(pageable)); return ResponseEntity.ok(passingService.getAllPassingPaginated(pageable));
} }
// @PostMapping("/passing/new") @PostMapping("/passing/new")
// public ResponseEntity<PassingDTO> createPassing(@RequestBody PassingDTO dto) { public ResponseEntity<PassingDTO> createPassing(@RequestBody PassingDTO dto) {
// return ResponseEntity.ok return ResponseEntity.status(HttpStatus.CREATED).body(passingService.createPassing(dto));
// } }
} }

View File

@ -35,7 +35,7 @@ public class PassingServiceImpl implements PassingService {
passing.setId(dto.getId()); passing.setId(dto.getId());
passing.setUsername(dto.getUsername()); passing.setUsername(dto.getUsername());
passing.setType(dto.getType()); passing.setType(dto.getType());
passing.setTime(dto.getType()); passing.setTime(dto.getTime());
passing.setCode(dto.getCode()); passing.setCode(dto.getCode());
return PassingMapper.convertToDto(passingRepository.save(passing)); return PassingMapper.convertToDto(passingRepository.save(passing));

View File

@ -18,10 +18,10 @@
<column name="username" type="VARCHAR(100)"> <column name="username" type="VARCHAR(100)">
<constraints nullable="false"/> <constraints nullable="false"/>
</column> </column>
<column name="time" type="VARCHAR(50)"> <column name="type" type="VARCHAR(100)">
<constraints nullable="false"/> <constraints nullable="false"/>
</column> </column>
<column name="type" type="VARCHAR(100)"> <column name="time" type="VARCHAR(50)">
<constraints nullable="false"/> <constraints nullable="false"/>
</column> </column>
<column name="code" type="BIGINT"> <column name="code" type="BIGINT">