From a10fcd998a54eb1d7d7ad88d161bd20966c57026 Mon Sep 17 00:00:00 2001 From: Unique-Jerry <10902054+unique-jerry@user.noreply.gitee.com> Date: Wed, 29 Nov 2023 19:23:43 +0800 Subject: [PATCH] vx --- .../AiInterviewer/config/UserInterceptor.java | 2 +- .../controller/InterviewController.java | 45 +++-- .../controller/QuestionController.java | 146 ++++++++------- .../controller/RecruitmentController.java | 176 ++++++++++-------- .../controller/UploadController.java | 31 ++- .../controller/UserController.java | 63 ++++--- .../controller/VxInterviewController.java | 23 +++ .../controller/VxJobController.java | 42 +++++ .../controller/VxUserController.java | 84 ++++++++- .../controller/vxJobController.java | 4 - .../yzdx/AiInterviewer/entity/Company.java | 4 + .../yzdx/AiInterviewer/entity/JobEntity.java | 2 + .../AiInterviewer/entity/JobExpectation.java | 2 + .../AiInterviewer/entity/VxCarouselChart.java | 15 ++ .../yzdx/AiInterviewer/entity/VxJobLike.java | 19 ++ .../entity/dto/VxJobLikeDto.java | 21 +++ .../mapper/VxCarouselChartMapper.java | 9 + .../AiInterviewer/mapper/VxJobLikeMapper.java | 9 + .../AiInterviewer/service/CompanyService.java | 4 +- .../AiInterviewer/service/JobListService.java | 13 ++ .../AiInterviewer/service/ResumeService.java | 11 +- .../service/VxCarouselChartService.java | 14 ++ .../service/VxJobLikeService.java | 19 ++ .../service/impl/CompanyServiceImpl.java | 9 +- .../service/impl/JobListServiceImpl.java | 35 ++++ .../service/impl/ResumeServiceImpl.java | 14 +- .../impl/VxCarouselChartServiceImpl.java | 25 +++ .../service/impl/VxJobLikeServiceImpl.java | 69 +++++++ src/main/resources/application.yml | 6 +- 29 files changed, 675 insertions(+), 241 deletions(-) create mode 100644 src/main/java/com/yzdx/AiInterviewer/controller/VxInterviewController.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/controller/VxJobController.java delete mode 100644 src/main/java/com/yzdx/AiInterviewer/controller/vxJobController.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/entity/VxCarouselChart.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/entity/VxJobLike.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/entity/dto/VxJobLikeDto.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/mapper/VxCarouselChartMapper.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/mapper/VxJobLikeMapper.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/service/VxCarouselChartService.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/service/VxJobLikeService.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/service/impl/VxCarouselChartServiceImpl.java create mode 100644 src/main/java/com/yzdx/AiInterviewer/service/impl/VxJobLikeServiceImpl.java diff --git a/src/main/java/com/yzdx/AiInterviewer/config/UserInterceptor.java b/src/main/java/com/yzdx/AiInterviewer/config/UserInterceptor.java index 751f927..21928de 100644 --- a/src/main/java/com/yzdx/AiInterviewer/config/UserInterceptor.java +++ b/src/main/java/com/yzdx/AiInterviewer/config/UserInterceptor.java @@ -25,7 +25,7 @@ public class UserInterceptor implements HandlerInterceptor { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { Map map = new HashMap<>(); - String Token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDMyMzQ0MzksInVzZXJpZCI6MTJ9.y_Vdnkk2HZMYLcnfHIOpwitkZArrcOQfQM2hb1ys5ZY"; + String Token = request.getHeader("Authorization");; // 捕获刚刚JWT中抛出的异常,并封装对应的返回信息 try { diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/InterviewController.java b/src/main/java/com/yzdx/AiInterviewer/controller/InterviewController.java index 7b62869..d599a8e 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/InterviewController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/InterviewController.java @@ -51,7 +51,7 @@ public class InterviewController { /** * 添加公司Logo */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "name",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -61,11 +61,13 @@ public class InterviewController { }) @PostMapping("/add_logo") @ApiOperation(value = "添加logo图片",notes = "") - public R addLogo(@RequestParam(required = true, value = "name") String name, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "image") String image, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "filename") String filename){ + public R addLogo(@RequestBody Map addInfo){ + String name= (String)addInfo.get("name"); + String image= (String)addInfo.get("image"); + String encoding= (String)addInfo.get("encoding"); + Integer userId= (Integer)addInfo.get("userId"); + String filename= (String)addInfo.get("filename"); + if(filename.equals("")){ return R.error("请添加图片!"); } @@ -117,7 +119,7 @@ public class InterviewController { /** * 添加背景图片 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "name",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -127,11 +129,13 @@ public class InterviewController { }) @PostMapping("/add_background") @ApiOperation(value = "添加背景图片",notes = "") - public R addBackground(@RequestParam(required = true, value = "name") String name, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "image") String image, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "filename") String filename) { + public R addBackground(@RequestBody Map addInfo) { + String name= (String)addInfo.get("name"); + String image= (String)addInfo.get("image"); + String encoding= (String)addInfo.get("encoding"); + Integer userId= (Integer)addInfo.get("userId"); + String filename= (String)addInfo.get("filename"); + if(filename.equals("")){ return R.error("请添加图片!"); } @@ -183,7 +187,7 @@ public class InterviewController { /** * 添加面试官形象照片 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "name",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -193,13 +197,14 @@ public class InterviewController { }) @PostMapping("/add_image") @ApiOperation(value = "添加面试管形象",notes = "") - public R addImage(@RequestParam(required = true, value = "name") String name, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "image") String image, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "filename") String filename, - @RequestParam(required = true, value = "video") String video, - @RequestParam(required = true, value = "sex") String sex) { + public R addImage(@RequestBody Map addInfo) { + String name= (String)addInfo.get("name"); + String image= (String)addInfo.get("image"); + String encoding= (String)addInfo.get("encoding"); + Integer userId= (Integer)addInfo.get("userId"); + String filename= (String)addInfo.get("filename"); + String video= (String)addInfo.get("video"); + String sex= (String)addInfo.get("sex"); if(filename.equals("")){ return R.error("请添加图片!"); diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/QuestionController.java b/src/main/java/com/yzdx/AiInterviewer/controller/QuestionController.java index d5012d9..9750e02 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/QuestionController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/QuestionController.java @@ -84,7 +84,7 @@ public class QuestionController { /** * 添加题库信息 * */ -@ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "typeName",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -94,13 +94,16 @@ public class QuestionController { }) @PostMapping("/add_typeName") @ApiOperation(value = "根据编码获取logo图片列表",notes = "") - public R addTypeName(@RequestParam(required = true, value = "typeName") String typeName, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "type") Integer type, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "description") String description) - { - if (type==null){ + public R addTypeName(@RequestBody Map addInfo) { + + String typeName=(String) addInfo.get("typeName"); + String encoding=(String) addInfo.get("encoding"); + String description=(String) addInfo.get("description"); + Integer type=(Integer) addInfo.get("type"); + Integer userId=(Integer) addInfo.get("userId"); + + + if (type==null){ return R.error("请选择添加的题库类型"); } Integer row=questionBankService.addTypeName(typeName,encoding,description,type,userId); @@ -137,7 +140,7 @@ public class QuestionController { /** * 根据题库id更新题库 * */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "typeName",required = true), @ApiImplicitParam(name = "typeId",required = true), @@ -147,11 +150,13 @@ public class QuestionController { }) @PostMapping("/change_type") @ApiOperation(value = "根据编码获取logo图片列表",notes = "") - public R changeTypeName(@RequestParam(required = true, value = "typeName") String typeName, - @RequestParam(required = true, value = "typeId") Integer typeId, - @RequestParam(required = true, value = "type") Integer type, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "description") String description){ + public R changeTypeName(@RequestBody Map updateInfo){ + + String typeName=(String) updateInfo.get("typeName"); + Integer typeId=(Integer) updateInfo.get("typeId"); + String description=(String) updateInfo.get("description"); + Integer type=(Integer) updateInfo.get("type"); + Integer userId=(Integer) updateInfo.get("userId"); if (type==null){ return R.error("请选择题库类型"); @@ -206,7 +211,7 @@ public class QuestionController { /** * 添加题目 * */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "title",required = true), @ApiImplicitParam(name = "bankId",required = true), @@ -217,12 +222,13 @@ public class QuestionController { }) @PostMapping("add_question") @ApiOperation(value = "添加题目",notes = "") - public R addQuestion(@RequestParam(required = true, value = "title") String title, - @RequestParam(required = true, value = "bankId") Integer bankId, - @RequestParam(required = true, value = "promote") String promote, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "details") String details){ + public R addQuestion(@RequestBody Map addInfo){ + String title=(String) addInfo.get("title"); + Integer bankId=(Integer) addInfo.get("bankId"); + String details=(String) addInfo.get("details"); + String promote=(String) addInfo.get("promote"); + String encoding=(String) addInfo.get("encoding"); + Integer userId=(Integer) addInfo.get("userId"); Integer rows = questionService.addQuestion(title, bankId, details, promote, encoding, userId); @@ -238,7 +244,6 @@ public class QuestionController { /** * 修改题目 * */ - @ResponseBody @ApiImplicitParams({ @ApiImplicitParam(name = "title",required = true), @ApiImplicitParam(name = "id",required = true), @@ -251,14 +256,14 @@ public class QuestionController { @PostMapping("update_question") @ApiOperation(value = "更新题目",notes = "") - public R updateQuestion(@RequestParam(required = true, value = "title") String title, - @RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "bankId") Integer bankId, - @RequestParam(required = true, value = "promote") String promote, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "details") String details){ - + public R updateQuestion(@RequestBody Map updateInfo){ + String title=(String) updateInfo.get("title"); + Integer bankId=(Integer) updateInfo.get("bankId"); + String details=(String) updateInfo.get("details"); + String promote=(String) updateInfo.get("promote"); + String encoding=(String) updateInfo.get("encoding"); + Integer userId=(Integer) updateInfo.get("userId"); + Integer id=(Integer) updateInfo.get("id"); Integer rows = questionService.updateQuestion(id,title, bankId, details, promote, encoding, userId); if(rows==0){ @@ -293,7 +298,7 @@ public class QuestionController { List sharedQuestionBank = sharedQuestionBankService.getSharedQuestionBank(); return R.success(sharedQuestionBank); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "typeName",required = true), @ApiImplicitParam(name = "type",required = true), @@ -303,12 +308,12 @@ public class QuestionController { }) @PostMapping("/add_sharedQuestionBank") @ApiOperation(value = "添加分享题目",notes = "") - public R addSharedQuestionType(@RequestParam(required = true, value = "typeName") String typeName, - @RequestParam(required = true, value = "type") Integer type, - @RequestParam(required = true, value = "description") String description, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding){ - + public R addSharedQuestionType(@RequestBody Map addInfo){ + String typeName=(String) addInfo.get("typeName"); + Integer type=(Integer) addInfo.get("type"); + String description=(String) addInfo.get("description"); + String encoding=(String) addInfo.get("encoding"); + Integer userId=(Integer) addInfo.get("userId"); SharedQuestionBank sharedQuestionBank = sharedQuestionBankService.addSharedQuestionBank(typeName, type, description, userId,encoding); if(sharedQuestionBank==null){ @@ -334,7 +339,7 @@ public class QuestionController { return R.success(sharedQuestionList); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "sharedBankId",required = true), @ApiImplicitParam(name = "selectQuestionId",required = true), @@ -343,10 +348,11 @@ public class QuestionController { }) @PostMapping("/add_sharedQuestion") @ApiOperation(value = "添加分享的题目",notes = "") - public R addSharedQuestion(@RequestParam(required = true, value = "sharedBankId") Integer sharedBankId, - @RequestParam(required = true, value = "selectQuestionId") List selectQuestionId, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding){ + public R addSharedQuestion(@RequestBody Map addInfo){ + Integer sharedBankId=(Integer) addInfo.get("sharedBankId"); + List selectQuestionId=(List) addInfo.get("selectQuestionId"); + String encoding=(String) addInfo.get("encoding"); + Integer userId=(Integer) addInfo.get("userId"); String result = sharedQuestionService.addSharedQuestions(sharedBankId, selectQuestionId, userId,encoding); if(result.equals("已存在添加题库中")){ @@ -367,7 +373,7 @@ public class QuestionController { return R.success(sharedQuestionDtos); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "sharedBankIds",required = true), @ApiImplicitParam(name = "userId",required = true), @@ -375,9 +381,11 @@ public class QuestionController { }) @PostMapping("/add_QuestionBankFromShare") @ApiOperation(value = "从题库广场中导入到本地",notes = "") - public R addQuestionBankFromShare(@RequestParam(required = true, value = "sharedBankIds") List sharedBankIds, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding){ + public R addQuestionBankFromShare(@RequestBody Map addInfo){ + ListsharedBankIds =(List)addInfo.get("sharedBankIds"); + Integer userId=(Integer)addInfo.get("userId"); + String encoding=(String) addInfo.get("encoding"); + String result=sharedQuestionBankService.addQuestionTypeFromShare(sharedBankIds,userId,encoding); if(result.equals("题库:/n题目:已存在添加题库中")){ @@ -385,7 +393,7 @@ public class QuestionController { } return R.error(result); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "selectSharedQuestionIds",required = true), @ApiImplicitParam(name = "userId",required = true), @@ -394,10 +402,12 @@ public class QuestionController { }) @PostMapping("/add_QuestionFromShare") @ApiOperation(value = "从题目广场中导入到本地",notes = "") - public R addQuestionFromShare(@RequestParam(required = true, value = "selectSharedQuestionIds") List selectSharedQuestionIds, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "bankId") Integer bankId, - @RequestParam(required = true, value = "encoding") String encoding){ + public R addQuestionFromShare(@RequestBody Map addInfo){ + ListselectSharedQuestionIds =(List)addInfo.get("selectSharedQuestionIds"); + Integer userId=(Integer)addInfo.get("userId"); + String encoding=(String) addInfo.get("encoding"); + Integer bankId=(Integer) addInfo.get("bankId"); + String result=sharedQuestionService.addQuestionFromShare(selectSharedQuestionIds,bankId,userId,encoding); if(result.equals("题目:已添加到题目中")){ return R.success("添加成功"); @@ -417,7 +427,7 @@ public class QuestionController { return R.success(sharedQuestionBankDtoList); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "id",required = true), @ApiImplicitParam(name = "userId",required = true), @@ -427,11 +437,12 @@ public class QuestionController { }) @PostMapping("/edit_OurSharedQuestionType") @ApiOperation(value = "修改我的分享题库",notes = "") - public R editOurSharedQuestionType(@RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "typeName") String typeName, - @RequestParam(required = true, value = "description") String description, - @RequestParam(required = true, value = "type") Integer type, - @RequestParam(required = true, value = "userId") Integer userId) { + public R editOurSharedQuestionType(@RequestBody Map updateInfo) { + Integer userId=(Integer)updateInfo.get("userId"); + String typeName=(String) updateInfo.get("typeName"); + Integer type=(Integer) updateInfo.get("type"); + Integer id=(Integer) updateInfo.get("id"); + String description=(String) updateInfo.get("description"); Integer rows = sharedQuestionBankService.editOurSharedQuestionType(id, typeName, description, type, userId); if (rows != 1) { return R.error("修改失败"); @@ -460,20 +471,20 @@ public class QuestionController { return R.success(sharedQuestionDtoList); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "sharedQuestionId",required = true), }) @PostMapping("/delete_OurSharedQuestion") @ApiOperation(value = "删除我的分享题目",notes = "") - public R deleteOurSharedQuestion(@RequestParam(required = true, value = "sharedQuestionId") List sharedQuestionId) - { + public R deleteOurSharedQuestion(@RequestBody Map deleteInfo) { + List sharedQuestionId=(List) deleteInfo.get("sharedQuestionId"); Integer rows= sharedQuestionService.deleteOurSharedQuestion(sharedQuestionId); return R.success("删除成功,删除"+rows+"分享题目"); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "id",required = true), @ApiImplicitParam(name = "title",required = true), @@ -484,12 +495,13 @@ public class QuestionController { }) @PostMapping("/update_OurSharedQuestion") @ApiOperation(value = "更新我的分享题目",notes = "") - public R updateOurSharedQuestion(@RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "title") String title, - @RequestParam(required = true, value = "details") String details, - @RequestParam(required = true, value = "promote") String promote, - @RequestParam(required = true, value = "bankId") Integer bankId, - @RequestParam(required = true, value = "userId") Integer userId){ + public R updateOurSharedQuestion(@RequestBody Map updateInfo){ + Integer userId=(Integer)updateInfo.get("userId"); + String promote=(String) updateInfo.get("promote"); + Integer bankId=(Integer) updateInfo.get("bankId"); + Integer id=(Integer) updateInfo.get("id"); + String details=(String) updateInfo.get("details"); + String title=(String) updateInfo.get("title"); Integer rows=sharedQuestionService.updateOurSharedQuestion(id, title, details , promote, bankId , userId); if(rows==1){ diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/RecruitmentController.java b/src/main/java/com/yzdx/AiInterviewer/controller/RecruitmentController.java index 679b38c..d28d195 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/RecruitmentController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/RecruitmentController.java @@ -24,7 +24,6 @@ public class RecruitmentController { private InterviewSettingService interviewSettingService; @Autowired private CompanyService companyService; - @ResponseBody @ApiImplicitParams({ @ApiImplicitParam(name = "address",required = true), @ApiImplicitParam(name = "addressDetail",required = true), @@ -44,23 +43,25 @@ public class RecruitmentController { }) @PostMapping("/add_job") @ApiOperation(value = "添加岗位",notes = "") - public R addJob(@RequestParam(required = true, value = "address") List address, - @RequestParam(required = true, value = "addressDetail") String address_detail, - @RequestParam(required = true, value = "details") String details, - @RequestParam(required = true, value = "jobName") String jobName, - @RequestParam(required = true, value = "startTime") String startTime, - @RequestParam(required = true, value = "endTime") String endTime, - @RequestParam(required = true, value = "jobTips") List jobTips, - @RequestParam(required = true, value = "jobType") Integer jobType, - @RequestParam(required = true, value = "minSalary") String min_salary, - @RequestParam(required = true, value = "maxSalary") String max_salary, - @RequestParam(required = true, value = "minNumber") String min_number, - @RequestParam(required = true, value = "maxNumber") String max_number, - @RequestParam(required = true, value = "requirement") Integer requirement, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding){ + public R addJob(@RequestBody Map addInfo){ + List address=(List) addInfo.get("address"); + String encoding=(String) addInfo.get("encoding"); + String address_detail=(String) addInfo.get("address_detail"); + Integer jobType=(Integer) addInfo.get("jobType"); + Integer userId=(Integer) addInfo.get("userId"); + String details=(String) addInfo.get("details"); + String jobName=(String) addInfo.get("jobName"); + String startTime=(String) addInfo.get("startTime"); + String endTime=(String) addInfo.get("endTime"); + String min_salary=(String) addInfo.get("min_salary"); + String max_salary=(String) addInfo.get("max_salary"); + String min_number=(String) addInfo.get("min_number"); + String max_number=(String) addInfo.get("max_number"); + List jobTips=(List) addInfo.get("jobTips"); + Integer requirement=(Integer) addInfo.get("requirement"); - Integer rows=jobListService.addJob(address,address_detail,details,jobName,startTime,endTime,jobTips,jobType,min_salary,max_salary,min_number,max_number,requirement,userId,encoding); + Integer rows=jobListService.addJob(address,address_detail,details,jobName,startTime,endTime, + jobTips,jobType,min_salary,max_salary,min_number,max_number,requirement,userId,encoding); if(rows==-2){ return R.error("岗位名称已存在!"); @@ -104,7 +105,9 @@ public class RecruitmentController { return R.success(jobById); } - @ResponseBody + + + @ApiImplicitParams({ @ApiImplicitParam(name = "id",required = true), @ApiImplicitParam(name = "address",required = true), @@ -125,23 +128,24 @@ public class RecruitmentController { }) @PostMapping("/update_job") @ApiOperation(value = "更新岗位信息",notes = "") - public R updateJob(@RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "address") List address, - @RequestParam(required = true, value = "address_detail") String address_detail, - @RequestParam(required = true, value = "details") String details, - @RequestParam(required = true, value = "jobName") String jobName, - @RequestParam(required = true, value = "startTime") String startTime, - @RequestParam(required = true, value = "endTime") String endTime, - @RequestParam(required = true, value = "jobTips") List jobTips, - @RequestParam(required = true, value = "jobType") Integer jobType, - @RequestParam(required = true, value = "min_salary") String min_salary, - @RequestParam(required = true, value = "maxSalary") String max_salary, - @RequestParam(required = true, value = "min_number") String min_number, - @RequestParam(required = true, value = "requirement") Integer requirement, - @RequestParam(required = true, value = "max_number") String max_number, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding - ){ + public R updateJob(@RequestBody Map updateInfo){ + Integer id=(Integer) updateInfo.get("id"); + List address=(List) updateInfo.get("address"); + String encoding=(String) updateInfo.get("encoding"); + String address_detail=(String) updateInfo.get("address_detail"); + Integer jobType=(Integer) updateInfo.get("jobType"); + Integer userId=(Integer) updateInfo.get("userId"); + String details=(String) updateInfo.get("details"); + String jobName=(String) updateInfo.get("jobName"); + String startTime=(String) updateInfo.get("startTime"); + String endTime=(String) updateInfo.get("endTime"); + String min_salary=(String) updateInfo.get("min_salary"); + String max_salary=(String) updateInfo.get("max_salary"); + String min_number=(String) updateInfo.get("min_number"); + String max_number=(String) updateInfo.get("max_number"); + List jobTips=(List) updateInfo.get("jobTips"); + Integer requirement=(Integer) updateInfo.get("requirement"); + Integer rows=jobListService.updateJob(id,address,address_detail,details,jobName,startTime,endTime,jobTips,jobType,min_salary,max_salary,min_number,max_number,requirement,userId,encoding); if (rows==-1){ @@ -154,7 +158,7 @@ public class RecruitmentController { return R.success("修改岗位成功"); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "id",required = true), @ApiImplicitParam(name = "userId",required = true), @@ -162,9 +166,9 @@ public class RecruitmentController { @PostMapping("/update_jobStatus") @ApiOperation(value = "更新岗位状态",notes = "") - public R changeJobStatus( @RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "userId") Integer userId - ){ + public R changeJobStatus(@RequestBody Map updateInfo){ + Integer id=(Integer) updateInfo.get("id"); + Integer userId=(Integer) updateInfo.get("userId"); Integer row = jobListService.changeJobStatus(id, userId); if (row==-1){ @@ -188,7 +192,6 @@ public class RecruitmentController { } return R.success("删除岗位成功!"); } - @ResponseBody @ApiImplicitParams({ @ApiImplicitParam(name = "jobId",required = true), @ApiImplicitParam(name = "imagesId",required = true), @@ -203,18 +206,21 @@ public class RecruitmentController { }) @PostMapping("/add_jobSetting") @ApiOperation(value = "添加面试设置",notes = "") - public R addJobSetting(@RequestParam(required = true, value = "jobId") Integer jobId, - @RequestParam(required = true, value = "imagesId") Integer imagesId, - @RequestParam(required = true, value = "backgroundId") Integer backgroundId, - @RequestParam(required = true, value = "logoId") Integer logoId, - @RequestParam(required = true, value = "Professional") Integer Professional, - @RequestParam(required = true, value = "Comprehensive") Integer Comprehensive, - @RequestParam(required = true, value = "Psychology") Integer Psychology, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "jobPromote") String jobPromote, - @RequestParam(required = true, value = "encoding") String encoding - ){ - Integer rows = interviewSettingService.addJobSetting(jobId, imagesId, backgroundId, logoId, Professional, Comprehensive, Psychology, userId, jobPromote, encoding); + public R addJobSetting(@RequestBody Map addInfo){ + String encoding=(String) addInfo.get("encoding"); + Integer jobId=(Integer) addInfo.get("jobId"); + Integer imagesId=(Integer) addInfo.get("imagesId"); + Integer backgroundId=(Integer) addInfo.get("backgroundId"); + Integer logoId=(Integer) addInfo.get("logoId"); + + Integer userId=(Integer) addInfo.get("userId"); + Integer Professional=(Integer) addInfo.get("Professional"); + Integer Comprehensive=(Integer) addInfo.get("Comprehensive"); + Integer Psychology=(Integer) addInfo.get("Psychology"); + String jobPromote=(String) addInfo.get("jobPromote"); + + Integer rows = interviewSettingService.addJobSetting(jobId, imagesId, backgroundId, logoId, Professional, Comprehensive, + Psychology, userId, jobPromote, encoding); if(rows==-1){ return R.error("添加设置失败,岗位的设置已存在!"); @@ -248,7 +254,7 @@ public class RecruitmentController { } return R.success("删除成功!"); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "jobId",required = true), @ApiImplicitParam(name = "id",required = true), @@ -264,20 +270,21 @@ public class RecruitmentController { }) @PostMapping("/update_jobJobSetting") @ApiOperation(value = "更新面试设置",notes = "") - public R updateJobSetting(@RequestParam(required = true, value = "id") Integer id, - @RequestParam(required = true, value = "jobId") Integer jobId, - @RequestParam(required = true, value = "imagesId") Integer imagesId, - @RequestParam(required = true, value = "backgroundId") Integer backgroundId, - @RequestParam(required = true, value = "logoId") Integer logoId, - @RequestParam(required = true, value = "Professional") Integer Professional, - @RequestParam(required = true, value = "Comprehensive") Integer Comprehensive, - @RequestParam(required = true, value = "Psychology") Integer Psychology, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "jobPromote") String jobPromote, - @RequestParam(required = true, value = "encoding") String encoding){ + public R updateJobSetting(@RequestBody Map updateInfo){ + String encoding=(String) updateInfo.get("encoding"); + Integer jobId=(Integer) updateInfo.get("jobId"); + Integer imagesId=(Integer) updateInfo.get("imagesId"); + Integer backgroundId=(Integer) updateInfo.get("backgroundId"); + Integer logoId=(Integer) updateInfo.get("logoId"); + Integer id=(Integer)updateInfo.get("id"); + Integer userId=(Integer) updateInfo.get("userId"); + Integer Professional=(Integer) updateInfo.get("Professional"); + Integer Comprehensive=(Integer) updateInfo.get("Comprehensive"); + Integer Psychology=(Integer) updateInfo.get("Psychology"); + String jobPromote=(String) updateInfo.get("jobPromote"); - - Integer rows= interviewSettingService.updateJobSetting(id,jobId, imagesId, backgroundId, logoId, Professional, Comprehensive, Psychology, userId, jobPromote, encoding); + Integer rows= interviewSettingService.updateJobSetting(id,jobId, imagesId, backgroundId, logoId, + Professional, Comprehensive, Psychology, userId, jobPromote, encoding); if(rows==-1){ return R.error("修改失败"); @@ -301,7 +308,7 @@ public class RecruitmentController { } return R.success(companyDetail); } - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "jobId",required = true), @ApiImplicitParam(name = "id",required = true), @@ -317,25 +324,30 @@ public class RecruitmentController { }) @PostMapping("/update_companyDetail") @ApiOperation(value = "更新公司详情",notes = "") - public R UpdateCompanyDetail(@RequestParam(required = true, value = "address") List address, - @RequestParam(required = true, value = "addressDetail") String addressDetail, - @RequestParam(required = true, value = "companyDetail") String companyDetail, - @RequestParam(required = true, value = "companyName") String companyName, - @RequestParam(required = true, value = "creditCode") String creditCode, - @RequestParam(required = true, value = "established") String established, - @RequestParam(required = true, value = "images") String images, - @RequestParam(required = true, value = "legalRepresentative") String legalRepresentative, - @RequestParam(required = true, value = "treatment") String treatment, - @RequestParam(required = true, value = "registeredCapital") String registeredCapital, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "encoding") String encoding){ + public R UpdateCompanyDetail(@RequestBody Map updateInfo){ + String encoding=(String) updateInfo.get("encoding"); + List address=(List) updateInfo.get("address"); + Integer userId=(Integer) updateInfo.get("userId"); + 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 established=(String) updateInfo.get("established"); + String legalRepresentative=(String) updateInfo.get("legalRepresentative"); + String treatment=(String) updateInfo.get("treatment"); + String registeredCapital=(String) updateInfo.get("registeredCapital"); + String images=(String) updateInfo.get("images"); + String companyLogo=(String) updateInfo.get("companyLogo"); + String staffNumber=(String) updateInfo.get("staffNumber"); - Integer row = companyService.updateCompanyDetail(address.toString(), addressDetail, + + + Integer row = companyService.updateCompanyDetail(address.toString(), addressDetail, companyDetail, companyName, creditCode, encoding, established, images, legalRepresentative, - treatment, registeredCapital, userId - ); + treatment, registeredCapital, userId, + companyLogo,staffNumber); if (row==-1){ return R.error("更新失败"); } diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/UploadController.java b/src/main/java/com/yzdx/AiInterviewer/controller/UploadController.java index b4819e3..83ae7fd 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/UploadController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/UploadController.java @@ -2,8 +2,6 @@ package com.yzdx.AiInterviewer.controller; import com.yzdx.AiInterviewer.comment.R; -import com.yzdx.AiInterviewer.utiles.ParseResumeUtil; - import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -11,13 +9,11 @@ import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; - import javax.servlet.http.HttpServletRequest; import java.io.File; import java.io.IOException; import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; + @RestController @@ -98,7 +94,7 @@ public class UploadController { return R.error("文件存储出现异常"); } - String RealFilePath="http://117.88.94.226:8080/upload/picture/"+filename; + String RealFilePath="http://localhost:8080/upload/picture/"+filename; Map data=new HashMap<>(); data.put("image",RealFilePath); data.put("filename",filename); @@ -159,7 +155,7 @@ public class UploadController { } - String RealFilePath="http://117.88.94.226:8080/upload/video/"+filename; + String RealFilePath="http://localhost:8080/upload/video/"+filename; Map data=new HashMap<>(); data.put("video",RealFilePath); data.put("filename",filename); @@ -232,6 +228,7 @@ public class UploadController { * @param file * @return R */ + @ResponseBody @PostMapping("/upload_resume") @ApiOperation(value = "上传简历",notes = "") @@ -271,16 +268,15 @@ public class UploadController { return R.error("文件存储出现异常"); } - String RealFilePath="http://117.88.94.226:8080/upload/resume/"+fileName; - ExecutorService pool= Executors.newCachedThreadPool(); - pool.submit(new Runnable() { - @Override - public void run() { - - ParseResumeUtil.ParseChineseResume( request.getSession().getServletContext().getRealPath("/upload/resume/")+"\\"+fileName); - } - }); - + String RealFilePath="http://localhost:8080/upload/resume/"+fileName; +// ExecutorService pool= Executors.newCachedThreadPool(); +// pool.submit(new Runnable() { +// @Override +// public void run() { +// +// ParseResumeUtil.ParseChineseResume( request.getSession().getServletContext().getRealPath("/upload/resume/")+"\\"+fileName); +// } +// }); Map data=new HashMap<>(); data.put("resume",RealFilePath); @@ -321,5 +317,6 @@ public class UploadController { } } } +//-------------------------------------vxUpLoad----------------------- diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/UserController.java b/src/main/java/com/yzdx/AiInterviewer/controller/UserController.java index 9a6220c..36820b5 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/UserController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/UserController.java @@ -21,7 +21,7 @@ public class UserController { /** * 用户登录 * */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "phone",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -29,12 +29,11 @@ public class UserController { }) @ApiOperation(value = "管理员登录",notes = "") @PostMapping("/login") - public R adminLogin(@RequestParam(required = true, value = "phone") String phone, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "password") String password){ - - - return userService.adminLogin(phone, encoding, password); + public R adminLogin(@RequestBody Map loginForm){ + String phone=(String)loginForm.get("phone"); + String encoding=(String)loginForm.get("encoding"); + String password=(String)loginForm.get("password"); + return userService.adminLogin(phone, encoding, password); } @@ -127,7 +126,7 @@ public class UserController { /** * 添加管理员 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "username",required = true), @ApiImplicitParam(name = "encoding",required = true), @@ -137,11 +136,13 @@ public class UserController { }) @PostMapping("/add_admin") @ApiOperation(value = "添加管理员",notes = "") - public R addAdmin(@RequestParam(required = true, value = "username") String username, - @RequestParam(required = true, value = "encoding") String encoding, - @RequestParam(required = true, value = "phone") String phone, - @RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "role") String role){ + public R addAdmin(@RequestBody Map addInfo){ + String encoding=(String)addInfo.get("encoding"); + Integer userId=(Integer)addInfo.get("userId"); + String phone=(String)addInfo.get("phone"); + String username=(String)addInfo.get("username"); + String role=(String)addInfo.get("role"); + Integer rows = userService.addAdmin(encoding, userId, username, phone, role); if(rows==-2){ @@ -185,7 +186,7 @@ public class UserController { /** * 更换头像 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "userId",required = true), @ApiImplicitParam(name = "avatar",required = true), @@ -193,8 +194,9 @@ public class UserController { @PostMapping("/change_avatar") @ApiOperation(value = "根据ID修改头像",notes = "") - public R changeAvatar(@RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "avatar") String avatar){ + public R changeAvatar(@RequestBody Map updateInfo){ + Integer userId=(Integer)updateInfo.get("userId"); + String avatar=(String)updateInfo.get("avatar"); User user = userService.changeAvatar(userId, avatar); if(user==null){ return R.error("更新失败!"); @@ -207,7 +209,7 @@ public class UserController { /** * 更新密码 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "userId",required = true), @ApiImplicitParam(name = "oldPassword",required = true), @@ -217,10 +219,13 @@ public class UserController { @PostMapping("/reset_password") @ApiOperation(value = "根据id更改密码",notes = "") - public R resetPassword(@RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "oldPassword") String oldPassword, - @RequestParam(required = true, value = "password") String password, - @RequestParam(required = true, value = "resetPassword") String resetPassword){ + public R resetPassword(@RequestBody Map updateInfo){ + + String password= (String)updateInfo.get("password"); + String resetPassword= (String)updateInfo.get("resetPassword"); + Integer userId= (Integer)updateInfo.get("userId"); + String oldPassword= (String)updateInfo.get("oldPassword"); + if(!password.equals(resetPassword)){ return R.error("两次输入的密码不一致!"); } @@ -230,7 +235,7 @@ public class UserController { /** * 更新用户信息 */ - @ResponseBody + @ApiImplicitParams({ @ApiImplicitParam(name = "userId",required = true), @ApiImplicitParam(name = "oldPassword",required = true), @@ -239,13 +244,13 @@ public class UserController { }) @PostMapping("/upload_userInfo") @ApiOperation(value = "根据ID更新用户信息",notes = "") - public R updateUserInfo(@RequestParam(required = true, value = "userId") Integer userId, - @RequestParam(required = true, value = "updateId") Integer updateId, - @RequestParam(required = true, value = "username") String username, - @RequestParam(required = true, value = "email") String email, - @RequestParam(required = true, value = "sex") String sex, - @RequestParam(required = true, value = "age") String age){ - + public R updateUserInfo(@RequestBody MapupdateInfo){ + Integer updateId= (Integer)updateInfo.get("updateId"); + Integer userId= (Integer)updateInfo.get("userId"); + 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); diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/VxInterviewController.java b/src/main/java/com/yzdx/AiInterviewer/controller/VxInterviewController.java new file mode 100644 index 0000000..579e950 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/controller/VxInterviewController.java @@ -0,0 +1,23 @@ +package com.yzdx.AiInterviewer.controller; + +import com.yzdx.AiInterviewer.comment.R; +import com.yzdx.AiInterviewer.service.VxCarouselChartService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/vx_interview") +public class VxInterviewController { + + @Autowired + private VxCarouselChartService vxCarouselChartService; + + @GetMapping("/getCarouselChart") + public R getCarouselChart(){ + return R.success(vxCarouselChartService.getVxCarouselChartService()); + } + + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/VxJobController.java b/src/main/java/com/yzdx/AiInterviewer/controller/VxJobController.java new file mode 100644 index 0000000..6ea79c1 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/controller/VxJobController.java @@ -0,0 +1,42 @@ +package com.yzdx.AiInterviewer.controller; + +import com.yzdx.AiInterviewer.comment.R; +import com.yzdx.AiInterviewer.entity.dto.VxJobLikeDto; +import com.yzdx.AiInterviewer.service.JobListService; +import com.yzdx.AiInterviewer.service.VxJobLikeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/vxJob") +public class VxJobController { + + @Autowired + private JobListService jobListService; + + @Autowired + private VxJobLikeService vxJobLikeService; +// @GetMapping("/search_job") +// public R searchJobList(String searchName,String address){ +// +// jobListService.vxSearchJob( searchName, address); +// +// +// } + + @GetMapping("/getJobLikeList") + public R getJobLikeList(Integer userId){ + + List VxJobLikeDtos = vxJobLikeService.getJobLikeListById(userId); + + return R.success(VxJobLikeDtos); + + } + + + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/VxUserController.java b/src/main/java/com/yzdx/AiInterviewer/controller/VxUserController.java index e6c9eb1..3f0e84d 100644 --- a/src/main/java/com/yzdx/AiInterviewer/controller/VxUserController.java +++ b/src/main/java/com/yzdx/AiInterviewer/controller/VxUserController.java @@ -3,11 +3,17 @@ package com.yzdx.AiInterviewer.controller; import com.yzdx.AiInterviewer.comment.R; import com.yzdx.AiInterviewer.entity.JobExpectation; import com.yzdx.AiInterviewer.service.ResumeService; +import com.yzdx.AiInterviewer.service.UserService; +import com.yzdx.AiInterviewer.utiles.GetPostUntil; +import com.yzdx.AiInterviewer.utiles.WechatUtils; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.codec.binary.Base64; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; - +import org.json.JSONObject; import java.util.List; import java.util.Map; @@ -17,6 +23,64 @@ public class VxUserController { @Autowired private ResumeService resumeService; + + @Autowired + private UserService userService; + + + @ApiImplicitParams({ + @ApiImplicitParam(name = "js_code", required = true) + } + ) + @ResponseBody + @ApiOperation(value = "求职者登陆(vx)",notes = "") + @PostMapping("/WxLogin") + public R R (@RequestParam(value = "js_code", required = true) String js_code) throws Exception { + + //测试数据code +// js_code = "0a3wuc0w3wd6M137CR2w3u7DoF1wuc0f"; + + //微信获取session_key接口地址 + String wxLoginUrl = "https://api.weixin.qq.com/sns/jscode2session"; + //接口参数 + String param = "appid=wx7c972ceb65b45c49&secret=72ad166ce138375593026a2fc5bf9eee&js_code=" + js_code + "&grant_type=authorization_code"; + //调用获取session_key接口 请求方式get + String jsonString = GetPostUntil.sendGet(wxLoginUrl, param); + System.out.println(jsonString); + //因为json字符串是大括号包围,所以用JSONObject解析 + JSONObject json = new JSONObject(jsonString); + //json解析session_key值 + String session_key = json.getString("session_key"); + System.out.println("session_key:" + session_key); + //返回给前端 + return R.success(session_key); + } + + @ResponseBody + @ApiImplicitParams({ + @ApiImplicitParam(name = "encryptedData", required = true), + @ApiImplicitParam(name = "iv", required = true), + @ApiImplicitParam(name = "sessionKey", required = true) + } + ) + @ApiOperation(value = "求职者登陆(vx)",notes = "") + @PostMapping(value = "/decodeUserInfo") + public R decodeUserInfo(@RequestParam(required = true, value = "encryptedData") String encryptedData, + @RequestParam(required = true, value = "iv") String iv, + @RequestParam(required = true, value = "sessionKey") String sessionKey + ) throws Exception { + byte[] encrypData = Base64.decodeBase64(encryptedData); + byte[] ivData = Base64.decodeBase64(iv); + byte[] sKey = Base64.decodeBase64(sessionKey); + + String decrypt = WechatUtils.decrypt(sKey,ivData,encrypData); + System.out.println(decrypt); + JSONObject jsonObject=new JSONObject(decrypt); + String phoneNumber = jsonObject.getString("phoneNumber"); + return userService.vxLogin(phoneNumber); + } + + /** *填写简历 */ @@ -39,6 +103,7 @@ public class VxUserController { }) @PostMapping("/write_resume") public R writeResume(@RequestParam(required = true, value = "name") String name, + @RequestParam(required = true,value = "avatar")String avatar, @RequestParam(required = true, value = "status") String status, @RequestParam(required = true, value = "graduateTime") String graduateTime, @RequestParam(required = true, value = "birthday") String birthday, @@ -47,12 +112,12 @@ public class VxUserController { @RequestParam(required = true, value = "vx") String vx, @RequestParam(required = true, value = "personalAdvantage") String personalAdvantage, @RequestParam(required = true, value = "other") String other, - @RequestParam(required = true, value = "jobExpectation") List jobExpectation, + @RequestParam(required = true, value = "jobExpectation") List jobExpectation, @RequestParam(required = true, value = "workExperience") List workExperience, @RequestParam(required = true, value = "projectExperience") List projectExperience, @RequestParam(required = true, value = "userId") Integer userId, @RequestParam(required = true, value = "sex") String sex){ - Integer rows = resumeService.writeResume( name, sex, status, graduateTime, birthday, phone, email, vx, personalAdvantage, + Integer rows = resumeService.writeResume( name, avatar,sex, status, graduateTime, birthday, phone, email, vx, personalAdvantage, other,jobExpectation,workExperience,projectExperience,userId); if(rows!=1){ return R.error("提交失败,请重新输入"); @@ -81,9 +146,12 @@ public class VxUserController { @ApiImplicitParam(name = "userId",required = true), @ApiImplicitParam(name = "sex",required = true), }) + + @PostMapping("/update_resume") public R updateResume(@RequestParam(required = true, value = "name") String name, @RequestParam(required = true, value = "id") Integer id, + @RequestParam(required = true,value = "avatar")String avatar, @RequestParam(required = true, value = "status") String status, @RequestParam(required = true, value = "graduateTime") String graduateTime, @RequestParam(required = true, value = "birthday") String birthday, @@ -92,12 +160,13 @@ public class VxUserController { @RequestParam(required = true, value = "vx") String vx, @RequestParam(required = true, value = "personalAdvantage") String personalAdvantage, @RequestParam(required = true, value = "other") String other, - @RequestParam(required = true, value = "jobExpectation") List jobExpectation, + @RequestParam(required = true, value = "jobExpectation") List jobExpectation, @RequestParam(required = true, value = "workExperience") List workExperience, @RequestParam(required = true, value = "projectExperience") List projectExperience, @RequestParam(required = true, value = "userId") Integer userId, @RequestParam(required = true, value = "sex") String sex){ - Integer rows = resumeService.updateResume(id,name, sex, status, graduateTime, birthday, phone, email, vx, personalAdvantage, + Integer rows = resumeService.updateResume(id,name,avatar, sex, status, graduateTime, + birthday, phone, email, vx, personalAdvantage, other,jobExpectation,workExperience,projectExperience,userId); if(rows!=1){ return R.error("提交失败,请重新输入"); @@ -133,9 +202,10 @@ public class VxUserController { * 获取岗位期望列表 * @return */ + @GetMapping - public R getJobExpectation(){ - List list= resumeService.getJobExpectation(); + public R getJobExpectation(@ApiParam("Integer userId") Integer userId){ + List list= resumeService.getJobExpectation(userId); return R.success(list); } diff --git a/src/main/java/com/yzdx/AiInterviewer/controller/vxJobController.java b/src/main/java/com/yzdx/AiInterviewer/controller/vxJobController.java deleted file mode 100644 index 1ea04a1..0000000 --- a/src/main/java/com/yzdx/AiInterviewer/controller/vxJobController.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.yzdx.AiInterviewer.controller; - -public class vxJobController { -} diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/Company.java b/src/main/java/com/yzdx/AiInterviewer/entity/Company.java index 7ca096f..f803deb 100644 --- a/src/main/java/com/yzdx/AiInterviewer/entity/Company.java +++ b/src/main/java/com/yzdx/AiInterviewer/entity/Company.java @@ -38,4 +38,8 @@ public class Company extends BaseEntity { private String images; @ApiModelProperty("公司使用的登陆编码") private String encoding; + @ApiModelProperty("企业人数") + private String staffNumber; + @ApiModelProperty("公司logo") + private String companyLogo; } diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/JobEntity.java b/src/main/java/com/yzdx/AiInterviewer/entity/JobEntity.java index 3312598..297e8a8 100644 --- a/src/main/java/com/yzdx/AiInterviewer/entity/JobEntity.java +++ b/src/main/java/com/yzdx/AiInterviewer/entity/JobEntity.java @@ -45,5 +45,7 @@ public class JobEntity extends BaseEntity { private String companyEncoding; @ApiModelProperty("岗位状态,0:禁用 1:启用") private Integer status; + @ApiModelProperty("岗位福利") + private String jobWelfale; } diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/JobExpectation.java b/src/main/java/com/yzdx/AiInterviewer/entity/JobExpectation.java index 57a8124..fda9bd1 100644 --- a/src/main/java/com/yzdx/AiInterviewer/entity/JobExpectation.java +++ b/src/main/java/com/yzdx/AiInterviewer/entity/JobExpectation.java @@ -20,4 +20,6 @@ public class JobExpectation extends BaseEntity{ private String location; @ApiModelProperty("期望薪资") private String salary; + @ApiModelProperty("用户ID") + private Integer userId; } diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/VxCarouselChart.java b/src/main/java/com/yzdx/AiInterviewer/entity/VxCarouselChart.java new file mode 100644 index 0000000..b4297ca --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/entity/VxCarouselChart.java @@ -0,0 +1,15 @@ +package com.yzdx.AiInterviewer.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +@Data +@TableName("carousel_chart") +public class VxCarouselChart { + @TableId(type = IdType.AUTO) + private Integer id; + + private String images; +} diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/VxJobLike.java b/src/main/java/com/yzdx/AiInterviewer/entity/VxJobLike.java new file mode 100644 index 0000000..a875e0a --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/entity/VxJobLike.java @@ -0,0 +1,19 @@ +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.ApiModelProperty; +import lombok.Data; +@Data +@TableName("job_like") +public class VxJobLike extends BaseEntity{ + @ApiModelProperty("关注岗位id") + @TableId(type = IdType.AUTO) + private Integer id; + @ApiModelProperty("岗位id") + private Integer jobId; + @ApiModelProperty("用户id") + private Integer userId; + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/entity/dto/VxJobLikeDto.java b/src/main/java/com/yzdx/AiInterviewer/entity/dto/VxJobLikeDto.java new file mode 100644 index 0000000..71e1ea8 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/entity/dto/VxJobLikeDto.java @@ -0,0 +1,21 @@ +package com.yzdx.AiInterviewer.entity.dto; + +import com.yzdx.AiInterviewer.entity.VxJobLike; +import lombok.Data; + +@Data +public class VxJobLikeDto extends VxJobLike { + + private String jobName; + + private String salary; + + private String company; + + private String staffNumber; + + private String label; + + private String position; + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/mapper/VxCarouselChartMapper.java b/src/main/java/com/yzdx/AiInterviewer/mapper/VxCarouselChartMapper.java new file mode 100644 index 0000000..08e4857 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/mapper/VxCarouselChartMapper.java @@ -0,0 +1,9 @@ +package com.yzdx.AiInterviewer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yzdx.AiInterviewer.entity.VxCarouselChart; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface VxCarouselChartMapper extends BaseMapper { +} diff --git a/src/main/java/com/yzdx/AiInterviewer/mapper/VxJobLikeMapper.java b/src/main/java/com/yzdx/AiInterviewer/mapper/VxJobLikeMapper.java new file mode 100644 index 0000000..ffcb014 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/mapper/VxJobLikeMapper.java @@ -0,0 +1,9 @@ +package com.yzdx.AiInterviewer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yzdx.AiInterviewer.entity.VxJobLike; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface VxJobLikeMapper extends BaseMapper { +} diff --git a/src/main/java/com/yzdx/AiInterviewer/service/CompanyService.java b/src/main/java/com/yzdx/AiInterviewer/service/CompanyService.java index 5823337..ec9a169 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/CompanyService.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/CompanyService.java @@ -40,7 +40,9 @@ public interface CompanyService extends IService { String legalRepresentative, String treatment, String registeredCapital, - Integer userId); + Integer userId, + String companyLogo, + String staffNumber); } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/JobListService.java b/src/main/java/com/yzdx/AiInterviewer/service/JobListService.java index 19c3a84..8fa454a 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/JobListService.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/JobListService.java @@ -119,4 +119,17 @@ public interface JobListService extends IService { Integer deleteJob(Integer id); + + //------------------------------------------------vx------------------------------------------- +/** + * vx搜索岗位 + * @param searchName 搜索名称 + * @param address 所在地址 + * @return jobDto列表 + * + * */ + +List vxSearchJob(String searchName, String address); + + } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/ResumeService.java b/src/main/java/com/yzdx/AiInterviewer/service/ResumeService.java index 66a11e5..419f3da 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/ResumeService.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/ResumeService.java @@ -27,10 +27,10 @@ public interface ResumeService extends IService { * @param userId * @return */ - Integer writeResume(String name, String sex, String status + Integer writeResume(String name, String avatar,String sex, String status , String graduateTime, String birthday, String phone, String email , String vx, String personalAdvantage, String other - , List jobExpectation, List workExperience, List projectExperience, Integer userId); + , List jobExpectation, List workExperience, List projectExperience, Integer userId); /** * 添加岗位期望 @@ -46,7 +46,7 @@ public interface ResumeService extends IService { * 获取岗位期望列表 * @return */ - List getJobExpectation(); + List getJobExpectation(Integer userId); /** * 更新岗位期望 @@ -66,5 +66,8 @@ public interface ResumeService extends IService { */ Integer deleteJobExpectation(Integer id); - Integer updateResume(Integer id, String name, String sex, String status, String graduateTime, String birthday, String phone, String email, String vx, String personalAdvantage, String other, List jobExpectation, List workExperience, List projectExperience, Integer userId); + Integer updateResume(Integer id, String name, String avatar,String sex, String status, + String graduateTime, String birthday, String phone, String email, String vx, + String personalAdvantage, String other, List jobExpectation, List workExperience, + List projectExperience, Integer userId); } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/VxCarouselChartService.java b/src/main/java/com/yzdx/AiInterviewer/service/VxCarouselChartService.java new file mode 100644 index 0000000..d555778 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/service/VxCarouselChartService.java @@ -0,0 +1,14 @@ +package com.yzdx.AiInterviewer.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yzdx.AiInterviewer.entity.VxCarouselChart; + +public interface VxCarouselChartService extends IService { + + /** + * 获取轮播图信息 + * + * */ + String getVxCarouselChartService(); + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/service/VxJobLikeService.java b/src/main/java/com/yzdx/AiInterviewer/service/VxJobLikeService.java new file mode 100644 index 0000000..0be8d89 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/service/VxJobLikeService.java @@ -0,0 +1,19 @@ +package com.yzdx.AiInterviewer.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yzdx.AiInterviewer.entity.VxJobLike; +import com.yzdx.AiInterviewer.entity.dto.VxJobLikeDto; + +import java.util.List; + +public interface VxJobLikeService extends IService { + + /** + * 根据用户id查询关注岗位列表 + * @param userId 用户ID + * @return VxJobLikeDto列表 + * + * */ + List getJobLikeListById(Integer userId); + +} diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/CompanyServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/CompanyServiceImpl.java index ec0e825..2c8b0cc 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/impl/CompanyServiceImpl.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/CompanyServiceImpl.java @@ -27,9 +27,12 @@ public class CompanyServiceImpl extends ServiceImpl impl } @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) { + 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,String companyLogo, + String staffNumber) { if (address==null||addressDetail==null||companyDetail==null||companyName==null||creditCode==null||established==null||images==null||legalRepresentative==null - ||treatment==null||registeredCapital==null||userId==null){ + ||treatment==null||registeredCapital==null||userId==null||staffNumber==null||companyLogo==null){ return -1; } //通过公司编码查询公司 @@ -48,6 +51,8 @@ public class CompanyServiceImpl extends ServiceImpl impl company.setRegisteredCapital(registeredCapital); company.setUpdateTime(TimeUtil.getTime()); company.setUpdateUser(userId); + company.setCompanyLogo(companyLogo); + company.setStaffNumber(staffNumber); Integer i = companyMapper.updateById(company); return i; diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/JobListServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/JobListServiceImpl.java index 08e0a9b..9303b55 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/impl/JobListServiceImpl.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/JobListServiceImpl.java @@ -274,4 +274,39 @@ public class JobListServiceImpl extends ServiceImpl implem } return jobMapper.delete(queryWrapper); } + + //----------------------------------------------------vx---------------------------------------------- + + @Override + public List vxSearchJob(String searchName, String address) { + + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + + queryWrapper.like(JobEntity::getJobName,searchName).like(JobEntity::getAddress,address); + + List jobEntities = jobMapper.selectList(queryWrapper); + List jobDtoList = jobEntities.stream().map((item) -> { + + JobDto jobDto=new JobDto(); + + jobDto.setId(item.getId()); + jobDto.setJobName(item.getJobName()); + jobDto.setJobType(item.getJobType()); + jobDto.setDetail(item.getDetails()); + String number=item.getMinNumber()+"-"+item.getMaxNumber(); + jobDto.setNumber(number); + String Address= MyStringUtils.convertString(item.getAddress())+item.getAddressDetail(); + jobDto.setAddress(Address); + String salary=item.getMinSalary()+"-"+item.getMaxSalary(); + jobDto.setSalary(salary); + jobDto.setStatus(item.getStatus()); + jobDto.setCreateUser(item.getCreateUser()); + jobDto.setCreateTime(item.getCreateTime()); + jobDto.setUpdateUser(item.getUpdateUser()); + jobDto.setUpdateTime(item.getUpdateTime()); + return jobDto; + }).collect(Collectors.toList()); + return jobDtoList; + + } } diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/ResumeServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/ResumeServiceImpl.java index e71a792..883d7af 100644 --- a/src/main/java/com/yzdx/AiInterviewer/service/impl/ResumeServiceImpl.java +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/ResumeServiceImpl.java @@ -21,12 +21,13 @@ public class ResumeServiceImpl extends ServiceImpl impleme @Autowired private JobExpectationMapper jobExpectationMapper; @Override - public Integer writeResume( String name, String sex, String status, String graduateTime, String birthday, + public Integer writeResume( String name, String avatar,String sex, String status, String graduateTime, String birthday, String phone, String email, String vx, String personalAdvantage, String other, - List jobExpectation, List workExperience, List projectExperience, + List jobExpectation, List workExperience, List projectExperience, Integer userId) { Resume resume=new Resume(); resume.setName(name); + resume.setAvatar(avatar); resume.setSex(sex); resume.setStatus(status); resume.setGraduateTime(graduateTime); @@ -62,8 +63,9 @@ public class ResumeServiceImpl extends ServiceImpl impleme } @Override - public List getJobExpectation() { + public List getJobExpectation(Integer userId) { LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(JobExpectation::getUserId,userId); List list = jobExpectationMapper.selectList(queryWrapper); return list; } @@ -95,10 +97,14 @@ public class ResumeServiceImpl extends ServiceImpl impleme } @Override - public Integer updateResume(Integer id, String name, String sex, String status, String graduateTime, String birthday, String phone, String email, String vx, String personalAdvantage, String other, List jobExpectation, List workExperience, List projectExperience, Integer userId) { + public Integer updateResume(Integer id, String name, String avatar,String sex, String status, + String graduateTime, String birthday, String phone, String email, String vx, + String personalAdvantage, String other, List jobExpectation, List workExperience, + List projectExperience, Integer userId) { Resume resume=new Resume(); resume.setId(id); resume.setName(name); + resume.setAvatar(avatar); resume.setSex(sex); resume.setStatus(status); resume.setGraduateTime(graduateTime); diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/VxCarouselChartServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/VxCarouselChartServiceImpl.java new file mode 100644 index 0000000..62568f9 --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/VxCarouselChartServiceImpl.java @@ -0,0 +1,25 @@ +package com.yzdx.AiInterviewer.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yzdx.AiInterviewer.entity.VxCarouselChart; +import com.yzdx.AiInterviewer.mapper.VxCarouselChartMapper; +import com.yzdx.AiInterviewer.service.VxCarouselChartService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class VxCarouselChartServiceImpl extends ServiceImpl implements VxCarouselChartService { + + @Autowired + private VxCarouselChartMapper vxCarouselChartMapper; + + @Override + public String getVxCarouselChartService() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + VxCarouselChart vxCarouselChart= vxCarouselChartMapper.selectOne(queryWrapper); + + return vxCarouselChart.getImages(); + } +} diff --git a/src/main/java/com/yzdx/AiInterviewer/service/impl/VxJobLikeServiceImpl.java b/src/main/java/com/yzdx/AiInterviewer/service/impl/VxJobLikeServiceImpl.java new file mode 100644 index 0000000..e9cfb5c --- /dev/null +++ b/src/main/java/com/yzdx/AiInterviewer/service/impl/VxJobLikeServiceImpl.java @@ -0,0 +1,69 @@ +package com.yzdx.AiInterviewer.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yzdx.AiInterviewer.entity.Company; +import com.yzdx.AiInterviewer.entity.JobEntity; +import com.yzdx.AiInterviewer.entity.VxJobLike; +import com.yzdx.AiInterviewer.entity.dto.VxJobLikeDto; +import com.yzdx.AiInterviewer.mapper.VxJobLikeMapper; +import com.yzdx.AiInterviewer.service.CompanyService; +import com.yzdx.AiInterviewer.service.JobListService; +import com.yzdx.AiInterviewer.service.VxJobLikeService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class VxJobLikeServiceImpl extends ServiceImpl implements VxJobLikeService { + + @Autowired + private VxJobLikeMapper vxJobLikeMapper; + @Autowired + private JobListService jobListService; + @Autowired + private CompanyService companyService; + + @Override + public List getJobLikeListById(Integer userId) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + + queryWrapper.eq(VxJobLike::getUserId,userId); + + List vxJobLikes = vxJobLikeMapper.selectList(queryWrapper); + + if(vxJobLikes.size()==0){ + return null; + } + + List vxJobLikeDtoList=vxJobLikes.stream().map(item->{ + VxJobLikeDto vxJobLikeDto=new VxJobLikeDto(); + + BeanUtils.copyProperties(item,vxJobLikeDto); + + JobEntity findJob = jobListService.getJobById(item.getJobId()); + + vxJobLikeDto.setJobName(findJob.getJobName()); + + vxJobLikeDto.setSalary(findJob.getMinSalary()+"-"+findJob.getMaxSalary()+"k"); + + Company companyDetail = companyService.getCompanyDetail(findJob.getCompanyEncoding()); + + vxJobLikeDto.setCompany(companyDetail.getCompanyName()); + + vxJobLikeDto.setStaffNumber(companyDetail.getStaffNumber()); + + vxJobLikeDto.setLabel(findJob.getJobTips()); + + vxJobLikeDto.setPosition(findJob.getAddressDetail()); + + + return vxJobLikeDto; + }).collect(Collectors.toList()); + + return vxJobLikeDtoList; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 56026dd..c98f6ad 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,9 +3,9 @@ server: spring: datasource: - url: jdbc:mysql://117.88.94.226:3306/ai_interviewer?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai - username: root - password: Jerry + url: jdbc:mysql://101.43.255.47:3306/ai_interviewer?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: Jerry + password: 2002811 jackson: default-property-inclusion: non_null