Search in sources :

Example 1 with MemberTags

use of wooteco.prolog.member.domain.MemberTags in project prolog by woowacourse.

the class MemberTagService method registerMemberTag.

public void registerMemberTag(Tags tags, Member member) {
    final List<MemberTag> memberTags = tags.toMemberTags(member);
    memberTagRepository.register(new MemberTags(memberTags));
}
Also used : MemberTag(wooteco.prolog.member.domain.MemberTag) MemberTags(wooteco.prolog.member.domain.MemberTags)

Example 2 with MemberTags

use of wooteco.prolog.member.domain.MemberTags in project prolog by woowacourse.

the class MemberTagService method removeMemberTag.

public void removeMemberTag(Tags tags, Member member) {
    final List<MemberTag> memberTags = tags.toMemberTags(member);
    memberTagRepository.unregister(new MemberTags(memberTags));
}
Also used : MemberTag(wooteco.prolog.member.domain.MemberTag) MemberTags(wooteco.prolog.member.domain.MemberTags)

Example 3 with MemberTags

use of wooteco.prolog.member.domain.MemberTags in project prolog by woowacourse.

the class MemberTagService method updateMemberTag.

public void updateMemberTag(Tags originalTags, Tags newTags, Member member) {
    final List<MemberTag> originalMemberTags = originalTags.toMemberTags(member);
    final List<MemberTag> newMemberTags = newTags.toMemberTags(member);
    memberTagRepository.update(new MemberTags(originalMemberTags), new MemberTags(newMemberTags));
}
Also used : MemberTag(wooteco.prolog.member.domain.MemberTag) MemberTags(wooteco.prolog.member.domain.MemberTags)

Example 4 with MemberTags

use of wooteco.prolog.member.domain.MemberTags in project prolog by woowacourse.

the class MemberTagApplicationListener method updateMemberTags.

private void updateMemberTags() {
    final List<StudylogTag> studylogTags = studylogTagService.findAll();
    for (StudylogTag studylogTag : studylogTags) {
        final Tag tag = studylogTag.getTag();
        final Member member = studylogTag.getStudylog().getMember();
        memberTagRepository.register(new MemberTags(Collections.singletonList(new MemberTag(member, tag))));
    }
}
Also used : MemberTags(wooteco.prolog.member.domain.MemberTags) MemberTag(wooteco.prolog.member.domain.MemberTag) MemberTag(wooteco.prolog.member.domain.MemberTag) Tag(wooteco.prolog.studylog.domain.Tag) StudylogTag(wooteco.prolog.studylog.domain.StudylogTag) StudylogTag(wooteco.prolog.studylog.domain.StudylogTag) Member(wooteco.prolog.member.domain.Member)

Aggregations

MemberTag (wooteco.prolog.member.domain.MemberTag)4 MemberTags (wooteco.prolog.member.domain.MemberTags)4 Member (wooteco.prolog.member.domain.Member)1 StudylogTag (wooteco.prolog.studylog.domain.StudylogTag)1 Tag (wooteco.prolog.studylog.domain.Tag)1