package com.bonus.canteen.core.device.door.api;

import com.bonus.canteen.core.device.door.enums.EditUserToDeviceEnum;
import com.bonus.canteen.core.device.door.enums.TriggerTypeEnum;
import com.bonus.canteen.core.device.door.service.DcCustDoorPwdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;


@Component
public class DcPushUserDataServiceApi {

   @Autowired
   @Lazy
   private DcCustDoorPwdService dcCustDoorPwdService;

   public void addUser(Long custId) {
      this.dcCustDoorPwdService.checkUserToDevice(custId, TriggerTypeEnum.ADD, EditUserToDeviceEnum.PUSH);
   }

   public void deleteUser(Long custId) {
      this.dcCustDoorPwdService.checkUserToDevice(custId, TriggerTypeEnum.LOGOUT, EditUserToDeviceEnum.DELETE);
   }

   public void editUser(Long custId) {
      this.dcCustDoorPwdService.checkUserToDevice(custId, TriggerTypeEnum.EDIT, EditUserToDeviceEnum.PUSH);
   }
}
