| | |
| | | import com.whyc.mapper.LockInfMapper; |
| | | import com.whyc.pojo.db_area.AuthiruzeInf; |
| | | import com.whyc.pojo.db_area.LockInf; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | mapper.update(null,wrapper); |
| | | return new Response().set(1,true); |
| | | } |
| | | //根据mac检测蓝牙锁是否有权限 |
| | | public Response getAuthByUidAndMac(Integer mac) { |
| | | UserInf uinf= ActionUtil.getUser(); |
| | | //获取锁的id |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("lock_mac",mac); |
| | | wrapper.last("limit 1"); |
| | | LockInf linf=lockInfMapper.selectOne(wrapper); |
| | | //检测是否有权限 |
| | | QueryWrapper wrapper1=new QueryWrapper(); |
| | | wrapper1.eq("uname",uinf.getUname()); |
| | | wrapper1.eq("lock_id",linf.getLockId()); |
| | | wrapper1.last("limit 1"); |
| | | AuthiruzeInf auth=mapper.selectOne(wrapper1); |
| | | return new Response().set(1,auth!=null,"根据mac检测蓝牙锁是否有权限"); |
| | | } |
| | | } |