|  |  | 
 |  |  | package com.ruoyi.web.controller.project; | 
 |  |  |  | 
 |  |  | import com.aliyun.dingtalkoauth2_1_0.models.GetSsoUserInfoResponseBody; | 
 |  |  | import com.aliyun.tea.Validation; | 
 |  |  | import com.ruoyi.common.core.controller.BaseController; | 
 |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
 |  |  | import com.ruoyi.project.domain.vo.DingTalkReqVo; | 
 |  |  | 
 |  |  | import com.taobao.api.ApiException; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.context.annotation.PropertySource; | 
 |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 钉钉接口 | 
 |  |  | 
 |  |  |  * @author liusheng | 
 |  |  |  * @date 2023-05-15 | 
 |  |  |  */ | 
 |  |  | @Slf4j | 
 |  |  | @Api(description = "钉钉接口") | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/smartor/dingtalk") | 
 |  |  | @RequestMapping("/system/dingtalk") | 
 |  |  | @PropertySource(value = {"classpath:application-druid.yml"}) | 
 |  |  | public class DingTalkController extends BaseController { | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation("发送钉钉消息") | 
 |  |  |     @PostMapping("/sendNotification") | 
 |  |  |     public AjaxResult sendNotification(@RequestBody DingTalkReqVo dingTalkReqVo) { | 
 |  |  |         log.info("发送钉钉消息:{}", dingTalkReqVo); | 
 |  |  |         Boolean aBoolean = dingTalkService.sendNotification(dingTalkReqVo); | 
 |  |  |         if (aBoolean) { | 
 |  |  |             return success(); | 
 |  |  | 
 |  |  |         return error(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 给部门下的用户信息赋dingUserId,并记录到sys_user表中 | 
 |  |  |      * | 
 |  |  |      * @param deptID | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("给部门下的用户信息赋dingUserId") | 
 |  |  |     @GetMapping("/deptidList/{deptID}") | 
 |  |  |     public AjaxResult deptidList(@PathVariable("deptID") Long deptID) { | 
 |  |  |         dingTalkService.deptidList(deptID, 1); | 
 |  |  |         return success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  |