-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: dto & service interface & repository & test
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.neorang.neims.issue.dto; | ||
|
||
import com.neorang.neims.issue.domain.Color; | ||
import com.neorang.neims.issue.domain.Label; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class LabelForm { | ||
|
||
private long labelId; | ||
|
||
private String label; | ||
|
||
private Color color; | ||
|
||
@Builder | ||
public LabelForm(long labelId, String label, Color color) { | ||
this.labelId = labelId; | ||
this.label = label; | ||
this.color = color; | ||
} | ||
|
||
public Label toEntity() { | ||
return Label.builder() | ||
.labelId(labelId) | ||
.label(label) | ||
.color(color) | ||
.build(); | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/neorang/neims/issue/repository/LabelRepository.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 com.neorang.neims.issue.repository; | ||
|
||
import com.neorang.neims.issue.domain.Label; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface LabelRepository extends JpaRepository<Label, Long> { | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/neorang/neims/issue/service/LabelService.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,16 @@ | ||
package com.neorang.neims.issue.service; | ||
|
||
import com.neorang.neims.issue.domain.Label; | ||
import com.neorang.neims.issue.dto.LabelForm; | ||
|
||
public interface LabelService { | ||
|
||
Label create(LabelForm form); | ||
|
||
Label update(LabelForm form); | ||
|
||
Label findById(long issueId); | ||
|
||
void delete(long issueId); | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/test/java/com/neorang/neims/issue/service/LabelServiceTest.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 com.neorang.neims.issue.service; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@Slf4j | ||
@SpringBootTest | ||
class LabelServiceTest { | ||
|
||
@Autowired | ||
LabelService labelService; | ||
|
||
@Test | ||
void create() { | ||
} | ||
|
||
@Test | ||
void update() { | ||
} | ||
|
||
@Test | ||
void findById() { | ||
} | ||
|
||
@Test | ||
void delete() { | ||
} | ||
|
||
} |