package com.fs.fssync.sink.impl;

import com.fs.fssync.sink.AbstractCdcSinkStrategy;
import com.fs.store.domain.FsUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Slf4j
@Component
public class FsUserSinkStrategy extends AbstractCdcSinkStrategy<FsUser> implements Serializable {

    @Override
    public boolean canHandle(String table) {
        return "fs_user".equals(table);
    }

    @Override
    public Class<FsUser> getEntityClass() {
        return FsUser.class;
    }

    @Override
    public String getKeyPrefix() {
        log.info("获取fs_user前缀");
        return "fs:user:";
    }

    @Override
    protected String getIdField() {
        return "userId";
    }
}
