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GYFJBAGTICJVDYJLGIBMJAAUFIJNIEERJOIMDCFAANCEEXHBBBGNESJKCMDYDBGOBCBVEDAFCBIQAKHVHUIUEOHVBPCJIRDGIFCQBWAFACELFSGYEMENEUITANIAIMBLBAAQGCHOGFDSENIFEWFVEYHZIVEUGXAXGCHSCXEOALHQGPCYDIBRHYHCEFAFHNAMCVHBBUFPJMHPDXIHBXGXJPFRCHBPGPFWABCKIEHOIZFLJECTERFOHAHZGXGLIJAAFBCRDCGOFPBCIGJPBXJMEYGQDVAXHMJGBIIOCLDYJQHNJMECBK
|
|
@ -10,5 +10,7 @@ RBAC——基于角色权限的模型
|
||||||
要做全控制
|
要做全控制
|
||||||
表单 按钮 视图
|
表单 按钮 视图
|
||||||
|
|
||||||
|
merge和rebase
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,11 @@ public class SecurityConstants {
|
||||||
* 这些路径可以直接访问,不需要认证
|
* 这些路径可以直接访问,不需要认证
|
||||||
*/
|
*/
|
||||||
public static final List<String> WHITE_LIST = List.of(
|
public static final List<String> WHITE_LIST = List.of(
|
||||||
|
"/faceTest","/compareFaces",
|
||||||
|
"/minio/**",
|
||||||
"/exam/api/paper/**",
|
"/exam/api/paper/**",
|
||||||
"/bs/**",
|
"/bs/user/login",
|
||||||
|
"/bs/user/register",
|
||||||
"/api/common/**", //公共接口
|
"/api/common/**", //公共接口
|
||||||
"/demo/**", // 测试接口
|
"/demo/**", // 测试接口
|
||||||
"/api/products",
|
"/api/products",
|
||||||
|
|
|
@ -32,14 +32,13 @@ public class BSUserController {
|
||||||
public Result<UserDTO> register(@RequestBody @Valid BSRegisterDTO request) {
|
public Result<UserDTO> register(@RequestBody @Valid BSRegisterDTO request) {
|
||||||
try {
|
try {
|
||||||
log.info("用户注册: {}", request);
|
log.info("用户注册: {}", request);
|
||||||
// return Result.success("注册成功", userService.register(request));
|
return Result.success("注册成功", userService.register(request));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// return Result.validateFailed(e.getMessage());
|
return Result.validateFailed(e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("注册失败", e);
|
log.error("注册失败", e);
|
||||||
// return Result.error("系统错误");
|
return Result.error("系统错误");
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
|
|
|
@ -557,6 +557,14 @@ public class CommonController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/sendCode")
|
||||||
|
public void sendCode(@RequestParam String code){
|
||||||
|
|
||||||
|
System.out.println("code = " + code);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/*
|
|
||||||
package com.guwan.backend.controller;
|
package com.guwan.backend.controller;
|
||||||
|
|
||||||
import com.github.dockerjava.api.DockerClient;
|
import com.github.dockerjava.api.DockerClient;
|
||||||
|
@ -7,10 +6,13 @@ import com.github.dockerjava.api.command.ExecCreateCmdResponse;
|
||||||
import com.github.dockerjava.core.DockerClientBuilder;
|
import com.github.dockerjava.core.DockerClientBuilder;
|
||||||
import com.github.dockerjava.core.command.ExecStartResultCallback;
|
import com.github.dockerjava.core.command.ExecStartResultCallback;
|
||||||
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
|
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.net.URI;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class DockerCppRunner {
|
public class DockerCppRunner {
|
||||||
|
|
||||||
private static final String IMAGE_NAME = "cpp-runner";
|
private static final String IMAGE_NAME = "cpp-runner";
|
||||||
|
@ -22,7 +24,7 @@ public class DockerCppRunner {
|
||||||
DockerClient dockerClient = DockerClientBuilder.getInstance()
|
DockerClient dockerClient = DockerClientBuilder.getInstance()
|
||||||
.withDockerHttpClient(
|
.withDockerHttpClient(
|
||||||
new ApacheDockerHttpClient.Builder()
|
new ApacheDockerHttpClient.Builder()
|
||||||
.dockerHost(DockerClientBuilder.getDefaultDockerHost())
|
.dockerHost(URI.create("tcp://localhost:2375"))
|
||||||
.build()
|
.build()
|
||||||
).build();
|
).build();
|
||||||
|
|
||||||
|
@ -76,4 +78,4 @@ public class DockerCppRunner {
|
||||||
|
|
||||||
return outputStream.toString().trim();
|
return outputStream.toString().trim();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,26 @@
|
||||||
|
package com.guwan.backend.controller;
|
||||||
|
|
||||||
|
import com.guwan.backend.common.Result;
|
||||||
|
import com.guwan.backend.util.MinioUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/minio")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MinioController {
|
||||||
|
|
||||||
|
private final MinioUtil minioUtil;
|
||||||
|
|
||||||
|
@PostMapping("/uploadBase64Image")
|
||||||
|
public Result uploadBase64Image(@RequestParam String bucketName,
|
||||||
|
@RequestParam String base64Image,
|
||||||
|
@RequestParam String folder){
|
||||||
|
String fileName = minioUtil.uploadBase64Image(bucketName, base64Image, folder);
|
||||||
|
return Result.success(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.guwan.backend.controller;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/setAuthentication")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SetController {
|
||||||
|
@GetMapping
|
||||||
|
public void setAuthentication(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*
|
||||||
package com.guwan.backend.controller;
|
package com.guwan.backend.controller;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
@ -158,4 +159,4 @@ public class UserController {
|
||||||
return Result.error(e.getMessage());
|
return Result.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
|
@ -9,7 +9,9 @@ public class Base64Util {
|
||||||
if (!ObjectUtils.isEmpty(base64Str)) {
|
if (!ObjectUtils.isEmpty(base64Str)) {
|
||||||
String photoBase64 = base64Str.substring(0, 30).toLowerCase();
|
String photoBase64 = base64Str.substring(0, 30).toLowerCase();
|
||||||
int indexOf = photoBase64.indexOf("base64,");
|
int indexOf = photoBase64.indexOf("base64,");
|
||||||
if (indexOf > 0) {
|
if (indexOf >= 0) {
|
||||||
|
//包括起始下标 beginIndex
|
||||||
|
//不包括结束下标 endIndex
|
||||||
base64Str = base64Str.substring(indexOf + 7);
|
base64Str = base64Str.substring(indexOf + 7);
|
||||||
}
|
}
|
||||||
base64Str = base64Str.replaceAll(" ", "+");
|
base64Str = base64Str.replaceAll(" ", "+");
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.guwan.backend.model.exam.controller;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.guwan.backend.common.Result;
|
import com.guwan.backend.common.Result;
|
||||||
|
import com.guwan.backend.controller.BaseExamController;
|
||||||
import com.guwan.backend.core.api.ApiRest;
|
import com.guwan.backend.core.api.ApiRest;
|
||||||
import com.guwan.backend.core.api.controller.BaseController;
|
import com.guwan.backend.core.api.controller.BaseController;
|
||||||
import com.guwan.backend.core.api.dto.BaseIdReqDTO;
|
import com.guwan.backend.core.api.dto.BaseIdReqDTO;
|
||||||
|
@ -19,12 +20,18 @@ import com.guwan.backend.model.exam.entity.Exam;
|
||||||
import com.guwan.backend.model.exam.service.ExamService;
|
import com.guwan.backend.model.exam.service.ExamService;
|
||||||
|
|
||||||
|
|
||||||
|
import com.guwan.backend.pojo.entity.BaseExam;
|
||||||
|
import com.guwan.backend.service.BaseExamService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
//import org.apache.shiro.authz.annotation.RequiresRoles;
|
//import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -40,11 +47,13 @@ import java.util.List;
|
||||||
@Api(tags={"考试"})
|
@Api(tags={"考试"})
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/common/exam")
|
@RequestMapping("/api/common/exam")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class ExamController extends BaseController {
|
public class ExamController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ExamService examService;
|
|
||||||
|
|
||||||
|
private final ExamService examService;
|
||||||
|
|
||||||
|
private final BaseExamService baseExamService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查找
|
* 分页查找
|
||||||
|
@ -71,15 +80,27 @@ public class ExamController extends BaseController {
|
||||||
|
|
||||||
@GetMapping("/exam")
|
@GetMapping("/exam")
|
||||||
public Result getExam() {
|
public Result getExam() {
|
||||||
|
|
||||||
|
|
||||||
|
BaseExam baseExam = baseExamService.getById(1);
|
||||||
|
|
||||||
// 模拟数据,可以从数据库中查询
|
// 模拟数据,可以从数据库中查询
|
||||||
ExamResponseDTO response = new ExamResponseDTO();
|
ExamResponseDTO response = new ExamResponseDTO();
|
||||||
response.setId("1");
|
response.setTitle(baseExam.getTitle());
|
||||||
response.setTitle("模拟考试试卷 (含新题型)");
|
response.setTotalScore(baseExam.getTotalScore());
|
||||||
response.setTotalScore(100);
|
response.setTotalTime(baseExam.getTotalTime());
|
||||||
response.setTotalTime(120);
|
//response.setLeftSeconds(7180);
|
||||||
response.setLeftSeconds(7180);
|
|
||||||
response.setExamStartTime("2025-04-17 00:10:24");
|
|
||||||
response.setExamDuration(60 * 60 * 2);
|
LocalDateTime localDateTime = baseExam.getStartTime().toInstant()
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDateTime();
|
||||||
|
|
||||||
|
// 格式化
|
||||||
|
String formatted = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|
||||||
|
response.setExamStartTime(formatted);
|
||||||
|
|
||||||
|
|
||||||
// 填充题数据
|
// 填充题数据
|
||||||
List<QuestionDTO> fillList = new ArrayList<>();
|
List<QuestionDTO> fillList = new ArrayList<>();
|
||||||
|
|
|
@ -10,14 +10,11 @@ import java.util.List;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ExamResponseDTO {
|
public class ExamResponseDTO {
|
||||||
|
|
||||||
private String id;
|
|
||||||
private String title;
|
private String title;
|
||||||
private int totalScore;
|
private int totalScore;
|
||||||
private int totalTime;
|
private int totalTime;
|
||||||
private int leftSeconds;
|
private int leftSeconds;
|
||||||
private String examStartTime; // 这里用字符串格式而不是标准时间
|
private String examStartTime; // 这里用字符串格式而不是标准时间
|
||||||
private int examDuration;
|
|
||||||
private List<QuestionDTO> fillList;
|
private List<QuestionDTO> fillList;
|
||||||
private List<QuestionDTO> judgeList;
|
private List<QuestionDTO> judgeList;
|
||||||
private List<QuestionDTO> radioList;
|
private List<QuestionDTO> radioList;
|
||||||
|
|
|
@ -9,7 +9,10 @@ import lombok.Data;
|
||||||
public class BSRegisterDTO {
|
public class BSRegisterDTO {
|
||||||
@NotBlank(message = "用户名不能为空")
|
@NotBlank(message = "用户名不能为空")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@NotBlank(message = "密码不能为空")
|
@NotBlank(message = "密码不能为空")
|
||||||
private String password;
|
private String password;
|
||||||
|
@Email(message = "邮箱格式不正确")
|
||||||
|
private String email;
|
||||||
|
@NotBlank(message = "邮箱验证码不能为空")
|
||||||
|
private String emailCode;
|
||||||
}
|
}
|
|
@ -22,10 +22,10 @@ public class RegisterDTO {
|
||||||
@NotBlank(message = "邮箱验证码不能为空")
|
@NotBlank(message = "邮箱验证码不能为空")
|
||||||
private String emailCode;
|
private String emailCode;
|
||||||
|
|
||||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
/* @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@NotBlank(message = "手机验证码不能为空")
|
@NotBlank(message = "手机验证码不能为空")
|
||||||
private String phoneCode;
|
private String phoneCode;*/
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,9 +1,6 @@
|
||||||
package com.guwan.backend.service;
|
package com.guwan.backend.service;
|
||||||
|
|
||||||
import com.guwan.backend.pojo.dto.user.ChangePasswordDTO;
|
import com.guwan.backend.pojo.dto.user.*;
|
||||||
import com.guwan.backend.pojo.dto.user.LoginDto;
|
|
||||||
import com.guwan.backend.pojo.dto.user.RegisterDTO;
|
|
||||||
import com.guwan.backend.pojo.dto.user.UserDTO;
|
|
||||||
|
|
||||||
public interface UserService {
|
public interface UserService {
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +8,7 @@ public interface UserService {
|
||||||
* @param registerDTO
|
* @param registerDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
UserDTO register(RegisterDTO registerDTO);
|
UserDTO register(BSRegisterDTO registerDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录
|
* 登录
|
||||||
|
|
|
@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.guwan.backend.annotation.OperationLog;
|
import com.guwan.backend.annotation.OperationLog;
|
||||||
import com.guwan.backend.common.BusinessException;
|
import com.guwan.backend.common.BusinessException;
|
||||||
import com.guwan.backend.pojo.dto.user.ChangePasswordDTO;
|
import com.guwan.backend.pojo.dto.user.*;
|
||||||
import com.guwan.backend.pojo.dto.user.LoginDto;
|
|
||||||
import com.guwan.backend.pojo.dto.user.RegisterDTO;
|
|
||||||
import com.guwan.backend.pojo.dto.user.UserDTO;
|
|
||||||
import com.guwan.backend.pojo.entity.User;
|
import com.guwan.backend.pojo.entity.User;
|
||||||
import com.guwan.backend.pojo.enums.UserEnums;
|
import com.guwan.backend.pojo.enums.UserEnums;
|
||||||
import com.guwan.backend.mapper.UserMapper;
|
import com.guwan.backend.mapper.UserMapper;
|
||||||
|
@ -49,7 +46,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@OperationLog(description = "用户注册", operationType = "注册")
|
@OperationLog(description = "用户注册", operationType = "注册")
|
||||||
public UserDTO register(RegisterDTO request) {
|
public UserDTO register(BSRegisterDTO request) {
|
||||||
// 检查用户名是否已存在
|
// 检查用户名是否已存在
|
||||||
if (findByUsername(request.getUsername()) != null) {
|
if (findByUsername(request.getUsername()) != null) {
|
||||||
throw new IllegalArgumentException("用户名已存在");
|
throw new IllegalArgumentException("用户名已存在");
|
||||||
|
@ -60,11 +57,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
throw new IllegalArgumentException("邮箱已被注册");
|
throw new IllegalArgumentException("邮箱已被注册");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查手机号是否已存在
|
|
||||||
if (findByPhone(request.getPhone()) != null) {
|
|
||||||
throw new IllegalArgumentException("手机号已被注册");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验邮箱验证码
|
// 校验邮箱验证码
|
||||||
String redisEmailCode = (String) redisUtil.get(request.getEmail());
|
String redisEmailCode = (String) redisUtil.get(request.getEmail());
|
||||||
|
|
||||||
|
@ -72,25 +64,25 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
throw new IllegalArgumentException("邮箱验证码错误");
|
throw new IllegalArgumentException("邮箱验证码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验手机号验证码
|
/* // 校验手机号验证码
|
||||||
String redisPhoneCode = (String) redisUtil.get(request.getPhone());
|
String redisPhoneCode = (String) redisUtil.get(request.getPhone());
|
||||||
|
|
||||||
if (!request.getPhoneCode().equals(redisPhoneCode)) {
|
if (!request.getPhoneCode().equals(redisPhoneCode)) {
|
||||||
throw new IllegalArgumentException("手机验证码错误");
|
throw new IllegalArgumentException("手机验证码错误");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
User user = new User();
|
User user = new User();
|
||||||
|
|
||||||
BeanUtils.copyProperties(request, user);
|
BeanUtils.copyProperties(request, user);
|
||||||
user.setPassword(passwordEncoder.encode(request.getPassword()));
|
user.setPassword(passwordEncoder.encode(request.getPassword()));
|
||||||
user.setPhone(request.getPhone());
|
//user.setPhone();
|
||||||
user.setEmail(request.getEmail());
|
user.setEmail(request.getEmail());
|
||||||
user.setStatus(1);
|
user.setStatus(1);
|
||||||
|
|
||||||
userMapper.insert(user);
|
userMapper.insert(user);
|
||||||
|
|
||||||
redisUtil.del(request.getEmail());
|
redisUtil.del(request.getEmail());
|
||||||
redisUtil.del(request.getPhone());
|
// redisUtil.del(request.getPhone());
|
||||||
|
|
||||||
return convertToDTO(user);
|
return convertToDTO(user);
|
||||||
}
|
}
|
||||||
|
@ -99,6 +91,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
@OperationLog(description = "用户登录", operationType = "登录")
|
@OperationLog(description = "用户登录", operationType = "登录")
|
||||||
public UserDTO login(LoginDto request) {
|
public UserDTO login(LoginDto request) {
|
||||||
User user = null;
|
User user = null;
|
||||||
|
|
||||||
System.out.println("request = " + request);
|
System.out.println("request = " + request);
|
||||||
|
|
||||||
if (request.getActiveTab().equals("account")) {
|
if (request.getActiveTab().equals("account")) {
|
||||||
|
@ -139,7 +132,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
throw new IllegalArgumentException("账号已被禁用");
|
throw new IllegalArgumentException("账号已被禁用");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 更新最后登录时间
|
// 更新最后登录时间
|
||||||
user.setLastLoginTime(LocalDateTime.now());
|
user.setLastLoginTime(LocalDateTime.now());
|
||||||
userMapper.updateById(user);
|
userMapper.updateById(user);
|
||||||
|
|
|
@ -204,8 +204,6 @@ public class MinioUtil {
|
||||||
// 使用 byte[] 创建 InputStream
|
// 使用 byte[] 创建 InputStream
|
||||||
InputStream byteArrayInputStream = new ByteArrayInputStream(data);
|
InputStream byteArrayInputStream = new ByteArrayInputStream(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
minioClient.putObject(
|
minioClient.putObject(
|
||||||
PutObjectArgs.builder()
|
PutObjectArgs.builder()
|
||||||
|
|
|
@ -126,10 +126,10 @@ springdoc:
|
||||||
config:
|
config:
|
||||||
arcface-sdk:
|
arcface-sdk:
|
||||||
version: 4.1
|
version: 4.1
|
||||||
app-id: 5nPWymNAibvWTq6XPypUWxroyzjMScZ9RwVkDjCFgK32
|
app-id: 2R54v3QUQ8uTynQr6ioF8wWHeqXJuJBv1VqhcWpj2Jmd
|
||||||
sdk-key: 7dsPvanADtYAP1TiiiFjTsms2mAU85m5duVwHChhumyV
|
sdk-key: 6m5KtW1EV6x9hrnUGSiM1kQF2DXLf3hkRwqBKbvLyHFB
|
||||||
active-key: 86C1-11T1-K131-FJQU
|
active-key: 86L1-11WX-R13T-CHZ6
|
||||||
active-file: 86C111T1K131FJQU.dat
|
active-file:
|
||||||
detect-pool-size: 16
|
detect-pool-size: 16
|
||||||
compare-pool-size: 16
|
compare-pool-size: 16
|
||||||
rec-face-thd: 0.8
|
rec-face-thd: 0.8
|
||||||
|
|
Loading…
Reference in New Issue