招聘部分功能完善
This commit is contained in:
parent
5c986ff1ef
commit
d5d82ee380
|
@ -22,6 +22,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
.excludePathPatterns("/admin/login")
|
.excludePathPatterns("/admin/login")
|
||||||
// 添加swagger-ui的放行路径
|
// 添加swagger-ui的放行路径
|
||||||
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**","/doc.html/**")
|
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**","/doc.html/**")
|
||||||
|
.excludePathPatterns("/upload/**")
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -143,13 +143,14 @@ public class InterviewController {
|
||||||
String name=(String)addInfo.get("name");
|
String name=(String)addInfo.get("name");
|
||||||
String encoding=(String)addInfo.get("encoding");
|
String encoding=(String)addInfo.get("encoding");
|
||||||
String image=(String)addInfo.get("image");
|
String image=(String)addInfo.get("image");
|
||||||
|
String video=(String)addInfo.get("video");
|
||||||
Integer userId=(Integer) addInfo.get("userId");
|
Integer userId=(Integer) addInfo.get("userId");
|
||||||
String filename=(String) addInfo.get("filename");
|
String filename=(String) addInfo.get("filename");
|
||||||
if(filename.equals("")){
|
if(filename.equals("")){
|
||||||
return R.error("请添加图片!");
|
return R.error("请添加图片!");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer row = imagesService.addImageLogo(name, encoding, image, userId,filename);
|
Integer row = imagesService.addImageLogo(name,encoding,image,video,userId,filename);
|
||||||
|
|
||||||
if(row!=1){
|
if(row!=1){
|
||||||
return R.error("添加失败!");
|
return R.error("添加失败!");
|
||||||
|
|
|
@ -271,4 +271,34 @@ public class RecruitmentController {
|
||||||
return R.success(companyDetail);
|
return R.success(companyDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update_companyDetail")
|
||||||
|
public R UpdateCompanyDetail(@RequestBody Map<String,Object> updateInfo){
|
||||||
|
|
||||||
|
List<String> address=(List<String>) updateInfo.get("address");
|
||||||
|
|
||||||
|
String addressDetail=(String) updateInfo.get("addressDetail");
|
||||||
|
String companyDetail=(String) updateInfo.get("companyDetail");
|
||||||
|
String companyName=(String) updateInfo.get("companyName");
|
||||||
|
String creditCode=(String) updateInfo.get("creditCode");
|
||||||
|
String encoding=(String) updateInfo.get("encoding");
|
||||||
|
String established=(String) updateInfo.get("established");
|
||||||
|
String images=(String) updateInfo.get("images");
|
||||||
|
String legalRepresentative=(String) updateInfo.get("legalRepresentative");
|
||||||
|
String treatment=(String)updateInfo.get("treatment");
|
||||||
|
String registeredCapital=(String) updateInfo.get("registeredCapital");
|
||||||
|
Integer userId=(Integer) updateInfo.get("userId");
|
||||||
|
Integer row = companyService.updateCompanyDetail(address.toString(), addressDetail,
|
||||||
|
companyDetail, companyName,
|
||||||
|
creditCode, encoding, established,
|
||||||
|
images, legalRepresentative,
|
||||||
|
treatment, registeredCapital, userId
|
||||||
|
);
|
||||||
|
if (row==-1){
|
||||||
|
return R.error("更新失败");
|
||||||
|
}
|
||||||
|
return R.success("更新成功");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,13 @@ package com.yzdx.AiInterviewer.controller;
|
||||||
import com.yzdx.AiInterviewer.comment.R;
|
import com.yzdx.AiInterviewer.comment.R;
|
||||||
import com.yzdx.AiInterviewer.utiles.ParseResumeUtil;
|
import com.yzdx.AiInterviewer.utiles.ParseResumeUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -25,9 +24,6 @@ public class UploadController {
|
||||||
|
|
||||||
//设置上传文件的最大大小
|
//设置上传文件的最大大小
|
||||||
public static final int MAX_SIZE=10*1024*1024;
|
public static final int MAX_SIZE=10*1024*1024;
|
||||||
public static final String UPLOAD_AVATAR_PATH = "D:\\vueStudy\\Ai-interviewer-ui\\src\\upload\\picture";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
|
||||||
public static final String UPLOAD_RESUME_PATH = "D:\\vueStudy\\Ai-interviewer-ui\\src\\upload\\resume";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
|
||||||
|
|
||||||
//设置文件的类型
|
//设置文件的类型
|
||||||
public static final List<String> AVATAR_TYPE=new ArrayList<>();
|
public static final List<String> AVATAR_TYPE=new ArrayList<>();
|
||||||
|
|
||||||
|
@ -39,8 +35,8 @@ public class UploadController {
|
||||||
AVATAR_TYPE.add("image/jpeg");
|
AVATAR_TYPE.add("image/jpeg");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/upload_companyImage")
|
@PostMapping("/upload_picture")
|
||||||
public R upLoadPicture(HttpSession session, @RequestParam("file") MultipartFile file ,String encoding){
|
public R upLoadPicture(HttpServletRequest request, @RequestParam("file") MultipartFile file){
|
||||||
|
|
||||||
|
|
||||||
//MultipartFile是spring提供的类,可以接收所有的文件的类
|
//MultipartFile是spring提供的类,可以接收所有的文件的类
|
||||||
|
@ -58,12 +54,14 @@ public class UploadController {
|
||||||
return R.error("文件类型不匹配");
|
return R.error("文件类型不匹配");
|
||||||
}
|
}
|
||||||
|
|
||||||
// String uploadPath = session.getServletContext().getRealPath("upload");//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/picture/");//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
||||||
// String uploadPath = "D:\\vue学习\\Ai-interviewer-ui\\src\\upload";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
// String uploadPath = "D:\\vue学习\\Ai-interviewer-ui\\src\\upload";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
||||||
//
|
//
|
||||||
// log.info(uploadPath);
|
log.info(uploadPath);
|
||||||
|
|
||||||
File dir=new File(UPLOAD_AVATAR_PATH);//指向名为‘upload’文件夹
|
//指向名为‘upload’文件夹
|
||||||
|
|
||||||
|
File dir= new File(uploadPath);
|
||||||
|
|
||||||
if(!dir.exists()){
|
if(!dir.exists()){
|
||||||
dir.mkdirs();//若不存在,则创建该文件夹
|
dir.mkdirs();//若不存在,则创建该文件夹
|
||||||
|
@ -88,21 +86,73 @@ public class UploadController {
|
||||||
return R.error("文件存储出现异常");
|
return R.error("文件存储出现异常");
|
||||||
|
|
||||||
}
|
}
|
||||||
String RealFilePath="http://localhost:5173/src/upload/picture/"+filename;
|
String RealFilePath="http://localhost:8080/upload/picture/"+filename;
|
||||||
Map<String,Object> data=new HashMap<>();
|
Map<String,Object> data=new HashMap<>();
|
||||||
data.put("image",RealFilePath);
|
data.put("image",RealFilePath);
|
||||||
data.put("filename",filename);
|
data.put("filename",filename);
|
||||||
return R.success(data);//返回图片存储在服务器的地址
|
return R.success(data);//返回图片存储在服务器的地址
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upload_video")
|
||||||
|
public R upLoadVideo(HttpServletRequest request, @RequestParam("file") MultipartFile file ){
|
||||||
|
|
||||||
|
|
||||||
|
//MultipartFile是spring提供的类,可以接收所有的文件的类
|
||||||
|
|
||||||
|
log.info(file.getContentType());
|
||||||
|
|
||||||
|
if(file.isEmpty()){
|
||||||
|
return R.error("请选择文件");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.getSize() >MAX_SIZE){//file.getSize()获取接收文件的大小
|
||||||
|
return R.error("文件大小超出最大限制");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/video/");//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
||||||
|
|
||||||
|
|
||||||
|
File dir= new File(uploadPath);//指向名为‘upload’文件夹
|
||||||
|
|
||||||
|
if(!dir.exists()){
|
||||||
|
dir.mkdirs();//若不存在,则创建该文件夹
|
||||||
|
}
|
||||||
|
|
||||||
|
String originalFilename = file.getOriginalFilename();//获取文件的真实文件名
|
||||||
|
|
||||||
|
int index = originalFilename.lastIndexOf(".");//获取文件的后缀名‘.’的位置
|
||||||
|
|
||||||
|
String substring = originalFilename.substring(index);//返回文件类型名 例如:.jpg
|
||||||
|
|
||||||
|
String filename = UUID.randomUUID().toString().toUpperCase()+substring;//新创建的文件名
|
||||||
|
|
||||||
|
File dest=new File(dir,filename);//创建一个空的文件
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
file.transferTo(dest);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
return R.error("文件存储出现异常");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String RealFilePath="http://localhost:8080/upload/video/"+filename;
|
||||||
|
Map<String,Object> data=new HashMap<>();
|
||||||
|
data.put("video",RealFilePath);
|
||||||
|
data.put("filename",filename);
|
||||||
|
return R.success(data);//返回图片存储在服务器的地址
|
||||||
|
}
|
||||||
@GetMapping("/delete_picture")
|
@GetMapping("/delete_picture")
|
||||||
public R deletePicture(String imagePath){
|
public R deletePicture(HttpServletRequest request,String imagePath){
|
||||||
if(imagePath==null||imagePath.equals("")){
|
if(imagePath==null||imagePath.equals("")){
|
||||||
return R.error("删除失败!");
|
return R.error("删除失败!");
|
||||||
}
|
}
|
||||||
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/picture/");
|
||||||
try {
|
try {
|
||||||
File folder = new File(UPLOAD_AVATAR_PATH);
|
File folder = new File(uploadPath);
|
||||||
File[] files = folder.listFiles();
|
File[] files = folder.listFiles();
|
||||||
for(File file:files){
|
for(File file:files){
|
||||||
if(file.getName().equals(imagePath)){
|
if(file.getName().equals(imagePath)){
|
||||||
|
@ -115,10 +165,31 @@ public class UploadController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@GetMapping("/delete_video")
|
||||||
|
public R deleteVideo(HttpServletRequest request,String videoPath){
|
||||||
|
if(videoPath==null||videoPath.equals("")){
|
||||||
|
return R.error("删除失败!");
|
||||||
|
}
|
||||||
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/picture/");
|
||||||
|
try {
|
||||||
|
File folder = new File(uploadPath);
|
||||||
|
File[] files = folder.listFiles();
|
||||||
|
for(File file:files){
|
||||||
|
if(file.getName().equals(videoPath)){
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.success("删除成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/upload_resume")
|
@PostMapping("/upload_resume")
|
||||||
public R uploadResume(HttpSession session, @RequestParam("file") MultipartFile file){
|
public R uploadResume(HttpServletRequest request, @RequestParam("file") MultipartFile file){
|
||||||
if(file.isEmpty()){
|
if(file.isEmpty()){
|
||||||
return R.error("请选择文件");
|
return R.error("请选择文件");
|
||||||
}
|
}
|
||||||
|
@ -127,12 +198,9 @@ public class UploadController {
|
||||||
return R.error("文件大小超出最大限制");
|
return R.error("文件大小超出最大限制");
|
||||||
}
|
}
|
||||||
|
|
||||||
// String uploadPath = session.getServletContext().getRealPath("upload");//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/resume/");
|
||||||
// String uploadPath = "D:\\vue学习\\Ai-interviewer-ui\\src\\upload";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
|
||||||
//
|
|
||||||
// log.info(uploadPath);
|
|
||||||
|
|
||||||
File dir=new File(UPLOAD_RESUME_PATH);//指向名为‘upload’文件夹
|
File dir= new File(uploadPath);
|
||||||
|
|
||||||
if(!dir.exists()){
|
if(!dir.exists()){
|
||||||
dir.mkdirs();//若不存在,则创建该文件夹
|
dir.mkdirs();//若不存在,则创建该文件夹
|
||||||
|
@ -157,12 +225,13 @@ public class UploadController {
|
||||||
return R.error("文件存储出现异常");
|
return R.error("文件存储出现异常");
|
||||||
|
|
||||||
}
|
}
|
||||||
String RealFilePath="http://localhost:5173/src/upload/resume/"+fileName;
|
String RealFilePath="http://localhost:8080/upload/resume/"+fileName;
|
||||||
ExecutorService pool= Executors.newCachedThreadPool();
|
ExecutorService pool= Executors.newCachedThreadPool();
|
||||||
pool.submit(new Runnable() {
|
pool.submit(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
ParseResumeUtil.ParseChineseResume(UPLOAD_RESUME_PATH+"\\"+fileName);
|
|
||||||
|
ParseResumeUtil.ParseChineseResume( request.getSession().getServletContext().getRealPath("/upload/resume/")+"\\"+fileName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -178,13 +247,14 @@ public class UploadController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/delete_resume")
|
@GetMapping("/delete_resume")
|
||||||
public R deleteResume(String resumePath){
|
public R deleteResume(HttpServletRequest request,String resumePath){
|
||||||
if(resumePath==null||resumePath.equals("")){
|
if(resumePath==null||resumePath.equals("")){
|
||||||
return R.error("删除失败!");
|
return R.error("删除失败!");
|
||||||
}
|
}
|
||||||
|
String uploadPath = request.getSession().getServletContext().getRealPath("/upload/resume/");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
File folder = new File(UPLOAD_AVATAR_PATH);
|
File folder = new File(uploadPath);
|
||||||
File[] files = folder.listFiles();
|
File[] files = folder.listFiles();
|
||||||
for(File file:files){
|
for(File file:files){
|
||||||
if(file.getName().equals(resumePath)){
|
if(file.getName().equals(resumePath)){
|
||||||
|
@ -200,62 +270,6 @@ public class UploadController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/upload_picture")
|
|
||||||
public R uploadCompanyImage(HttpSession session, @RequestParam("file") MultipartFile file){
|
|
||||||
//MultipartFile是spring提供的类,可以接收所有的文件的类
|
|
||||||
|
|
||||||
log.info(file.getContentType());
|
|
||||||
|
|
||||||
if(file.isEmpty()){
|
|
||||||
return R.error("请选择文件");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file.getSize() >MAX_SIZE){//file.getSize()获取接收文件的大小
|
|
||||||
return R.error("文件大小超出最大限制");
|
|
||||||
}
|
|
||||||
if(!AVATAR_TYPE.contains(file.getContentType())){//自定义接收文件的类型
|
|
||||||
return R.error("文件类型不匹配");
|
|
||||||
}
|
|
||||||
|
|
||||||
// String uploadPath = session.getServletContext().getRealPath("upload");//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
|
||||||
// String uploadPath = "D:\\vue学习\\Ai-interviewer-ui\\src\\upload";//获取上传文件的路径(获取项目中名为‘upload’的文件夹)
|
|
||||||
//
|
|
||||||
// log.info(uploadPath);
|
|
||||||
|
|
||||||
File dir=new File(UPLOAD_AVATAR_PATH);//指向名为‘upload’文件夹
|
|
||||||
|
|
||||||
if(!dir.exists()){
|
|
||||||
dir.mkdirs();//若不存在,则创建该文件夹
|
|
||||||
}
|
|
||||||
|
|
||||||
String originalFilename = file.getOriginalFilename();//获取文件的真实文件名
|
|
||||||
|
|
||||||
int index = originalFilename.lastIndexOf(".");//获取文件的后缀名‘.’的位置
|
|
||||||
|
|
||||||
String substring = originalFilename.substring(index);//返回文件类型名 例如:.jpg
|
|
||||||
|
|
||||||
String filename= UUID.randomUUID().toString().toUpperCase()+substring;//新创建的文件名
|
|
||||||
|
|
||||||
File dest=new File(dir,filename);//创建一个空的文件
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
file.transferTo(dest);
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
|
|
||||||
return R.error("文件存储出现异常");
|
|
||||||
|
|
||||||
}
|
|
||||||
String RealFilePath="http://localhost:5173/src/upload/picture/"+filename;
|
|
||||||
|
|
||||||
Map<String,Object> data=new HashMap<>();
|
|
||||||
data.put("image",RealFilePath);
|
|
||||||
data.put("filename",filename);
|
|
||||||
|
|
||||||
return R.success(data);//返回图片存储在服务器的地址
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,4 +156,25 @@ public class UserController {
|
||||||
}
|
}
|
||||||
return userService.resetPassword(userId,oldPassword,password);
|
return userService.resetPassword(userId,oldPassword,password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upload_userInfo")
|
||||||
|
public R updateUserInfo(@RequestBody Map<String,Object> updateInfo){
|
||||||
|
|
||||||
|
Integer userId=(Integer) updateInfo.get("userId");
|
||||||
|
Integer updateId=(Integer) updateInfo.get("updateId");
|
||||||
|
String username=(String) updateInfo.get("username");
|
||||||
|
String age=(String) updateInfo.get("age");
|
||||||
|
String email=(String) updateInfo.get("email");
|
||||||
|
String sex=(String) updateInfo.get("sex");
|
||||||
|
|
||||||
|
if(updateId==userId||userId==null||userId.equals("")){
|
||||||
|
userId=null;
|
||||||
|
User user = userService.updateUserInfo(userId, updateId, username, age, email, sex);
|
||||||
|
|
||||||
|
return R.success(user);
|
||||||
|
}else{
|
||||||
|
User user = userService.updateUserInfo(userId, updateId, username, age, email, sex);
|
||||||
|
return R.success(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Company extends BaseEntity{
|
||||||
@ApiModelProperty("注册资本")
|
@ApiModelProperty("注册资本")
|
||||||
private String registeredCapital;
|
private String registeredCapital;
|
||||||
@ApiModelProperty("成立日期")
|
@ApiModelProperty("成立日期")
|
||||||
private Date established;
|
private String established;
|
||||||
@ApiModelProperty("统一信用编码")
|
@ApiModelProperty("统一信用编码")
|
||||||
private String creditCode;
|
private String creditCode;
|
||||||
@ApiModelProperty("公司图片")
|
@ApiModelProperty("公司图片")
|
||||||
|
|
|
@ -12,8 +12,10 @@ public class ImagesEntity extends BaseEntity{
|
||||||
@ApiModelProperty("面试官形象id")
|
@ApiModelProperty("面试官形象id")
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@ApiModelProperty("面试官形象url地址")
|
@ApiModelProperty("面试官形象图片url地址")
|
||||||
private String image;
|
private String image;
|
||||||
|
@ApiModelProperty("面试官形象视频url地址")
|
||||||
|
private String video;
|
||||||
@ApiModelProperty("形象图片名称")
|
@ApiModelProperty("形象图片名称")
|
||||||
private String picName;
|
private String picName;
|
||||||
@ApiModelProperty("公司编码")
|
@ApiModelProperty("公司编码")
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("分享题目实体类")
|
||||||
|
@TableName("sharedQuestion")
|
||||||
|
public class SharedQuestion extends BaseEntity {
|
||||||
|
@ApiModelProperty("题目id")
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
@ApiModelProperty("题目标题")
|
||||||
|
private String title;
|
||||||
|
@ApiModelProperty("题目详情")
|
||||||
|
private String details;
|
||||||
|
@ApiModelProperty("题目对应的promote")
|
||||||
|
private String promote;
|
||||||
|
@ApiModelProperty("题库id")
|
||||||
|
private Integer bankId;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ApiModel("分享题库实体类")
|
||||||
|
@Data
|
||||||
|
@TableName("sharedBank")
|
||||||
|
public class SharedQuestionBank extends BaseEntity{
|
||||||
|
@ApiModelProperty("题库id")
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
@ApiModelProperty("题库名称")
|
||||||
|
private String typeName;
|
||||||
|
@ApiModelProperty("题库类型")
|
||||||
|
private Integer type;
|
||||||
|
@ApiModelProperty("描述")
|
||||||
|
private String description;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.yzdx.AiInterviewer.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestionBank;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SharedQuestionBankMapper extends BaseMapper<SharedQuestionBank> {
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.yzdx.AiInterviewer.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestion;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SharedQuestionMapper extends BaseMapper<SharedQuestion> {
|
||||||
|
}
|
|
@ -12,4 +12,33 @@ public interface CompanyService extends IService<Company> {
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
Company getCompanyDetail(String encoding);
|
Company getCompanyDetail(String encoding);
|
||||||
|
/**
|
||||||
|
* 更新公司详情
|
||||||
|
* @param userId 跟新人的id
|
||||||
|
* @param encoding 跟心公司的编码
|
||||||
|
* @param address 公司地址
|
||||||
|
* @param companyDetail 公司详情
|
||||||
|
* @param addressDetail 公司详情地址
|
||||||
|
* @param companyName 公司名称
|
||||||
|
* @param creditCode 公司统一编码
|
||||||
|
* @param established 公司的注册资金
|
||||||
|
* @param images 公司图片
|
||||||
|
* @param legalRepresentative 法定人
|
||||||
|
* @param registeredCapital 注册资金
|
||||||
|
* @param treatment 公司待遇
|
||||||
|
* @return 影响的行数
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
Integer updateCompanyDetail(String address,
|
||||||
|
String addressDetail,
|
||||||
|
String companyDetail,
|
||||||
|
String companyName,
|
||||||
|
String creditCode,
|
||||||
|
String encoding,
|
||||||
|
String established,
|
||||||
|
String images,
|
||||||
|
String legalRepresentative,
|
||||||
|
String treatment,
|
||||||
|
String registeredCapital,
|
||||||
|
Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public interface InterviewImagesService extends IService<ImagesEntity> {
|
||||||
* @return 映像的行数
|
* @return 映像的行数
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
Integer addImageLogo(String name,String encoding,String image,Integer userId,String filename);
|
Integer addImageLogo(String name,String encoding,String image,String video,Integer userId,String filename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加logo
|
* 添加logo
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.yzdx.AiInterviewer.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestionBank;
|
||||||
|
|
||||||
|
public interface SharedQuestionBankService extends IService<SharedQuestionBank> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.yzdx.AiInterviewer.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestion;
|
||||||
|
|
||||||
|
public interface SharedQuestionService extends IService<SharedQuestion> {
|
||||||
|
}
|
|
@ -85,5 +85,17 @@ public interface UserService extends IService<User> {
|
||||||
* */
|
* */
|
||||||
R resetPassword(Integer userId,String oldPassword,String password);
|
R resetPassword(Integer userId,String oldPassword,String password);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param userId 操作人的id
|
||||||
|
* @param updateId 更新人的id
|
||||||
|
* @param username 修改的名称
|
||||||
|
* @param age 修改的年龄
|
||||||
|
* @param email 修改的电子邮箱
|
||||||
|
* @param sex 修改的性别
|
||||||
|
* @return 返回user对象
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
User updateUserInfo(Integer userId,Integer updateId,String username,String age,String email,String sex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yzdx.AiInterviewer.entity.Company;
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
||||||
import com.yzdx.AiInterviewer.service.CompanyService;
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
||||||
|
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -24,4 +25,33 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||||
|
|
||||||
return company;
|
return company;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer updateCompanyDetail(String address, String addressDetail, String companyDetail, String companyName, String creditCode, String encoding, String established, String images, String legalRepresentative, String treatment, String registeredCapital, Integer userId) {
|
||||||
|
if (address==null||addressDetail==null||companyDetail==null||companyName==null||creditCode==null||established==null||images==null||legalRepresentative==null
|
||||||
|
||treatment==null||registeredCapital==null||userId==null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
//通过公司编码查询公司
|
||||||
|
LambdaQueryWrapper<Company> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Company::getEncoding,encoding);
|
||||||
|
Company company = companyMapper.selectOne(queryWrapper);
|
||||||
|
company.setAddress(address);
|
||||||
|
company.setAddressDetail(addressDetail);
|
||||||
|
company.setCompanyDetail(companyDetail);
|
||||||
|
company.setCompanyName(companyName);
|
||||||
|
company.setCreditCode(creditCode);
|
||||||
|
company.setEstablished(established);
|
||||||
|
company.setImages(images);
|
||||||
|
company.setLegalRepresentative(legalRepresentative);
|
||||||
|
company.setTreatment(treatment);
|
||||||
|
company.setRegisteredCapital(registeredCapital);
|
||||||
|
company.setUpdateTime(TimeUtil.getTime());
|
||||||
|
company.setUpdateUser(userId);
|
||||||
|
Integer i = companyMapper.updateById(company);
|
||||||
|
return i;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,17 +30,32 @@ public class InterviewImagesServiceImpl extends ServiceImpl<InterviewImagesMappe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer addImageLogo(String name, String encoding, String image, Integer userId, String filename) {
|
public Integer addImageLogo(String name, String encoding, String image, String video,Integer userId, String filename) {
|
||||||
ImagesEntity imageEntity=new ImagesEntity();
|
if(video.equals("")||video==null){
|
||||||
imageEntity.setCreateUser(userId);
|
ImagesEntity imageEntity=new ImagesEntity();
|
||||||
imageEntity.setCreateTime(TimeUtil.getTime());
|
imageEntity.setCreateUser(userId);
|
||||||
imageEntity.setImage(image);
|
imageEntity.setCreateTime(TimeUtil.getTime());
|
||||||
imageEntity.setPicName(name);
|
imageEntity.setImage(image);
|
||||||
imageEntity.setEncoding(encoding);
|
imageEntity.setVideo("");
|
||||||
imageEntity.setFilename(filename);
|
imageEntity.setPicName(name);
|
||||||
|
imageEntity.setEncoding(encoding);
|
||||||
|
imageEntity.setFilename(filename);
|
||||||
|
|
||||||
Integer rows = imagesMapper.insert(imageEntity);
|
Integer rows = imagesMapper.insert(imageEntity);
|
||||||
return rows;
|
return rows;
|
||||||
|
}else{
|
||||||
|
ImagesEntity imageEntity=new ImagesEntity();
|
||||||
|
imageEntity.setCreateUser(userId);
|
||||||
|
imageEntity.setCreateTime(TimeUtil.getTime());
|
||||||
|
imageEntity.setVideo(video);
|
||||||
|
imageEntity.setImage("");
|
||||||
|
imageEntity.setPicName(name);
|
||||||
|
imageEntity.setEncoding(encoding);
|
||||||
|
imageEntity.setFilename(filename);
|
||||||
|
|
||||||
|
Integer rows = imagesMapper.insert(imageEntity);
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.yzdx.AiInterviewer.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestionBank;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.SharedQuestionBankMapper;
|
||||||
|
import com.yzdx.AiInterviewer.service.SharedQuestionBankService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SharedQuestionBankServiceImpl extends ServiceImpl<SharedQuestionBankMapper,SharedQuestionBank> implements SharedQuestionBankService{
|
||||||
|
@Autowired
|
||||||
|
private SharedQuestionBankMapper sharedQuestionBankMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.yzdx.AiInterviewer.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.yzdx.AiInterviewer.entity.SharedQuestion;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.SharedQuestionBankMapper;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.SharedQuestionMapper;
|
||||||
|
import com.yzdx.AiInterviewer.service.SharedQuestionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SharedQuestionServiceImpl extends ServiceImpl<SharedQuestionMapper, SharedQuestion> implements SharedQuestionService {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -253,7 +253,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
String findUserPassword = findUser.getPassword();
|
String findUserPassword = findUser.getPassword();
|
||||||
oldPassword = MD5Util.GetMD5Password(oldPassword, salt);
|
oldPassword = MD5Util.GetMD5Password(oldPassword, salt);
|
||||||
if(!findUserPassword.equals(oldPassword)){
|
if(!findUserPassword.equals(oldPassword)){
|
||||||
return R.error("旧密码输入错误,请检查输入");
|
return R.error("旧密码输入错误,请检查输入,或联系管理员修改密码!");
|
||||||
}
|
}
|
||||||
//密码正确
|
//密码正确
|
||||||
password = MD5Util.GetMD5Password(password, salt);
|
password = MD5Util.GetMD5Password(password, salt);
|
||||||
|
@ -271,6 +271,44 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public User updateUserInfo(Integer userId, Integer updateId,String username, String age, String email, String sex) {
|
||||||
|
//判断是否用户自己修改自己的数据
|
||||||
|
if (userId==null||userId.equals("")) {
|
||||||
|
//查找对象
|
||||||
|
LambdaQueryWrapper<User> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq(User::getId,updateId);
|
||||||
|
|
||||||
|
User findUser = userMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
findUser.setUsername(username);
|
||||||
|
|
||||||
|
findUser.setAge(age);
|
||||||
|
|
||||||
|
findUser.setEmail(email);
|
||||||
|
|
||||||
|
findUser.setSex(sex);
|
||||||
|
|
||||||
|
findUser.setUpdateUser(updateId);
|
||||||
|
|
||||||
|
findUser.setUpdateTime(TimeUtil.getTime());
|
||||||
|
|
||||||
|
userMapper.updateById(findUser);
|
||||||
|
|
||||||
|
//对敏感数据进行处理
|
||||||
|
findUser.setPassword("");
|
||||||
|
|
||||||
|
findUser.setSalt("");
|
||||||
|
|
||||||
|
return findUser;
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
server:
|
server:
|
||||||
port: 80
|
port: 8080
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://101.43.255.47:3306/ai_interviewer?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://localhost:3306/ai_interviewer?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: 2002811
|
password: root
|
||||||
|
|
||||||
jackson:
|
jackson:
|
||||||
default-property-inclusion: non_null
|
default-property-inclusion: non_null
|
||||||
|
|
Loading…
Reference in New Issue