mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
新增了南通设备
This commit is contained in:
parent
f91b6c7429
commit
f65168f08f
@ -21,6 +21,7 @@ import com.ics.common.utils.IpUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
@ -49,6 +50,11 @@ public class ApiEquipmentController extends BaseController {
|
||||
@Autowired
|
||||
private IVisitorPersonService visitorPersonService;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
String smallWxAccessTokenKey = "nantong-";
|
||||
|
||||
//根据用户id查询对应的设备, 楼层分割,房间,设备信息,
|
||||
@RequiresPermissions("member:center:view")
|
||||
@GetMapping("/getEquipmentByUserId/{userId}")
|
||||
@ -169,4 +175,37 @@ public class ApiEquipmentController extends BaseController {
|
||||
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描二维码开门 用户id 和设备id
|
||||
*
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("/scanDoor")
|
||||
public R scanDoor(String ip ){
|
||||
// todo 开门
|
||||
// todo 获取ip后,key为ip,value为设备id 存入redis
|
||||
// 所有设备的ip都存入redis 里面
|
||||
System.out.println(ip);
|
||||
return R.ok("开门成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 开门接口,南通
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("/isOpenDoor")
|
||||
public R isOpenDoor(String ip ){
|
||||
// 根据ip 去redis读取数据
|
||||
String smallWxAccessToken = redisTemplate.opsForValue().get(smallWxAccessTokenKey+ip);
|
||||
if (StringUtils.isNotBlank(smallWxAccessToken)){
|
||||
Boolean delete = redisTemplate.delete(smallWxAccessTokenKey + ip);
|
||||
if (delete){
|
||||
R.error("删除redis失败");
|
||||
}
|
||||
return R.ok("开门成功");
|
||||
}else {
|
||||
return R.error("开门失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user