Skip to content

Commit

Permalink
fix : 트레이너 조회 admin수정
Browse files Browse the repository at this point in the history
  • Loading branch information
moonjin-kim committed Apr 2, 2024
1 parent 4f2e441 commit 627fcb0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
import com.sideProject.PlanIT.domain.post.dto.response.BannerResponseDto;
import com.sideProject.PlanIT.domain.post.service.BannerService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/admin/banner")
@Slf4j
@RequiredArgsConstructor
public class BannerAdminController {
private final BannerService bannerService;

@PostMapping
public ApiResponse<String> createBanner(@ModelAttribute BannerRequestDto bannerRequestDto) {
public ApiResponse<String> createBanner(@ModelAttribute BannerRequestDto bannerRequestDto
) {
log.info(bannerRequestDto.getTitle());
return ApiResponse.ok(bannerService.createBanner(bannerRequestDto));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package com.sideProject.PlanIT.domain.post.dto.request;

import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.time.LocalDate;

@Getter
public class BannerRequestDto {
@Builder
public class BannerRequestDto implements Serializable {
private String title;
private LocalDate startAt;
private LocalDate endAt;
private MultipartFile image;

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.sideProject.PlanIT.common.response.ApiResponse;
import com.sideProject.PlanIT.domain.user.dto.employee.response.TrainerScheduleResponseDto;
import com.sideProject.PlanIT.domain.user.dto.member.response.MemberResponseDto;
import com.sideProject.PlanIT.domain.user.service.WorktimeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import com.sideProject.PlanIT.domain.user.dto.employee.request.TrainerScheduleRequestDto;

Expand All @@ -25,6 +27,11 @@ public ApiResponse<?> trainerScheduleRegistration(@RequestBody List<TrainerSched
return ApiResponse.ok(worktimeservice.trainerScheduleRegistration(request,id));
}

@GetMapping("/trainerschedule/{trainer_id}")
public ApiResponse<List<TrainerScheduleResponseDto>> findTrainerSchedule(@PathVariable("trainer_id") Long trainer_id, Principal principal, Pageable pageable){
Long id = Long.parseLong(principal.getName());
return ApiResponse.ok(worktimeservice.findoneTrianerSchedule(trainer_id,id));
};



Expand Down

0 comments on commit 627fcb0

Please sign in to comment.