76 lines
2.1 KiB
Java
76 lines
2.1 KiB
Java
|
package com.yzdx.AiInterviewer.controller.VxController;
|
||
|
|
||
|
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.*;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
@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("收藏成功");
|
||
|
|
||
|
}
|
||
|
@GetMapping("/searchJobList")
|
||
|
public R searchJobList(String searchName,String address){
|
||
|
|
||
|
|
||
|
List<VxJobLikeDto> VxJobLikeDtos = jobListService.searchJobList(searchName,address);
|
||
|
|
||
|
return R.success(VxJobLikeDtos);
|
||
|
|
||
|
}
|
||
|
|
||
|
@GetMapping("/searchCompanyList")
|
||
|
public R searchCompanyList(String searchName,String address){
|
||
|
|
||
|
|
||
|
List<VxCompanyLikeDto> VxCompanyLikeDtos = companyService.searchCompanyList(searchName,address);
|
||
|
|
||
|
return R.success(VxCompanyLikeDtos);
|
||
|
|
||
|
}
|
||
|
}
|