feat(REQ-3114) - 新增创建待办的 API

This commit is contained in:
wangli 2024-10-31 13:33:36 +08:00
parent d309634b59
commit ada9f09839
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,11 @@ public class ThirdCreateTodoReq {
*/ */
private String clientId; private String clientId;
/**
* 机器人 code
*/
private String robotCode;
/** /**
* 待办的创建人 * 待办的创建人
*/ */

View File

@ -15,6 +15,7 @@ import com.dingtalk.open.app.api.models.bot.MentionUser;
import com.dingtalk.open.app.api.models.bot.MessageContent; import com.dingtalk.open.app.api.models.bot.MessageContent;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -124,7 +125,7 @@ public class DingtalkController {
MessageContent text = new MessageContent(); MessageContent text = new MessageContent();
text.setContent(req.toCommandStr()); text.setContent(req.toCommandStr());
messageWrapper.setText(text); messageWrapper.setText(text);
messageWrapper.setRobotCode("dingx9pejjkh8whnaqkw"); messageWrapper.setRobotCode(StringUtils.hasText(req.getRobotCode())? req.getRobotCode() : req.getClientId());
robotMsgCallbackConsumer.execute(messageWrapper); robotMsgCallbackConsumer.execute(messageWrapper);
return CommonResponse.success(true); return CommonResponse.success(true);
} }