-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
30 changed files
with
474 additions
and
263 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
src/main/java/tavebalak/OTTify/program/controller/OttSavedController.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,31 @@ | ||
package tavebalak.OTTify.program.controller; | ||
|
||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import io.swagger.annotations.ApiResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import tavebalak.OTTify.common.BaseResponse; | ||
import tavebalak.OTTify.program.dto.response.OttListDTO; | ||
import tavebalak.OTTify.program.service.OttService; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/saved/ott") | ||
@Api(tags = {"OTT ์ปจํธ๋กค๋ฌ"}) | ||
public class OttSavedController { | ||
|
||
private final OttService ottService; | ||
|
||
@ApiOperation(value = "์ ์ฅ๋ OTT ๋ฆฌ์คํธ ์กฐํ", notes = "์ ์ฅ๋ ๋ชจ๋ OTT์ ์์ด๋์ ์ด๋ฆ์ ์กฐํํฉ๋๋ค.") | ||
@ApiResponse(code = 200, message = "์ฑ๊ณต์ ์ผ๋ก ์ ์ฅ๋ OTT ๋ฆฌ์คํธ๋ฅผ ์กฐํํ์์ต๋๋ค.") | ||
@GetMapping("") | ||
@ResponseStatus(HttpStatus.OK) | ||
public BaseResponse<OttListDTO> getOttList() { | ||
return BaseResponse.success(ottService.getOttList()); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/tavebalak/OTTify/program/dto/response/OttDTO.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,21 @@ | ||
package tavebalak.OTTify.program.dto.response; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import tavebalak.OTTify.program.entity.Ott; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class OttDTO { | ||
@ApiModelProperty(value = "OTT id") | ||
private Long id; | ||
|
||
@ApiModelProperty(value = "OTT ์ด๋ฆ") | ||
private String name; | ||
|
||
public OttDTO(Ott ott) { | ||
this.id = ott.getId(); | ||
this.name = ott.getName(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/tavebalak/OTTify/program/dto/response/OttListDTO.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,17 @@ | ||
package tavebalak.OTTify.program.dto.response; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class OttListDTO { | ||
List<OttDTO> ottList = new ArrayList<>(); | ||
|
||
public OttListDTO(List<OttDTO> ottList) { | ||
this.ottList = ottList; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/tavebalak/OTTify/program/service/OttService.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,7 @@ | ||
package tavebalak.OTTify.program.service; | ||
|
||
import tavebalak.OTTify.program.dto.response.OttListDTO; | ||
|
||
public interface OttService { | ||
OttListDTO getOttList(); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/tavebalak/OTTify/program/service/OttServiceImpl.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 tavebalak.OTTify.program.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import tavebalak.OTTify.program.dto.response.OttDTO; | ||
import tavebalak.OTTify.program.dto.response.OttListDTO; | ||
import tavebalak.OTTify.program.repository.OttRepository; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class OttServiceImpl implements OttService { | ||
|
||
private final OttRepository ottRepository; | ||
|
||
@Override | ||
public OttListDTO getOttList() { | ||
List<OttDTO> ottDTOList = ottRepository.findAll().stream() | ||
.map(OttDTO::new) | ||
.collect(Collectors.toList()); | ||
|
||
return new OttListDTO(ottDTOList); | ||
} | ||
} |
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
5 changes: 2 additions & 3 deletions
5
src/main/java/tavebalak/OTTify/user/dto/Request/UserOttUpdateDTO.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
17 changes: 8 additions & 9 deletions
17
src/main/java/tavebalak/OTTify/user/dto/Request/UserProfileUpdateDTO.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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package tavebalak.OTTify.user.dto.Request; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.hibernate.validator.constraints.Length; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class UserProfileUpdateDTO { | ||
|
||
@NotNull(message = "๋๋ค์์ ์ ๋ ฅํด์ฃผ์ธ์.") | ||
@Pattern(regexp = "^[ใฑ-ใ ๊ฐ-ํฃa-z0-9-_]{2,10}$", message="๋๋ค์์ ํน์๋ฌธ์๋ฅผ ์ ์ธํ 2 ~ 10์๋ฆฌ์ฌ์ผ ํฉ๋๋ค.") | ||
@Length(min=2, max=10, message="๋๋ค์์ 2์ ์ด์, 10์ ์ดํ๋ก ์ ๋ ฅํด์ฃผ์ธ์") | ||
private String nickName; | ||
@NotNull(message = "๋๋ค์์ ์ ๋ ฅํด์ฃผ์ธ์.") | ||
@Pattern(regexp = "^[ใฑ-ใ ๊ฐ-ํฃa-z0-9-_]{2,10}$", message = "๋๋ค์์ ํน์๋ฌธ์๋ฅผ ์ ์ธํ 2 ~ 10์๋ฆฌ์ฌ์ผ ํฉ๋๋ค.") | ||
@Length(min = 2, max = 10, message = "๋๋ค์์ 2์ ์ด์, 10์ ์ดํ๋ก ์ ๋ ฅํด์ฃผ์ธ์") | ||
private String nickName; | ||
|
||
@NotNull(message = "์ฌ์ง์ ์ ๋ก๋ํด์ฃผ์ธ์.") | ||
private String profilePhoto; | ||
@NotNull(message = "์ฌ์ง์ ์ ๋ก๋ํด์ฃผ์ธ์.") | ||
private String profilePhoto; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/tavebalak/OTTify/user/dto/Response/LikedProgramDTO.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
Oops, something went wrong.