Skip to content

Commit

Permalink
rename tag on name
Browse files Browse the repository at this point in the history
  • Loading branch information
s39f4lt committed Jan 4, 2021
1 parent 2aa5f87 commit 1c6bf44
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private static TagDto convertToDto(Tag source) {
}
TagDto result = new TagDto();
result.setId(source.getId());
result.setTag(source.getTag());
result.setName(source.getName());
return result;
}

Expand All @@ -27,7 +27,7 @@ private static Tag convertToEntity(TagDto source) {
}
Tag result = new Tag();
result.setId(source.getId());
result.setTag(source.getTag());
result.setName(source.getName());
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/java/ru/school/matcha/domain/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class Tag {

private Long id;
private String tag;
private String name;
private Date createTs;

}
2 changes: 1 addition & 1 deletion backend/src/main/java/ru/school/matcha/dto/TagDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
public class TagDto {

private Long id;
private String tag;
private String name;

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void createUserRefTag(String tagName, Long userId) {
Tag tag;
if (!tagOptional.isPresent()) {
tag = new Tag();
tag.setTag(tagName);
tag.setName(tagName);
createTag(tag);
} else {
tag = tagOptional.get();
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/ru/school/matcha/dao/TagMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

<resultMap id="Tag" type="ru.school.matcha.domain.Tag">
<id property="id" column="id"/>
<result property="tag" column="tag"/>
<result property="name" column="tag"/>
<result property="createTs" column="create_ts"/>
</resultMap>

<insert id="createTag" keyProperty="id" useGeneratedKeys="true" keyColumn="id">
INSERT INTO tags(tag)
VALUES (#{tag})
VALUES (#{name})
</insert>

<insert id="createUserRefTag">
Expand Down

0 comments on commit 1c6bf44

Please sign in to comment.