// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   MyMetaObjectHandler.java

package com.example.ghjgpython.conf;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// Referenced classes of package com.example.ghjgpython.conf:
//            SnowflakeConfig

public class MyMetaObjectHandler
    implements MetaObjectHandler
{

    public MyMetaObjectHandler()
    {
    }

    public void insertFill(MetaObject metaObject)
    {
        Long id = snowflakeConfig.snowflakeIdLong();
        log.info((new StringBuilder()).append("===   \u751F\u6210id").append(id).toString());
        setFieldValByName("id", id, metaObject);
        setFieldValByName("del", "0", metaObject);
        setFieldValByName("createTime", new Date(), metaObject);
        if(metaObject.hasSetter("updateTime"))
            setFieldValByName("updateTime", new Date(), metaObject);
    }

    public void updateFill(MetaObject metaObject)
    {
        if(metaObject.hasSetter("updateTime"))
            setFieldValByName("updateTime", new Date(), metaObject);
    }

    private static final Logger log = LoggerFactory.getLogger(MyMetaObjectHandler.class);
    SnowflakeConfig snowflakeConfig;

}
