✨Feat: 完成 Lark 简单信息发送
This commit is contained in:
@@ -2,6 +2,8 @@ package com.wonderland.stardewvalley.controller;
|
||||
|
||||
import com.wonderland.stardewvalley.ai.ChatUtil;
|
||||
import com.wonderland.stardewvalley.entity.AIChatRequest;
|
||||
import com.wonderland.stardewvalley.entity.BaseResponse;
|
||||
import com.wonderland.stardewvalley.util.ResultUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -16,7 +18,7 @@ public class ChatController {
|
||||
private ChatUtil chatUtil;
|
||||
|
||||
@PostMapping
|
||||
public String chat(@RequestBody AIChatRequest aiChatRequest) {
|
||||
return chatUtil.doChat(aiChatRequest.getBackGround(), aiChatRequest.getContent());
|
||||
public BaseResponse<String> chat(@RequestBody AIChatRequest aiChatRequest) {
|
||||
return ResultUtil.success(chatUtil.doChat(aiChatRequest.getBackGround(), aiChatRequest.getContent()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.wonderland.stardewvalley.controller;
|
||||
|
||||
import com.wonderland.stardewvalley.entity.BaseResponse;
|
||||
import com.wonderland.stardewvalley.util.ResultUtil;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -9,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping("/ping")
|
||||
public String healthTest() {
|
||||
return "Welcome to Stardew Valley!";
|
||||
public BaseResponse<String> healthTest() {
|
||||
return ResultUtil.success("Welcome to Stardew Valley!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.wonderland.stardewvalley.controller;
|
||||
|
||||
import com.wonderland.stardewvalley.constant.GuideConstant;
|
||||
import com.wonderland.stardewvalley.entity.BaseResponse;
|
||||
import com.wonderland.stardewvalley.lark.LarkUtil;
|
||||
import com.wonderland.stardewvalley.util.ResultUtil;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("lark")
|
||||
public class LarkController {
|
||||
|
||||
@GetMapping("welcome")
|
||||
public BaseResponse<String> welcome() throws Exception {
|
||||
LarkUtil.sendText(GuideConstant.GUIDE);
|
||||
return ResultUtil.success("发送成功");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user