Skip to content

Commit

Permalink
add: dto & service interface & repository & test
Browse files Browse the repository at this point in the history
  • Loading branch information
clemado1 committed Oct 12, 2022
1 parent 743945f commit d57e708
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/java/com/neorang/neims/issue/dto/LabelForm.java
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();
}

}
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 src/main/java/com/neorang/neims/issue/service/LabelService.java
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);

}
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() {
}

}

0 comments on commit d57e708

Please sign in to comment.