|  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.config.Jwt.JwtTokenUtil; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.QrCodeUtils; | 
|---|
|  |  |  | import com.doumee.dao.business.model.RoomTime; | 
|---|
|  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateStatusById") | 
|---|
|  |  |  | @RequiresPermissions("business:rooms:update") | 
|---|
|  |  |  | public ApiResponse updateStatusById(@RequestBody Rooms rooms) { | 
|---|
|  |  |  | roomsService.updateStatusById(rooms); | 
|---|
|  |  |  | roomsService.updateStatusById(rooms,this.getLoginUser(null)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议室主键", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<String> getQrCode(@RequestParam Integer id) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", roomsService.getQrCode(id,user.getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议室主键", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public void getQrCodeImg(@RequestParam Integer id,@RequestParam String token, HttpServletResponse response) throws  Exception { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | response.setHeader("Cache-Control", "no-store, no-cache"); | 
|---|
|  |  |  | response.setContentType("image/jpeg"); | 
|---|
|  |  |  | String content =roomsService.getQrCode(id,user.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("我的会议室列表") | 
|---|
|  |  |  | @PostMapping("/myRoomsPage") | 
|---|
|  |  |  | public ApiResponse<IPage<RoomsResponse>> myRoomsPage(@RequestBody PageWrap<RoomsRequest> pageWrap) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | pageWrap.getModel().setUserId(user.getId()); | 
|---|
|  |  |  | IPage<RoomsResponse> page = roomsService.getRoomsPage(pageWrap); | 
|---|
|  |  |  | return ApiResponse.success("查询成功",page); | 
|---|