| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/reboot") |
| | | public ResponseVO<Object> reboot(@RequestBody VnnoxParam vnnoxWebRequest) { |
| | | VnnoxResult vnnoxResult = vnnoxService.reboot(vnnoxWebRequest.getPlayerList()); |
| | | public ResponseVO<Object> reboot(@RequestBody List<String> vnnoxWebRequest) { |
| | | VnnoxResult vnnoxResult = vnnoxService.reboot(vnnoxWebRequest); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | } |
| | | |
| | | /** |
| | | * 同步播放 |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/syncPlay") |
| | | public ResponseVO<Object> syncPlay(@RequestBody Map map) { |
| | | List playIdlist = (List)map.get("playIdlist"); |
| | | Integer option = (Integer) map.get("option"); |
| | | VnnoxResult vnnoxResult = vnnoxService.syncPlay(playIdlist,option); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | } |
| | | |
| | | /** |
| | | * ntp对时 |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/ntp") |
| | | public ResponseVO<Object> ntp(@RequestBody Map map) { |
| | | boolean enable = (boolean)map.get("enable"); |
| | | List playIdlist = (List)map.get("playIdlist"); |
| | | VnnoxResult vnnoxResult = vnnoxService.ntpSync(playIdlist,enable); |
| | | return ResponseUtil.success(vnnoxResult); |
| | | } |
| | | |
| | |
| | | |
| | | @GetMapping("/onLineList") |
| | | public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | // public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LedPlayerEntity> wrapper = Wrappers.lambdaQuery(LedPlayerEntity.class); |
| | | |
| | | if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | //wrapper.eq(LedPlayerEntity::get) |
| | | return ResponseUtil.success(""); // todo |
| | | } else { |
| | | wrapper.like(LedPlayerEntity::getPlayerName, keyword); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | List<LedPlayerEntity> online = new ArrayList<>(); |
| | | for (LedPlayerEntity ledPlayer : entities) { |
| | |
| | | } |
| | | } |
| | | return ResponseUtil.success(online); |
| | | } |
| | | |
| | | } |
| | | |
| | | @GetMapping("/getVnnoxInfo/{sn}") |