package com.storlead.sales.service.impl.customer;

import com.storlead.framework.common.result.Result;
import com.storlead.sales.pojo.entity.customer.LiaisonResourceEntity;
import com.storlead.sales.mapper.customer.LiaisonResourceMapper;
import com.storlead.sales.service.customer.LiaisonResourceService;
import com.storlead.framework.mybatis.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 联系人资源关联表 服务实现类
 * </p>
 *
 * @author YPZ
 * @since 2024-09-23
 */
@Service
public class LiaisonResourceServiceImpl extends MyBaseServiceImpl<LiaisonResourceMapper, LiaisonResourceEntity> implements LiaisonResourceService {

    @Override
    public Result<?> addLiasonResource(LiaisonResourceEntity liaisonResource) {
        liaisonResource.setId(null);
        boolean isOk = save(liaisonResource);
        if (!isOk) {
            return Result.error("添加失败！");
        }
        return Result.ok();
    }

    @Override
    public Result<?> editLiasonResource(LiaisonResourceEntity liaisonResource) {

        boolean isOk = updateById(liaisonResource);
        if (!isOk) {
            return Result.error("编辑失败！");
        }
        return Result.ok();
    }
}
