src/main/java/com/whyc/controller/AppController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/db_area/AuthiruzeInf.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/AuthiruzeInfService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/AppController.java
New file @@ -0,0 +1,26 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.db_area.AuthiruzeInf; import com.whyc.service.AuthiruzeInfService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @Api(tags = "app管理") @RequestMapping("app") public class AppController { @Autowired private AuthiruzeInfService authService; @ApiOperation(value = "普通用户登录查看自己授权记录") @GetMapping("getAuthByUid") public Response getAuthByUid(){ return authService.getAuthByUid(); } } src/main/java/com/whyc/pojo/db_area/AuthiruzeInf.java
@@ -69,5 +69,6 @@ @TableField(exist = false) private List<LockInf> lockInfs; @TableField(exist = false) private LockInf linf; } src/main/java/com/whyc/service/AuthiruzeInfService.java
@@ -135,4 +135,22 @@ return new Response().set(1,auth!=null,"有权限"); } } //普通用户登录查看自己授权记录-----app public Response getAuthByUid() { UserInf uinf=ActionUtil.getUser(); QueryWrapper wrapper=new QueryWrapper(); wrapper.eq("uname",uinf.getUname()); wrapper.eq("key_id",0);//蓝牙钥匙 List<AuthiruzeInf> list=mapper.selectList(wrapper); if(list!=null){ for (AuthiruzeInf auth:list) { QueryWrapper wrapper1=new QueryWrapper(); wrapper1.eq("lock_id",auth.getLockId()); wrapper1.last("limit 1"); LockInf linf=lockInfMapper.selectOne(wrapper1); auth.setLinf(linf); } } return new Response().setII(1,list!=null,list,"普通用户登录查看自己授权记录-----app"); } }