-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from potenday-23/feature/ticket_folder
Feature : ํฐ์ผ ํด๋ ๋ฐ์ดํฐ ๊ตฌ์กฐ ์ถ๊ฐ
- Loading branch information
Showing
22 changed files
with
329 additions
and
40 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
src/main/java/project/backend/domain/jwt/response/JwtResponse.java
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
src/main/java/project/backend/domain/like/CulturalEventLikeListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ | |
public class MediaDto { | ||
private String mediaUrl; | ||
private Integer ordering; | ||
private Boolean isThumbnail; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/project/backend/domain/member/MemberListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package project.backend.domain.member; | ||
|
||
import org.springframework.stereotype.Component; | ||
import project.backend.domain.member.entity.Member; | ||
import project.backend.domain.ticketfolder.entity.TicketFolder; | ||
import project.backend.domain.ticketfolder.repository.TicketFolderRepository; | ||
import project.backend.global.config.SpringContext; | ||
|
||
import javax.persistence.PostPersist; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
|
||
@Component | ||
public class MemberListener { | ||
|
||
List<String> defaultTicketFolderTitles = Arrays.asList("๋ฎค์ง์ปฌ", "์ํ", "์ฐ๊ทน", "์ฝ์ํธ", "์ ์ํ"); | ||
@PostPersist | ||
public void postPersist(Member member) { | ||
TicketFolderRepository ticketFolderRepository = SpringContext.getBean(TicketFolderRepository.class); | ||
for (String title : defaultTicketFolderTitles) { | ||
TicketFolder ticketFolder = TicketFolder.builder().isDefault(true).title(title).build(); | ||
ticketFolderRepository.save(ticketFolder); | ||
ticketFolder.setMember(member); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/project/backend/domain/ticketfolder/controller/TicketFolderController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package project.backend.domain.ticketfolder.controller; | ||
|
||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.web.bind.annotation.*; | ||
import project.backend.domain.ticket.dto.TicketCreateDto; | ||
import project.backend.domain.ticket.entity.Ticket; | ||
import project.backend.domain.ticketfolder.dto.TicketFolderCreateDto; | ||
import project.backend.domain.ticketfolder.dto.TicketFolderRetrieveDto; | ||
import project.backend.domain.ticketfolder.entity.TicketFolder; | ||
import project.backend.domain.ticketfolder.mapper.TicketFolderMapper; | ||
import project.backend.domain.ticketfolder.service.TicketFolderService; | ||
|
||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
@Api(tags = "TicketFolder - ํฐ์ผ ํด๋") | ||
@RestController | ||
@RequestMapping("/api/ticket-folders") | ||
@RequiredArgsConstructor | ||
public class TicketFolderController { | ||
private final TicketFolderService ticketFolderService; | ||
private final TicketFolderMapper ticketFolderMapper; | ||
|
||
@ApiOperation(value = "ํฐ์ผ ํด๋ ๋ฆฌ์คํธ ์กฐํ") | ||
@PreAuthorize("isAuthenticated()") | ||
@GetMapping | ||
public ResponseEntity list() { | ||
List<TicketFolder> ticketFolderList = ticketFolderService.getTicketFolderList(); | ||
List<TicketFolderRetrieveDto> ticketFolderRetrieveDtoList = ticketFolderMapper.ticketFolderToTicketFolderRetrieveDto(ticketFolderList); | ||
return ResponseEntity.status(HttpStatus.OK).body(ticketFolderRetrieveDtoList); | ||
} | ||
|
||
@ApiOperation(value = "ํฐ์ผ ํด๋ ์์ฑ") | ||
@PreAuthorize("isAuthenticated()") | ||
@PostMapping | ||
public ResponseEntity create(@Valid @RequestBody TicketFolderCreateDto ticketFolderCreateDto) { | ||
TicketFolder ticketFolder = ticketFolderService.createTicketFolder(ticketFolderCreateDto); | ||
return ResponseEntity.status(HttpStatus.CREATED).body(ticketFolderMapper.ticketFolderToTicketFolderRetrieveDto(ticketFolder)); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/project/backend/domain/ticketfolder/dto/TicketFolderCreateDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package project.backend.domain.ticketfolder.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.*; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Size; | ||
|
||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TicketFolderCreateDto { | ||
@NotBlank | ||
@NotNull(message = "ํฐ์ผ ํด๋์ ์ ๋ชฉ์ ์ ๋ ฅํด์ฃผ์ธ์") | ||
@Size(min = 1, max = 12, message = "1์ ~ 12์ ์ฌ์ด๋ง ์ ๋ ฅ ๊ฐ๋ฅํฉ๋๋ค.") | ||
@Schema(description = "์ ๋ชฉ", example = "์์ธ ๊ณต์ฐ", required = true) | ||
public String title; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/project/backend/domain/ticketfolder/dto/TicketFolderRetrieveDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package project.backend.domain.ticketfolder.dto; | ||
|
||
import lombok.*; | ||
|
||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TicketFolderRetrieveDto { | ||
public Long id; | ||
public String title; | ||
} |
Oops, something went wrong.