This commit is contained in:
parent
375ee8cce5
commit
b3d98c1fb8
|
@ -19,5 +19,4 @@ public class VxInterviewController {
|
|||
return R.success(vxCarouselChartService.getVxCarouselChartService());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,10 @@ 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.VxCompanyLikeService;
|
||||
import com.yzdx.AiInterviewer.service.VxService.VxJobLikeService;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -25,6 +28,9 @@ public class VxJobController {
|
|||
@Autowired
|
||||
private VxJobLikeService vxJobLikeService;
|
||||
|
||||
@Autowired
|
||||
private VxCompanyLikeService vxCompanyLikeService;
|
||||
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
// @GetMapping("/search_job")
|
||||
|
@ -35,6 +41,11 @@ public class VxJobController {
|
|||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取岗位关注列表
|
||||
* @param userId
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/getJobLikeList")
|
||||
public R getJobLikeList(Integer userId){
|
||||
|
||||
|
@ -44,6 +55,14 @@ public class VxJobController {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏岗位关注
|
||||
*
|
||||
*/
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "jobId",required = true),
|
||||
@ApiImplicitParam(name = "userId",required = true),
|
||||
})
|
||||
@PostMapping("/addJobLike")
|
||||
public R addJobLike(@RequestParam(value = "jobId")Integer jobId,
|
||||
@RequestParam(value = "userId")Integer userId){
|
||||
|
@ -57,10 +76,33 @@ public class VxJobController {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏企业关注
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@GetMapping("/VxSearch")
|
||||
public R searchList(String searchName,String address){
|
||||
|
||||
|
||||
List<VxJobLikeDto> VxJobLikeDtos = jobListService.searchJobList(searchName,address);
|
||||
|
||||
List<VxCompanyLikeDto> VxCompanyLikeDtos = companyService.searchCompanyList(searchName,address);
|
||||
|
@ -68,10 +110,10 @@ public class VxJobController {
|
|||
Map<String ,Object> result=new HashMap<>();
|
||||
|
||||
result.put("company",VxCompanyLikeDtos);
|
||||
|
||||
result.put("job",VxJobLikeDtos);
|
||||
|
||||
return R.success(result);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -267,6 +267,10 @@ public R getResume(Integer userId){
|
|||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 获取帮助列表
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/getHelpList")
|
||||
public R getHelpList(){
|
||||
|
||||
|
@ -276,12 +280,29 @@ public R getResume(Integer userId){
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业关注列表
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getCompanyLikeList")
|
||||
public R getCompanyLikeList(Integer userId){
|
||||
List<VxCompanyLikeDto> VxCompanyLikeDtos=vxCompanyLikeService.getCompanyLikeListById(userId);
|
||||
return R.success(VxCompanyLikeDtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* vx登录注册
|
||||
* @param phone
|
||||
* @param encoding
|
||||
* @param password
|
||||
* @return
|
||||
*/
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "phone",required = true),
|
||||
@ApiImplicitParam(name = "encoding",required = true),
|
||||
@ApiImplicitParam(name = "password",required = true),
|
||||
})
|
||||
@PostMapping("/VxAdminLogin")
|
||||
public R adminLogin(@RequestParam(required = true, value = "phone") String phone,
|
||||
@RequestParam(required = true, value = "encoding") String encoding,
|
||||
|
|
|
@ -9,4 +9,6 @@ import java.util.List;
|
|||
public interface VxCompanyLikeService extends IService<VxCompanyLike> {
|
||||
|
||||
List<VxCompanyLikeDto> getCompanyLikeListById(Integer userId);
|
||||
|
||||
Integer addCompanyLike(Integer companyId, Integer userId);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.yzdx.AiInterviewer.mapper.CompanyMapper;
|
|||
import com.yzdx.AiInterviewer.mapper.VxMapper.VxCompanyLikeMapper;
|
||||
import com.yzdx.AiInterviewer.service.JobListService;
|
||||
import com.yzdx.AiInterviewer.service.VxService.VxCompanyLikeService;
|
||||
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -27,7 +28,6 @@ public class VxCompanyLikeServiceImpl extends ServiceImpl<VxCompanyLikeMapper, V
|
|||
private CompanyMapper companyMapper;
|
||||
@Autowired
|
||||
private JobListService jobListService;
|
||||
|
||||
@Override
|
||||
public List<VxCompanyLikeDto> getCompanyLikeListById(Integer userId) {
|
||||
|
||||
|
@ -77,4 +77,21 @@ public class VxCompanyLikeServiceImpl extends ServiceImpl<VxCompanyLikeMapper, V
|
|||
}).collect(Collectors.toList());
|
||||
return vxCompanyLikeDtos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer addCompanyLike(Integer companyId, Integer userId) {
|
||||
LambdaQueryWrapper<VxCompanyLike> queryWrapper=new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(VxCompanyLike::getCompanyId,companyId);
|
||||
VxCompanyLike vxCompanyLike = vxCompanyLikeMapper.selectOne(queryWrapper);
|
||||
if(vxCompanyLike!=null){
|
||||
return -1;
|
||||
}
|
||||
VxCompanyLike vxCompanyLike1=new VxCompanyLike();
|
||||
vxCompanyLike1.setCompanyId(companyId);
|
||||
vxCompanyLike1.setUserId(userId);
|
||||
vxCompanyLike1.setCreateTime(TimeUtil.getTime());
|
||||
vxCompanyLike1.setCreateUser(userId);
|
||||
Integer row = vxCompanyLikeMapper.insert(vxCompanyLike1);
|
||||
return row;
|
||||
}
|
||||
}
|
|
@ -290,8 +290,8 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
|||
|
||||
List<JobEntity> jobEntities = jobMapper.selectList(queryWrapper);
|
||||
|
||||
|
||||
List<VxJobLikeDto> vxJobLikeDtoList=jobEntities.stream().map(item->{
|
||||
|
||||
VxJobLikeDto vxJobLikeDto=new VxJobLikeDto();
|
||||
|
||||
BeanUtils.copyProperties(item,vxJobLikeDto);
|
||||
|
@ -310,8 +310,8 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
|||
|
||||
vxJobLikeDto.setPosition(item.getAddressDetail());
|
||||
|
||||
|
||||
return vxJobLikeDto;
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return vxJobLikeDtoList;
|
||||
|
|
Loading…
Reference in New Issue