feat(API): 修改文章ID类型为String并添加CORS配置

将文章ID从Integer类型改为String类型以支持更灵活的ID格式
添加CORS配置类解决跨域问题,允许所有来源访问API
This commit is contained in:
qingfeng1121
2025-10-11 13:32:41 +08:00
parent 470cf71713
commit 299c9a57ec
6 changed files with 996 additions and 5 deletions

View File

@@ -30,9 +30,8 @@ public class ArticleController {
* @return 返回包含文章信息的ResponseMessage对象
*/
@GetMapping("/{id}")
public ResponseMessage<Article> getArticle(@PathVariable Integer id) {
public ResponseMessage<Article> getArticle(@PathVariable String id) {
return articleService.getArticleById(id);
}
/**