|  |  |  | 
|---|
|  |  |  | package com.dy.pmsBase; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dingtalk.api.response.OapiRobotSendResponse; | 
|---|
|  |  |  | import com.dy.pmsGlobal.util.DingDingUtils; | 
|---|
|  |  |  | import org.junit.jupiter.api.Test; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.boot.test.context.SpringBootTest; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @SpringBootTest | 
|---|
|  |  |  | class PmsWebBaseApplicationTests { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private DingDingUtils dingDingUtils; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | public void setDingDingUtils(DingDingUtils dingDingUtils) { | 
|---|
|  |  |  | this.dingDingUtils = dingDingUtils; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @Test | 
|---|
|  |  |  | void contextLoads() { | 
|---|
|  |  |  | OapiRobotSendResponse rsp = dingDingUtils.send("各位,这是一条测试消息"); | 
|---|
|  |  |  | System.out.println(rsp.getErrcode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|