啊鑫
2024-11-18 f61d65290e3d7ba23432a9a017065af0e0636a1a
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
package com.gs.dingtalk;
 
import com.gs.dingtalk.config.URLEncoder;
import com.gs.dingtalk.service.SendDingtalkService;
import com.gs.dingtalk.service.SimpleExample;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
 
import java.math.BigDecimal;
import java.math.RoundingMode;
 
@SpringBootTest
class DeviceReceivingApplicationTests {
 
 
    @Autowired
    private SimpleExample simpleExample;
 
    @Autowired
    private SendDingtalkService sendDingtalkService;
 
    @Test
    void contextLoads() {
        //FFFFFFFE
        long decimal = Long.parseLong("FFFFFFFE", 16);  // 将16进制字符串转换为long类型的10进制数
        BigDecimal a = new BigDecimal(String.valueOf((int) decimal));
        BigDecimal b = new BigDecimal("1000");
        BigDecimal c = a.divide(b, 3, RoundingMode.HALF_UP);
        System.out.println(c);
    }
 
    @Test
    void cont() {
//        long resultCode = Long.parseLong("00000001");
//        int result = (int) resultCode;
//        System.out.println(result);
 
        String encode = URLEncoder.encode("");
        System.out.println(encode);
    }
 
    @Test
    void getPhone() throws Exception {
        sendDingtalkService.getDingTalkUserId();
    }
 
    @Test
    void sendDingTalk() throws Exception {
        sendDingtalkService.sendDingTalkFiveMinute();
    }
 
    //chatSendMessage
    @Test
    void chatSendMessage() throws Exception {
        sendDingtalkService.chatSendMessage();
    }
}