|
|
@@ -0,0 +1,112 @@
|
|
|
+package com.jpsoft.employment.modules.mobile.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.lang.Assert;
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResultBuilder;
|
|
|
+import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.employment.modules.common.utils.MapUtils;
|
|
|
+import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.job.entity.RecruitmentVO;
|
|
|
+import com.jpsoft.employment.modules.job.entity.ResumeVO;
|
|
|
+import com.jpsoft.employment.modules.job.service.RecruitmentCollectionService;
|
|
|
+import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.UserVO;
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("/mobile/recruiterApi")
|
|
|
+@Api(tags = "移动端接口:招聘方相关接口")
|
|
|
+public class RecruiterApiController {
|
|
|
+
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecruitmentService recruitmentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecruitmentCollectionService recruitmentCollectionService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("getAboutMe")
|
|
|
+ @ApiOperation(value = "招聘方['我的'主页]")
|
|
|
+ public MessageResult<Map> getAboutMe(@RequestAttribute String subject){
|
|
|
+ try{
|
|
|
+ //包含两部分信息:个人信息,统计信息
|
|
|
+ Assert.state(StringUtils.isNoneEmpty(subject),"缺少用户参数");
|
|
|
+ UserVO uv=userService.getUser(subject);
|
|
|
+ Map<String,Object> recCount=recruitmentService.rptMyRecruitmentCount(subject); //发布的招聘个数(不含已撤销的)
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ return MessageResultBuilder.error(ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("loadOwnRecruitments")
|
|
|
+ @ApiOperation(value = "招聘方[职位管理]")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "status", value = "招聘信息状态(publish:招聘中;approve:审核中;close:已下架)", required = true, paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> loadOwnRecruitments(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestParam(value="status",defaultValue="publish") String status,
|
|
|
+ @RequestAttribute String subject
|
|
|
+ ) {
|
|
|
+
|
|
|
+ try{
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("update_time","desc"));
|
|
|
+ Page<RecruitmentVO> page = recruitmentService.loadForRecruiter(MapUtils.builder("recruiter",subject,"status",status),pageIndex,pageSize,true,sortList);
|
|
|
+ return MessageResultBuilder.ok(PojoUtils.pageWrapper(page));
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ return MessageResultBuilder.error(ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("loadCollectResumes")
|
|
|
+ @ApiOperation(value = "招聘方[收藏简历]")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "positionName", value = "职位名称关键字", required = false, paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> loadCollectResumes(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestParam(value="positionName",required = false) String positionName,
|
|
|
+ @RequestAttribute String subject
|
|
|
+ ) {
|
|
|
+
|
|
|
+ try{
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("update_time","desc"));
|
|
|
+ Page<ResumeVO> page = recruitmentCollectionService.pagedLoad(MapUtils.builder("recruiter",subject,"positionName",positionName),pageIndex,pageSize,true,sortList);
|
|
|
+ return MessageResultBuilder.ok(PojoUtils.pageWrapper(page));
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ return MessageResultBuilder.error(ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|