feat(user): 新增用户注册、登录和删除功能
- 新增用户实体类和相关控制器、服务类 - 实现用户注册、登录和删除功能 - 添加用户token生成和验证逻辑 -优化密码存储,使用加密算法
This commit is contained in:
@@ -2,10 +2,14 @@ package com.test.bijihoudaun.controller;
|
||||
|
||||
import com.test.bijihoudaun.entity.MarkdownFile;
|
||||
import com.test.bijihoudaun.service.MarkdownFileService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "markdown接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/markdown")
|
||||
public class MarkdownController {
|
||||
@@ -13,6 +17,13 @@ public class MarkdownController {
|
||||
@Autowired
|
||||
private MarkdownFileService markdownFileService;
|
||||
|
||||
@Operation(summary = "创建markdown文件")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户id",required = true),
|
||||
@Parameter(name = "title", description = "标题",required = true),
|
||||
@Parameter(name = "fileName", description = "文件名",required = true),
|
||||
@Parameter(name = "content", description = "内容",required = true)
|
||||
})
|
||||
@PostMapping
|
||||
public ResponseEntity<MarkdownFile> createMarkdown(
|
||||
@RequestParam Integer userId,
|
||||
@@ -26,7 +37,12 @@ public class MarkdownController {
|
||||
return ResponseEntity.ok(file);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@Operation(summary = "更新Markdown文件")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "Markdown文件ID", required = true),
|
||||
@Parameter(name = "content", description = "Markdown文件内容", required = true)
|
||||
})
|
||||
@PostMapping("/{id}")
|
||||
public ResponseEntity<MarkdownFile> updateMarkdown(
|
||||
@PathVariable Integer id,
|
||||
@RequestBody String content) {
|
||||
|
||||
Reference in New Issue
Block a user