| | |
| | | PAY_CONFIG("支付配置"), |
| | | BANNER("微信logo"), |
| | | POLE_LIST("灯杆列表"), |
| | | LIGHT_POLE_HEELING_LIST("灯杆倾斜"); |
| | | LIGHT_POLE_HEELING_LIST("灯杆倾斜"), |
| | | |
| | | //按钮权限 |
| | | ADMIN_ADD("新增管理员"), |
| | | ADMIN_INFO_UPDATE("编辑管理员信息"), |
| | | ADMIN_DELETE("删除管理员"), |
| | | AIR_EQUIPMENT_DELETE("删除大气设备"), |
| | | BANNER_ADD("添加微信logo"), |
| | | BANNER_UPDATE("编辑微信logo"), |
| | | BANNER_DETAIL("获取微信logo详情"), |
| | | BANNER_DELETE("删除微信logo"), |
| | | CLIENT_ADD("新增客户"), |
| | | CLIENT_INFO_UPDATE("编辑客户信息"), |
| | | CLIENT_DELETE("删除客户"), |
| | | IP_BROADCAST_SYNCH("同步IP音柱"), |
| | | IP_BROADCAST_INFO_UPDATE("修改IP音柱名称"), |
| | | IP_BROADCAST_CHANGE_VOL("修改IP音柱音量"), |
| | | |
| | | |
| | | WATER_EQUIPMENT_ADD("新增水质设备"); |
| | | |
| | | |
| | | private final String code; |
| | |
| | | @Log("后台用户注册") |
| | | @PostMapping("/register") |
| | | public ResponseVO<Object> register(@Validated @RequestBody AdminParam param) { |
| | | if (!permissionConfig.check(MenuEnum.ADMIN_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = adminService.register(param); |
| | | if (result) { |
| | | return ResponseUtil.success("注册用户成功"); |
| | |
| | | @Log("后台用户修改信息") |
| | | @PostMapping("/update/{adminId}") |
| | | public ResponseVO<Object> updateAdmin(@RequestBody AdminParam param, @PathVariable Long adminId) { |
| | | if (!permissionConfig.check(MenuEnum.ADMIN_INFO_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = adminService.updateAdmin(adminId, param); |
| | | if (result) { |
| | | return ResponseUtil.success("修改成功"); |
| | |
| | | @Log("后台用户删除") |
| | | @PostMapping("/del/{adminId}") |
| | | public ResponseVO<Object> deleteAdmin(@PathVariable Long adminId) { |
| | | if (!permissionConfig.check(MenuEnum.ADMIN_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = adminService.deleteAdmin(adminId); |
| | | if (result) { |
| | | return ResponseUtil.success("修改成功"); |
| | |
| | | */ |
| | | @GetMapping("/listAirEquipmentMAC") |
| | | public ResponseVO<Object> listAirEquipmentMAC() { |
| | | //TODO |
| | | List<String> list = airDataService.listAirEquipmentMAC(); |
| | | return ResponseUtil.success(list); |
| | | } |
| | |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteAirEquipment(@PathVariable Long id) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_EQUIPMENT_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = airEquipmentService.deleteAirEquipment(id); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | |
| | | |
| | | @PostMapping("/addbanner") |
| | | public ResponseVO<Object> addBanner(@Validated @RequestBody BannerParam bannerParam) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | Client client = clientService.getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, bannerParam.getBinding_author())); |
| | | |
| | | |
| | | boolean result = contentBannerService.addBanner(bannerParam, client); |
| | | if (result) { |
| | |
| | | |
| | | @PostMapping("/{bannerId}") |
| | | public ResponseVO<Object> updateBanner(@PathVariable Long bannerId, @Validated @RequestBody BannerParam bannerParam) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = contentBannerService.updateBanner(bannerId, bannerParam); |
| | | if (result) { |
| | | return ResponseUtil.success("更新成功"); |
| | |
| | | |
| | | @GetMapping("/{bannerId}") |
| | | public ResponseVO<Object> detailBanner(@PathVariable Long bannerId) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_DETAIL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | BannerDto result = contentBannerService.detailBanner(bannerId); |
| | | return ResponseUtil.success(result); |
| | | } |
| | |
| | | |
| | | @PostMapping("/delete/{bannerId}") |
| | | public ResponseVO<Object> deleteBanner(@PathVariable Long bannerId) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = contentBannerService.deleteBanner(bannerId); |
| | | if (result) { |
| | | return ResponseUtil.success("删除成功"); |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addClient(@RequestBody @Validated AddClientPrarm addClientPrarm) { |
| | | if (!permissionConfig.check(MenuEnum.CLIENT_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean b = clientService.addClient(addClientPrarm); |
| | | if (b) { |
| | | return ResponseUtil.success("添加成功"); |
| | |
| | | |
| | | @PostMapping("/update/{id}") |
| | | public ResponseVO<Object> updateClient(@PathVariable Long id, @RequestBody @Validated UpdateClientPrarm updateClientPrarm) { |
| | | if (!permissionConfig.check(MenuEnum.CLIENT_INFO_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean b = clientService.updateClient(id, updateClientPrarm); |
| | | if (b) { |
| | | return ResponseUtil.success("更新成功"); |
| | |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteClient(@PathVariable Long id) { |
| | | if (!permissionConfig.check(MenuEnum.CLIENT_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean b = clientService.deleteClient(id); |
| | | if (b) { |
| | | return ResponseUtil.success("删除成功"); |
| | |
| | | private IpVolumeService broadcastTerminalV2Service; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | //TODO |
| | | @PostMapping("/synchTerminal") |
| | | public ResponseVO<Object> synchTerminal() { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_SYNCH.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | broadcastTerminalV2Service.synchTerminal(); |
| | | return ResponseUtil.success("同步完成!"); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 修改音柱名称 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateBroadcastTerminalName/{id}") |
| | | public ResponseVO<Object> updateBroadcastTerminalName(@PathVariable Integer id,@RequestBody ReceiveParam param) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_INFO_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean flag = broadcastTerminalV2Service.updateBroadcastTerminalName(param.getName(),id); |
| | | if (flag) { |
| | | return ResponseUtil.success("成功修改音柱名称!"); |
| | |
| | | |
| | | @PostMapping("/changeVol") |
| | | public ResponseVO<Object> changeVol(@RequestBody BroadcastTerminalV2Param broadcastTerminalV2Param) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_CHANGE_VOL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean flag = broadcastTerminalV2Service.changeVol(broadcastTerminalV2Param); |
| | | if (flag) { |
| | | return ResponseUtil.success("成功修改音量!"); |
| | |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.param.RemotePrarm; |
| | | import com.sandu.ximon.admin.param.RemoteUpdateParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.RemoteUpdateService; |
| | | import com.sandu.ximon.admin.utils.HexUtils; |
| | | import com.sandu.ximon.admin.utils.StringUtil; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RequestMapping("/v1/remoteupdate") |
| | | public class RemoteUpdateController { |
| | | private RemoteUpdateService remoteUpdateService; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/add") |
| | |
| | | @AnonymousAccess |
| | | @PostMapping("/StartRemoteUpdate") |
| | | public ResponseVO<Object> startRemoteUpdate(@RequestBody @Validated RemotePrarm remotePrarm) { |
| | | // if (!permissionConfig.check(MenuEnum.MENU_LIST.getCode())) { |
| | | // return ResponseUtil.fail("缺少对应用户权限"); |
| | | // } |
| | | String orderType; |
| | | boolean UpdateFlag = false; |
| | | |
| | |
| | | |
| | | /** |
| | | * 删除水质设备 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addQualityEquipment(@RequestBody WaterQualityEquipment waterQualityEquipment) { |
| | | if (!permissionConfig.check(MenuEnum.WATER_EQUIPMENT_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = waterQualityEquipmentService.addWaterQualityEquipment(waterQualityEquipment); |
| | | if (result) { |
| | | return ResponseUtil.success("成功添加水质设备"); |