zhanghua
2023-11-02 46251c20b66bb1ca05058ae63a92a195e5543b90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.ycl.sccgplatform;
 
import com.alibaba.fastjson.JSONObject;
import com.ycl.common.util.UtilNumber;
import com.ycl.dto.video.Camera;
import com.ycl.dto.video.HttpResponseResult;
import com.ycl.dto.video.PageResult;
import com.ycl.mapper.unlawful.UnlawfulMapper;
import com.ycl.service.oss.OssService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
 
import javax.annotation.Resource;
import javax.xml.bind.DatatypeConverter;
import java.io.*;
import java.util.List;
import java.util.UUID;
 
@SpringBootTest
public class Test1 {
 
    @Autowired
    private OssService ossService;
 
    @Resource
    private UnlawfulMapper unlawfuldao;
    @Autowired
    UtilNumber utilNumber;
 
    @Test
    void test() {
//        List<CategoryDto> data = unlawfuldao.getDataByType(0, 5,"2022-12-14 17:19:01", "2022-12-14 17:19:03");
//        System.out.println(data);
        System.out.println(utilNumber.createShopCode());
        System.out.println(utilNumber.createCaseCode());
    }
 
//    @Test
//    void test1(){
//        List<StatusDto> statusData = unlawfuldao.getStatusData(null, null, 23);
//        System.out.println(statusData);
//    }
 
    @Test
    void test2() {
        double v = Double.parseDouble("1.0");
        double v1 = Double.parseDouble("3.0");
        System.out.println(v / v1);
    }
 
    @Test
    void test3() {
        System.out.println("sczf/" + String.valueOf(UUID.randomUUID()));
    }
 
    @Test
    void test4() throws Exception {
        String extension = "jpg";
 
        File file = new File("src/main/resources/file.txt");
        FileInputStream fis = new FileInputStream(file);
        InputStreamReader isr = new InputStreamReader(fis);
        BufferedReader br = new BufferedReader(isr);
 
        String PicData = br.readLine();
        byte[] data = DatatypeConverter.parseBase64Binary(PicData);
        InputStream inputStream = new ByteArrayInputStream(data);
        String s = ossService.uploadImages(inputStream, extension);
        System.out.println(s);
 
        br.close();
        isr.close();
        fis.close();
    }
}