package com.chuanghai.ihotel.controller; import com.chuanghai.ihotel.component.DoorLockComponent; import com.chuanghai.ihotel.component.WaterElectricComponent; import com.chuanghai.ihotel.component.WeiXiaoComponent; import com.chuanghai.ihotel.dto.DoorLockAddPasswordRequestDTO; import com.chuanghai.ihotel.service.HotelOrderService; 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; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Arrays; /** * 测试接口 * * @ignore * @author codingliang * @email codingliang@gmail.com * @date 2022-07-27 10:02:04 */ @RestController @RequestMapping("test") public class TestController { @Autowired WaterElectricComponent waterElectricComponent; @Autowired DoorLockComponent doorLockComponent; @Autowired private HotelOrderService orderService; @Autowired private WeiXiaoComponent weiXiaoComponent; @GetMapping("test1") public void test1() { waterElectricComponent.queryToken(); } @GetMapping("test2") public void test2() { System.out.println(waterElectricComponent.queryPowerRealTimeData("NCJT210826010122")); } @GetMapping("test3") public void test3() { System.out.println(waterElectricComponent.queryLastHistoryCumulantInfo("20200410400577")); } @GetMapping("test4") public void test4(String pointId, String operType) { System.out.println(waterElectricComponent.remoteDisconnect(pointId, operType)); } @GetMapping("test5") public void test5() { LocalDateTime startTime = LocalDateTime.of(2022, 8, 2, 14, 0); LocalDateTime endTime = LocalDateTime.of(2022, 8, 3, 12, 0); DoorLockAddPasswordRequestDTO dto = DoorLockAddPasswordRequestDTO .builder() .categoryId("d0c248256f8346d2a19afa296562b319") .luid("80A036D93CFB") .type("4") .userName("test") .startTime(startTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()) .endTime(endTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()) .build(); doorLockComponent.addPassword(dto); } @GetMapping("test6") public void test6() { doorLockComponent.deleteLockUser("80A036D93CFB", "c7e634f560954849811f1001b6174e29"); } @GetMapping("test7") public void test7(Long orderId, String realAmount) { orderService.orderPaySuccess(orderId, null, realAmount, null); } @GetMapping("test8") public void test8() { weiXiaoComponent.sendNotice(Arrays.asList("123456"), "公寓预定成功通知", "公寓预定成功", "你好,你的公寓预定成功,你好,你的公寓预定成功,你好,你的公寓预定成功,你好,你的公寓预定成功。", null); } }