package com.yihu.jw.entity.util;

import javax.persistence.AttributeConverter;

/**
 * Created by yeshijie on 2021/1/21.
 */
public class StringFStringEncryptConverter implements AttributeConverter<String, String> {
    @Override
    public String convertToDatabaseColumn(String attribute) {
        return AesEncryptUtils.encrypt(attribute);
    }

    @Override
    public String convertToEntityAttribute(String dbData) {
        return AesEncryptUtils.decrypt(dbData);
    }
}
