package com.bonus.canteen.core.customer.service;

import com.bonus.canteen.core.customer.mapper.CustCasualRelationMapper;
import com.bonus.canteen.core.customer.model.CustCasualRelation;
import com.bonus.common.houqin.constant.LeConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

@Service
public class CustCasualRelationService {

   @Autowired
   @Lazy
   private CustCasualRelationMapper custCasualRelationMapper;

   public void updateBycustIdAndOpenid(Long custId, String openId) {
      CustCasualRelation custCasualRelation = new CustCasualRelation();
      custCasualRelation.setCustId(custId);
      custCasualRelation.setOpenid(openId);
      custCasualRelation.setIsDefault(LeConstants.COMMON_NO);
      custCasualRelationMapper.updateByCustIdAndOpenId(custCasualRelation);
   }

}
