|
@@ -0,0 +1,77 @@
|
|
|
|
|
+package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
+
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
|
|
+import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
|
|
+import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
|
|
+import com.jpsoft.employment.modules.job.entity.Recruitment;
|
|
|
|
|
+import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
|
|
|
+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 javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/mobile/recruitmentApi")
|
|
|
|
|
+@Api(description = "移动端职位接口")
|
|
|
|
|
+public class RecruitmentApiController {
|
|
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RecruitmentService recruitmentService;
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("getRecruitmentList")
|
|
|
|
|
+ @ApiOperation(value = "职位列表")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ public MessageResult<Map> getRecruitmentList(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
|
+
|
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
+ searchParams.put("createBy", subject);
|
|
|
|
|
+
|
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
|
+ int tabId = 0;
|
|
|
|
|
+ switch (tabId) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ sortList.add(new Sort("createTime","asc"));
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ sortList.add(new Sort("readingTimes","desc"));
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
+
|
|
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
|
+ messageResult.setCode(200);
|
|
|
|
|
+ messageResult.setMessage("查询成功");
|
|
|
|
|
+ messageResult.setResult(true);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ messageResult.setCode(400);
|
|
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
|
|
+ messageResult.setResult(false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return messageResult;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|