package org.jeecg.modules.ctop.service.impl;

import cn.com.ctop.common.module.utils.ResultMapUtils;
import cn.com.ctop.common.module.utils.StatusCode;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.ctop.entity.DramaInfo;
import org.jeecg.modules.ctop.mapper.DramaInfoMapper;
import org.jeecg.modules.ctop.service.IDramaInfoService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 剧本信息
 * @author jeecg-boot
 * @date   2020-03-04
 * @version V1.0
 */
@Service
public class DramaInfoServiceImpl extends ServiceImpl<DramaInfoMapper, DramaInfo> implements IDramaInfoService {
    @Override
    public Map<String, Object> delete(String id) {
        Map<String, Object> result = new HashMap<>();
        DramaInfo info = this.getById(id);
        if (null == info) {
            ResultMapUtils.setResultMap(result, StatusCode.COMMON_DATA_NOT_EXIST);
            return result;
        }
        info.setEnabled(0);
        this.updateById(info);
        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
        return result;
    }
}
