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;
|
2023-12-04 08:04:54 +00:00
|
|
|
import com.yzdx.AiInterviewer.service.VxService.VxCompanyLikeService;
|
2023-11-30 03:16:47 +00:00
|
|
|
import com.yzdx.AiInterviewer.service.VxService.VxJobLikeService;
|
2023-12-04 08:04:54 +00:00
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
2023-11-30 03:16:47 +00:00
|
|
|
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;
|
|
|
|
|
2023-12-04 08:04:54 +00:00
|
|
|
@Autowired
|
|
|
|
private VxCompanyLikeService vxCompanyLikeService;
|
|
|
|
|
2023-11-30 03:16:47 +00:00
|
|
|
@Autowired
|
|
|
|
private CompanyService companyService;
|
|
|
|
// @GetMapping("/search_job")
|
|
|
|
// public R searchJobList(String searchName,String address){
|
|
|
|
//
|
|
|
|
// jobListService.vxSearchJob( searchName, address);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
|
2023-12-04 08:04:54 +00:00
|
|
|
/**
|
|
|
|
* 获取岗位关注列表
|
|
|
|
* @param userId
|
|
|
|
* @return R
|
|
|
|
*/
|
2023-11-30 03:16:47 +00:00
|
|
|
@GetMapping("/getJobLikeList")
|
|
|
|
public R getJobLikeList(Integer userId){
|
|
|
|
|
|
|
|
List<VxJobLikeDto> VxJobLikeDtos = vxJobLikeService.getJobLikeListById(userId);
|
|
|
|
|
|
|
|
return R.success(VxJobLikeDtos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-12-04 08:04:54 +00:00
|
|
|
/**
|
|
|
|
* 收藏岗位关注
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(name = "jobId",required = true),
|
|
|
|
@ApiImplicitParam(name = "userId",required = true),
|
|
|
|
})
|
2023-11-30 03:16:47 +00:00
|
|
|
@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-04 08:04:54 +00:00
|
|
|
/**
|
|
|
|
* 收藏企业关注
|
|
|
|
*/
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(name = "companyId",required = true),
|
|
|
|
@ApiImplicitParam(name = "userId",required = true),
|
|
|
|
})
|
|
|
|
@PostMapping("/addCompanyLike")
|
|
|
|
public R addCompanyLike(@RequestParam(value = "companyId")Integer companyId,
|
|
|
|
@RequestParam(value = "userId")Integer userId){
|
|
|
|
Integer rows=vxCompanyLikeService.addCompanyLike(companyId,userId);
|
|
|
|
|
|
|
|
if(rows!=-1){
|
|
|
|
return R.error("收藏失败");
|
|
|
|
}
|
|
|
|
return R.success("收藏成功");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* vx搜索岗位和企业
|
|
|
|
* @param searchName
|
|
|
|
* @param address
|
|
|
|
* @return R
|
|
|
|
*/
|
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);
|
2023-12-04 08:04:54 +00:00
|
|
|
|
2023-12-02 01:09:41 +00:00
|
|
|
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
|
|
|
}
|