package com.platform.service.custom;

import com.platform.entity.ApiTmGoodsDetailLogVo;
import com.platform.enums.IdStarterEnum;
import com.platform.service.impl.ApiTmGoodsDetailLogServiceImpl;
import com.platform.utils.UUidGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author abnerhou
 * @date 2020/9/27 16:11
 * @desciption
 */
@Service
@Slf4j
public class MyGoodsDetailLogService extends ApiTmGoodsDetailLogServiceImpl {

    public int addNew(ApiTmGoodsDetailLogVo apiTmGoodsDetailLogVo){
        if(null == apiTmGoodsDetailLogVo){
            return -1;
        }
        apiTmGoodsDetailLogVo.setLogId(UUidGenerator.generatorUuid(IdStarterEnum.DEFAULT_ID.getStarter()));
        apiTmGoodsDetailLogVo.setCreateTime(LocalDateTime.now());
        apiTmGoodsDetailLogVo.setUpdateTime(LocalDateTime.now());
        apiTmGoodsDetailLogVo.setEnable(1);
        return getBaseMapper().insert(apiTmGoodsDetailLogVo);
    }


}
