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