package com.keyware.shandan.system.service.impl;

import com.keyware.shandan.common.entity.Result;
import com.keyware.shandan.common.service.BaseServiceImpl;
import com.keyware.shandan.common.util.IDGenerator;
import com.keyware.shandan.common.util.StringUtils;
import com.keyware.shandan.system.entity.SysDictType;
import com.keyware.shandan.system.mapper.SysDictTypeMapper;
import com.keyware.shandan.system.service.SysDictTypeService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统数据字典类型表 服务实现类
 * </p>
 *
 * @author GuoXin
 * @since 2021-11-17
 */
@Service
public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeMapper, SysDictType, String> implements SysDictTypeService {
    @Override
    public Result<SysDictType> updateOrSave(SysDictType entity) throws Exception {
        if(StringUtils.isBlank(entity.getId())){
            entity.setId(IDGenerator.getId());
        }
        return super.updateOrSave(entity);
    }
}
