|
|
|
@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.mapstruct.factory.Mappers;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
|
|
@Tag(name = "MinUserController", description = "사용자 관리")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/v1/ctgy/user")
|
|
|
|
@ -37,13 +40,13 @@ public class MinUserController {
|
|
|
|
|
@Parameters({
|
|
|
|
|
@Parameter(in = ParameterIn.QUERY, name = "userid", description = "사용자ID", required = false, example = " "),
|
|
|
|
|
@Parameter(in = ParameterIn.QUERY, name = "name", description = "이름", required = false, example = " "),
|
|
|
|
|
@Parameter(in = ParameterIn.QUERY, name = "team", description = "팀", required = false, example = "001"),
|
|
|
|
|
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
|
|
|
|
|
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
public ResponseEntity<? extends IRestResponse> findMinUsers(
|
|
|
|
|
@Parameter(hidden = true)
|
|
|
|
|
@ModelAttribute("minUserinfoDto")
|
|
|
|
|
final MinUserinfoDto minUserinfoDto,
|
|
|
|
|
@Parameter(hidden = true)
|
|
|
|
|
final Pageable pageable) {
|
|
|
|
@ -64,4 +67,22 @@ public class MinUserController {
|
|
|
|
|
public ResponseEntity<? extends IRestResponse> getMinUser(@PathVariable final String userid) {
|
|
|
|
|
return RestResponse.of(service.findMinUserByUserid(userid));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "사용자 정보 저장" , description = "사용자 정보 저장")
|
|
|
|
|
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
public ResponseEntity<? extends IRestResponse> saveMinUser(
|
|
|
|
|
@Valid
|
|
|
|
|
final MinUserinfoDto minUserinfoDto) {
|
|
|
|
|
service.saveMinUser(minUserinfoDto);
|
|
|
|
|
return RestResponse.of(HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "사용자 삭제" , description = "사용자 삭제")
|
|
|
|
|
@PutMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
public ResponseEntity<? extends IRestResponse> removeMinUser(
|
|
|
|
|
@Valid
|
|
|
|
|
final MinUserinfoDto minUserinfoDto) {
|
|
|
|
|
service.removeMinUser(minUserinfoDto);
|
|
|
|
|
return RestResponse.of(HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|