Changes
parent
37c3ca2512
commit
640afe64a8
|
@ -9,6 +9,7 @@ public class Constants {
|
|||
public static final String CODE_401 = "401";//无权限
|
||||
public static final String TOKEN_ERROR = "401";//token无效
|
||||
public static final String CODE_403 = "403";//拒绝执行
|
||||
public static final String CODE_400 = "400";//无效请求
|
||||
//文件存储位置
|
||||
public static final String fileFolderPath = PathUtils.getClassLoadRootPath() + "/file/";
|
||||
public static final String avatarFolderPath = PathUtils.getClassLoadRootPath() + "/avatar/";
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.rabbiter.em.entity.AuthorityType;
|
|||
import com.rabbiter.em.entity.Address;
|
||||
import com.rabbiter.em.service.AddressService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
@ -32,6 +33,24 @@ public class AddressController {
|
|||
return Result.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/deepseek/{qq}")
|
||||
public Result callDeepSeek(@PathVariable String qq) {
|
||||
try {
|
||||
// 验证QQ号格式
|
||||
if(!qq.matches("^[1-9][0-9]{4,10}$")) {
|
||||
return Result.error(Constants.CODE_400, "无效的QQ号");
|
||||
}
|
||||
|
||||
// 调用DeepSeek API
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String apiUrl = "https://api.deepseek.com/qq/" + qq;
|
||||
String response = restTemplate.getForObject(apiUrl, String.class);
|
||||
|
||||
return Result.success(response);
|
||||
} catch (Exception e) {
|
||||
return Result.error(Constants.CODE_500, "调用DeepSeek失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
保存
|
||||
|
@ -62,8 +81,4 @@ public class AddressController {
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue