| | |
| | | package com.ycl.sccgplatform; |
| | | |
| | | import com.dahua.netsdk.lib.callback.impl.AnalyzerDataCB; |
| | | import com.ycl.common.util.UtilNumber; |
| | | import com.ycl.entity.dingding.DingUserInfo; |
| | | import com.ycl.entity.user.UmsAdmin; |
| | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.xml.bind.DatatypeConverter; |
| | |
| | | import java.net.URL; |
| | | import java.util.*; |
| | | |
| | | @ComponentScan("com.dahua.netsdk") |
| | | @SpringBootTest |
| | | public class Test1 { |
| | | |
| | |
| | | ByteArrayOutputStream outs = new ByteArrayOutputStream(); |
| | | Thumbnails.of(in).scale(0.6).outputQuality(1).toOutputStream(outs); |
| | | InputStream ins = new ByteArrayInputStream(outs.toByteArray()); |
| | | String picData = ossService.uploadImages(ins, ".png"); |
| | | String picData = ossService.uploadImages(ins, ".png",0); |
| | | System.out.println(picData); |
| | | } |
| | | } catch (IOException e) { |
| | |
| | | String PicData = br.readLine(); |
| | | byte[] data = DatatypeConverter.parseBase64Binary(PicData); |
| | | InputStream inputStream = new ByteArrayInputStream(data); |
| | | String s = ossService.uploadImages(inputStream, extension); |
| | | String s = ossService.uploadImages(inputStream, extension,0); |
| | | System.out.println(s); |
| | | |
| | | br.close(); |
| | | isr.close(); |
| | | fis.close(); |
| | | } |
| | | |
| | | @Autowired |
| | | AnalyzerDataCB analyzerDataCB; |
| | | |
| | | @Test |
| | | void alarmTest() { |
| | | |
| | | analyzerDataCB.invoke(null, 0, null, null, 0, null, 0, null); |
| | | |
| | | // AlarmDataCB cbMessage = new AlarmDataCB(); |
| | | // String m_strIp = "172.28.194.177"; |
| | | // int m_nPort = 37777; |
| | | // String m_strUser = "admin"; |
| | | // String m_strPassword = "scdx@123"; |
| | | // LoginModule.login(m_strIp, m_nPort, m_strUser, m_strPassword); |
| | | // AlarmListenModule.startListen(cbMessage); |
| | | // |
| | | // System.out.println(cbMessage.data); |
| | | } |
| | | |
| | | |
| | | } |
| | | |