分享题库功能完善2

This commit is contained in:
Unique-Jerry 2023-11-20 10:38:07 +08:00
parent 0bbfa546fc
commit 4b66fa8c0c
5 changed files with 22 additions and 27 deletions

View File

@ -7,6 +7,7 @@ import com.yzdx.AiInterviewer.entity.LogoEntity;
import com.yzdx.AiInterviewer.service.InterviewBackgroundService; import com.yzdx.AiInterviewer.service.InterviewBackgroundService;
import com.yzdx.AiInterviewer.service.InterviewImagesService; import com.yzdx.AiInterviewer.service.InterviewImagesService;
import com.yzdx.AiInterviewer.service.InterviewLogoService; import com.yzdx.AiInterviewer.service.InterviewLogoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -77,7 +78,7 @@ public class InterviewController {
* @param id 图片id * @param id 图片id
* @return R * @return R
*/ */
@GetMapping("/delete_logo") @DeleteMapping("/delete_logo")
public R deleteLogoById(@ApiParam("传入的值为:(Integer)id") Integer id){ public R deleteLogoById(@ApiParam("传入的值为:(Integer)id") Integer id){
Integer rows = LogoService.deleteLogoById(id); Integer rows = LogoService.deleteLogoById(id);
@ -139,7 +140,7 @@ public class InterviewController {
* @param id 公司id * @param id 公司id
* @return R * @return R
*/ */
@GetMapping("/delete_background") @DeleteMapping("/delete_background")
public R deleteBackgroundById(@ApiParam("传入的值为:(Integer)id") Integer id){ public R deleteBackgroundById(@ApiParam("传入的值为:(Integer)id") Integer id){
Integer rows = backgroundService.deleteBackgroundById(id); Integer rows = backgroundService.deleteBackgroundById(id);
@ -203,7 +204,7 @@ public class InterviewController {
* @param id 图片id * @param id 图片id
* @return R * @return R
*/ */
@GetMapping("/delete_image") @DeleteMapping("/delete_image")
public R deleteImageById(@ApiParam("传入的值:(Integer)id") Integer id){ public R deleteImageById(@ApiParam("传入的值:(Integer)id") Integer id){
Integer rows = imagesService.deleteImageById(id); Integer rows = imagesService.deleteImageById(id);

View File

@ -11,6 +11,7 @@ import com.yzdx.AiInterviewer.service.QuestionBankService;
import com.yzdx.AiInterviewer.service.QuestionService; import com.yzdx.AiInterviewer.service.QuestionService;
import com.yzdx.AiInterviewer.service.SharedQuestionBankService; import com.yzdx.AiInterviewer.service.SharedQuestionBankService;
import com.yzdx.AiInterviewer.service.SharedQuestionService; import com.yzdx.AiInterviewer.service.SharedQuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -116,7 +117,7 @@ public class QuestionController {
* @param typeId 传入的题库id * @param typeId 传入的题库id
* return R * return R
* */ * */
@GetMapping("/delete_type") @DeleteMapping("/delete_type")
public R deleteTypeName(@RequestParam @ApiParam("typeId:传入的题库id") Integer typeId){ public R deleteTypeName(@RequestParam @ApiParam("typeId:传入的题库id") Integer typeId){
if(typeId==null){ if(typeId==null){
return R.error("提交的信息错误,请检查输入"); return R.error("提交的信息错误,请检查输入");
@ -247,7 +248,7 @@ public class QuestionController {
* @param id 删除题目的id * @param id 删除题目的id
* return R * return R
* */ * */
@GetMapping("/del_question") @DeleteMapping("/del_question")
public R deleteQuestion(@ApiParam("传入的值:(Integer)id") Integer id){ public R deleteQuestion(@ApiParam("传入的值:(Integer)id") Integer id){
Integer rows=questionService.deleteQuestion(id); Integer rows=questionService.deleteQuestion(id);

View File

@ -8,14 +8,9 @@ import com.yzdx.AiInterviewer.entity.dto.JobSettingDto;
import com.yzdx.AiInterviewer.service.CompanyService; import com.yzdx.AiInterviewer.service.CompanyService;
import com.yzdx.AiInterviewer.service.InterviewSettingService; import com.yzdx.AiInterviewer.service.InterviewSettingService;
import com.yzdx.AiInterviewer.service.JobListService; import com.yzdx.AiInterviewer.service.JobListService;
import com.yzdx.AiInterviewer.utiles.MyStringUtils; import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.util.*; import java.util.*;
@ -144,7 +139,7 @@ public class RecruitmentController {
return R.success("修改岗位状态成功"); return R.success("修改岗位状态成功");
} }
@GetMapping("/delete_job") @DeleteMapping("/delete_job")
public R deleteJob(Integer id) { public R deleteJob(Integer id) {
if (id == null) { if (id == null) {
@ -208,7 +203,7 @@ public class RecruitmentController {
return R.success(jobSettingDtos); return R.success(jobSettingDtos);
} }
@GetMapping("/delete_jobJobSetting") @DeleteMapping("/delete_jobJobSetting")
public R deleteJobSetting(Integer id){ public R deleteJobSetting(Integer id){
Integer rows = interviewSettingService.deleteJobSetting(id); Integer rows = interviewSettingService.deleteJobSetting(id);

View File

@ -3,11 +3,9 @@ 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 io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -17,6 +15,7 @@ import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@RestController @RestController
@Slf4j @Slf4j
public class UploadController { public class UploadController {
@ -163,7 +162,7 @@ public class UploadController {
* @param imagePath * @param imagePath
* @return R * @return R
*/ */
@GetMapping("/delete_picture") @DeleteMapping("/delete_picture")
public R deletePicture(HttpServletRequest request,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("删除失败!");
@ -191,7 +190,7 @@ public class UploadController {
* @param videoPath * @param videoPath
* @return R * @return R
*/ */
@GetMapping("/delete_video") @DeleteMapping("/delete_video")
public R deleteVideo(HttpServletRequest request,String videoPath){ public R deleteVideo(HttpServletRequest request,String videoPath){
if(videoPath==null||videoPath.equals("")){ if(videoPath==null||videoPath.equals("")){
return R.error("删除失败!"); return R.error("删除失败!");
@ -283,7 +282,7 @@ public class UploadController {
* @param resumePath * @param resumePath
* @return R * @return R
*/ */
@GetMapping("/delete_resume") @DeleteMapping("/delete_resume")
public R deleteResume(HttpServletRequest request,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("删除失败!");

View File

@ -4,6 +4,7 @@ import com.yzdx.AiInterviewer.comment.R;
import com.yzdx.AiInterviewer.entity.User; import com.yzdx.AiInterviewer.entity.User;
import com.yzdx.AiInterviewer.service.UserService; import com.yzdx.AiInterviewer.service.UserService;
import com.yzdx.AiInterviewer.utiles.JWT; import com.yzdx.AiInterviewer.utiles.JWT;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -12,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
@RequestMapping("/admin") @RequestMapping("/admin")
public class UserController { public class UserController {
@ -143,14 +143,13 @@ public class UserController {
/** /**
* 更新管理员信息 * 更新管理员信息
* @param deleteInfo 操作人的id删除人的id * @param userId 操作人的id
* @param deleteId 删除人的id
* @return R * @return R
*/ */
@PostMapping("/del_admin") @DeleteMapping("/del_admin")
public R deleteAdmin(@RequestBody @ApiParam("传入的值 deleteInfo:{(Integer)userId,(Integer)deleteId}") Map<String,Object> deleteInfo){ public R deleteAdmin(@ApiParam("传入的值 (Integer)userId,(Integer)deleteId")Integer deleteId,Integer userId){
Integer deleteId=(Integer) deleteInfo.get("deleteId");
Integer userId=(Integer) deleteInfo.get("userId");
Integer rows = userService.deleteAdmin(deleteId, userId); Integer rows = userService.deleteAdmin(deleteId, userId);
if(rows==-3){ if(rows==-3){