去掉分账

This commit is contained in:
seesaw
2024-09-26 10:40:53 +08:00
parent 101251c777
commit 67fe0b5563
7 changed files with 25 additions and 6 deletions

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
@ -44,11 +45,13 @@ public class FaceController {
@PostMapping("/register")
public CommonResult<String> faceAdd(SaveDto saveDto) {
public CommonResult<Map<String,String>> faceAdd(SaveDto saveDto) {
Map<String,String> result = new HashMap<>();
log.info("添加人脸特征值到数据库");
// 生成雪花id
long nextId = IdUtil.getSnowflake().nextId();
CommonResult<String> httpResult = CommonResult.success("成功");
CommonResult<Map<String,String>> httpResult = new CommonResult<>();
MultipartFile file = saveDto.getFile();
if (file.isEmpty()) {
httpResult.setMsg("文件为空");
@ -70,8 +73,9 @@ public class FaceController {
userById.setUrl(imagePath);
faceService.getBaseMapper().updateById(userById);
}
httpResult.setData(String.valueOf(nextId));
result.put("faceId", String.valueOf(nextId));
result.put("faceUrl", imagePath);
httpResult.setData(result);
return httpResult;
}