2023-11-30 03:16:47 +00:00
|
|
|
package com.yzdx.AiInterviewer.controller.VxController;
|
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
2023-11-30 03:16:47 +00:00
|
|
|
import com.yzdx.AiInterviewer.comment.R;
|
|
|
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
|
|
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxJobLikeDto;
|
|
|
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxCompanyLike;
|
|
|
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
|
|
|
import com.yzdx.AiInterviewer.service.JobListService;
|
|
|
|
import com.yzdx.AiInterviewer.service.VxService.VxJobLikeService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
import java.util.HashMap;
|
2023-11-30 03:16:47 +00:00
|
|
|
import java.util.List;
|
2023-12-02 01:09:41 +00:00
|
|
|
import java.util.Map;
|
2023-11-30 03:16:47 +00:00
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/vxJob")
|
|
|
|
public class VxJobController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private JobListService jobListService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private VxJobLikeService vxJobLikeService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private CompanyService companyService;
|
|
|
|
// @GetMapping("/search_job")
|
|
|
|
// public R searchJobList(String searchName,String address){
|
|
|
|
//
|
|
|
|
// jobListService.vxSearchJob( searchName, address);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
|
|
|
|
@GetMapping("/getJobLikeList")
|
|
|
|
public R getJobLikeList(Integer userId){
|
|
|
|
|
|
|
|
List<VxJobLikeDto> VxJobLikeDtos = vxJobLikeService.getJobLikeListById(userId);
|
|
|
|
|
|
|
|
return R.success(VxJobLikeDtos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/addJobLike")
|
|
|
|
public R addJobLike(@RequestParam(value = "jobId")Integer jobId,
|
|
|
|
@RequestParam(value = "userId")Integer userId){
|
|
|
|
|
|
|
|
Integer rows= vxJobLikeService.addJobLike(jobId,userId);
|
|
|
|
|
|
|
|
if(rows!=1){
|
|
|
|
return R.error("收藏失败");
|
|
|
|
}
|
|
|
|
return R.success("收藏成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
@GetMapping("/VxSearch")
|
|
|
|
public R searchList(String searchName,String address){
|
2023-11-30 03:16:47 +00:00
|
|
|
|
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
List<VxJobLikeDto> VxJobLikeDtos = jobListService.searchJobList(searchName,address);
|
2023-11-30 03:16:47 +00:00
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
List<VxCompanyLikeDto> VxCompanyLikeDtos = companyService.searchCompanyList(searchName,address);
|
2023-11-30 03:16:47 +00:00
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
Map<String ,Object> result=new HashMap<>();
|
2023-11-30 03:16:47 +00:00
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
result.put("company",VxCompanyLikeDtos);
|
|
|
|
result.put("job",VxJobLikeDtos);
|
2023-11-30 03:16:47 +00:00
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
return R.success(result);
|
2023-11-30 03:16:47 +00:00
|
|
|
|
|
|
|
}
|
2023-12-02 01:09:41 +00:00
|
|
|
|
2023-11-30 03:16:47 +00:00
|
|
|
}
|