package com.webchat.service.message.builder;

import com.webchat.common.constants.MessageConstants;
import com.webchat.common.enums.ResourceTypeEnum;
import com.webchat.domain.vo.dto.LikeCollectMessageDTO;

import java.util.Date;

/**
 * @Author 程序员七七
 * @webSite https://www.coderutil.com
 * @Date 2022/11/13 14:06
 * @description
 */
public class LikeCollectMessageBuilder extends AbstractMessageBuilder {

    @Override
    protected String getMessageCategory() {
        return MessageConstants.CategoryEnum.LIKE_COLLECT.getCategory();
    }

    public LikeCollectMessageDTO build(MessageConstants.TypeEnum type,
                                       String fromUserId,
                                       String toUserId,
                                       ResourceTypeEnum resourceType,
                                       String resourceId) {
        LikeCollectMessageDTO message = new LikeCollectMessageDTO();
        message.setCategory(getMessageCategory());
        message.setType(type.getType());
        message.setFromUserId(fromUserId);
        message.setToUserId(toUserId);
        message.setResourceType(resourceType.getType());
        message.setResourceId(resourceId);
        message.setCreateDate(new Date());
        return message;
    }
}
