Commit dc008f5e by 284718418@qq.com

8小时简历助手

parent 34c7bbf1
package cn.timer.api.bean.extension;
import lombok.Data;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/14
*/
@Data
public class Core {
private String login;
private String publishJobPos;
}
package cn.timer.api.bean.extension;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
*/
@Data
@ApiModel
public class ExtensionCompany implements Serializable {
/**
* 成功标志
*/
@ApiModelProperty(value = "成功标志 ", example = "成功标志")
private boolean valid;
/**
* 企业名称
*/
@ApiModelProperty(value = "企业名称 ", example = "企业名称")
private String company_name;
}
package cn.timer.api.bean.extension;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
*/
@Data
@ApiModel
public class JobConfig implements Serializable {
private Core core;
private Message message;
private boolean disabled = false;
}
package cn.timer.api.bean.extension;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
*/
@Data
@ApiModel
public class JobPositions implements Serializable {
private String id;
@ApiModelProperty(value = "用人部门名称", example = "用人部门名称")
private String dep_name;
@ApiModelProperty(value = "用人部门ID", example = "用人部门ID")
private String dep_id;
@ApiModelProperty(value = "职位名称", example = "职位名称")
private String name;
@ApiModelProperty(value = "工作城市", example = "省")
private String province_name;
@ApiModelProperty(value = "工作城市", example = "市")
private String city_name;
@ApiModelProperty(value = "工作城市", example = "区")
private String town_name;
@ApiModelProperty(value = "工作地点", example = "工作地点")
private String work_place_name;
private Integer status;
}
package cn.timer.api.bean.extension;
import lombok.Data;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/14
*/
@Data
public class Message {
private String RESUME_ZHAOPIN_NOPUBPOS_NONE_AREA = "请在智联招聘上发布职位!";
private String RESUME_PARSE_SUCCESS = "简历解析成功!";
private String RESUME_IMPROVE_BASE_INFO = "请完善个人信息";
private String PAGE_LOADING = "页面加载中,请稍候重试!";
private String RESUME_ZHAOPIN_SEARCH_NONE_AREA = "请调整简历搜索条件!";
private String RESUME_PARSE_NOT_SUPPORT_EN_LANG = "英文简历暂不支持,请切换到中文简历";
private String RESUME_PARSE_WARNING_51JOB_NO_INFO = "简历页面请切换回【简历详情】选项卡!";
private String RESUME_NO_CONTACT = "不支持未购买或未下载的简历,请先确认已获取简历的联系方式";
private String RESUME_SAVE_FAILED = "简历保存失败!";
private String RESUME_SAVE_SUCCESS = "简历保存成功!";
private String RESUME_ZHAOPIN_RESLIST_NOT_SUPPORT = "列表视图不支持简历解析,请切换到详细视图或打开简历详情页查看";
private String RESUME_LOADING = "简历加载中,请稍候重试!";
private String RESUME_NOT_SUPPORT = "无法提取当前页面信息,请在智联招聘、前程无忧、拉勾网、 猎聘网、BOSS直聘中打开简历。";
private String RESUME_ZHAOPIN_NOSUIT_NONE_AREA = "当前页面无简历!";
private String RESUME_NOT_SAVED_TIPS = "简历数据未保存,继续解析将进行覆盖!";
private String RESUME_PARSE_ERROR = "简历解析失败!";
private String RESUME_LAGOU_TRANSFER_ERROR = "简历转换失败,请刷新页面重试";
private String RESUME_NO_PERMISSION_LAGOU = "请登录拉勾网!";
private String RESUME_ZHAOPIN_DAVE_JS_NONE_AREA = "当前页面无简历!";
private String CONNECTION_FAILED = "连接中断,请刷新简历页面!";
private String RESUME_ZHAOPIN_DAVE_JS_ERROR_AREA = "智联招聘服务器出小差了,请稍后再试!";
}
package cn.timer.api.bean.extension;
import lombok.Data;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/14
*/
@Data
public class System {
private int content_post_message_timeout= 25000;
private int latest_version_fetch_interval= 900000;
private int core_api_fetch_interval= 600000;
private int jobposition_fetch_interval= 60000;
private boolean job_position_filterable= true;
private double smart_match_job_position_rate= 0.7;
}
package cn.timer.api.controller.extension;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.extension.ExtensionCompany;
import cn.timer.api.bean.extension.JobPositions;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.utils.ExtensionResult;
import cn.timer.api.utils.ExtensionResultUtil;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
*/
@RestController
@Api(tags = "1.0简历助手登陆")
@Transactional
@RequestMapping(value = "/api/recruitment", produces = { "application/json" })
public class ExtensionLoginController {
@Autowired
private HttpSession session;
@Resource
private HttpServletRequest httpServletRequest;
/**
* token令牌获取企业信息,绑定企业
*
* @param token
* @return
*/
@GetMapping(value = "/api/resume_assistant/valid_token")
@ApiOperation(value = "1.token令牌获取企业信息,绑定企业", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
@Log(title = "token令牌获取企业信息,绑定企业", businessType = BusinessType.OTHER)
public ExtensionResult valid_token(@RequestParam("token") String token) {
session.setAttribute("ui", token);
ExtensionCompany entity = new ExtensionCompany();
entity.setValid(Boolean.TRUE);
entity.setCompany_name("广东优领科技服务有限公司");
return ExtensionResultUtil.data(entity);
}
/**
* token令牌获取在招职位数据
* @return
*/
@GetMapping(value = "/api/resume_assistant/job_positions")
@ApiOperation(value = "2.token令牌获取企业信息,绑定企业", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 2)
@Log(title = "token令牌获取企业信息,绑定企业", businessType = BusinessType.OTHER)
public ExtensionResult job_positions() {
String token = "",version="";
if (StringUtils.isEmpty(httpServletRequest.getHeader("accesstoken"))) {
token = httpServletRequest.getHeader("accesstoken");
}
if(StringUtils.isEmpty(httpServletRequest.getHeader("assistant_version"))){
version = httpServletRequest.getHeader("assistant_version");
}
List<JobPositions> list = new ArrayList<>();
JobPositions entity = new JobPositions();
entity.setId("c2206616-ff93-4a9a-b03c-770c58339bae");
entity.setCity_name("广州");
entity.setDep_id("58782bf9-3dd6-4bfa-8f00-efd87576a572");
entity.setDep_name("企划部");
entity.setName("程序员");
entity.setProvince_name("广东");
entity.setStatus(1);
entity.setTown_name("白云区");
entity.setWork_place_name("A写字楼");
list.add(entity);
return ExtensionResultUtil.data(list);
}
/**
* 获取配置信息
* @return
*/
@GetMapping(value = "/api/resume_assistant/config_v2")
@ApiOperation(value = "3.获取配置信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
@Log(title = "获取配置信息", businessType = BusinessType.OTHER)
public ExtensionResult config_v2(@RequestParam("type") String type) {
String token = "",version="";
if (StringUtils.isEmpty(httpServletRequest.getHeader("accesstoken"))) {
token = httpServletRequest.getHeader("accesstoken");
}
if(StringUtils.isEmpty(httpServletRequest.getHeader("assistant_version"))){
version = httpServletRequest.getHeader("assistant_version");
}
List<JobPositions> list = new ArrayList<>();
JobPositions entity = new JobPositions();
entity.setId("c2206616-ff93-4a9a-b03c-770c58339bae");
entity.setCity_name("广州");
entity.setDep_id("58782bf9-3dd6-4bfa-8f00-efd87576a572");
entity.setDep_name("企划部");
entity.setName("程序员");
entity.setProvince_name("广东");
entity.setStatus(1);
entity.setTown_name("白云区");
entity.setWork_place_name("A写字楼");
list.add(entity);
return ExtensionResultUtil.data(list);
}
}
package cn.timer.api.utils;
import lombok.Data;
import org.springframework.stereotype.Service;
import java.io.Serializable;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
* 简历助手前后端交互数据标准
*/
@Service("extensionResult")
@Data
public class ExtensionResult<T> implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 成功标志
*/
private boolean result;
/**
* 消息
*/
private String msg;
/**
* 失败消息
*/
private String errormsg;
/**
* 返回代码
*/
private Integer resultcode;
/**
* 时间戳
*/
private long timestamp = System.currentTimeMillis();
/**
* 结果对象
*/
private T data;
}
package cn.timer.api.utils;
import org.springframework.stereotype.Service;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/12/13
*/
@Service("extensionResultUtil")
public class ExtensionResultUtil<T> {
// private static final String CODE_KEY = "code";
// private static final String RESULT_KEY = "result";
// private static final String MESSAGE_KEY = "message";
// private static final String DATA_KEY = "data";
//
// private static final String PAGE_KEY = "page";
// private static final String NUMBER_KEY = "number";
// private static final String SIZE_KEY = "size";
// private static final String TOTALELEMENTS_KEY = "totalelements";
// private static final String TOTALPAGES_KEY = "totalpages";
// private static final String OFFSET_KEY = "offset";
private static final String MESSAGE_SUCCESS = "操作成功";
private static final String MESSAGE_FAIL = "操作失败";
// private static final String MESSAGE_ERROR = "操作错误";
// private static final String MESSAGE_KICKOUT = "当前账户已在其他地方登录,请重新登录";
private static final String MESSAGE_PARAMERROR = "参数错误";
// private static final String MESSAGE_UNAUTHORIZED = "授权错误";
// private static final String MESSAGE_UNAUTHENTICATED = "认证错误";
// private static final String MESSAGE_EXCEPTION = "服务器异常";
private static final Integer STATUS_CODE_SUCCESS = 200;
private static final Integer STATUS_CODE_UNLOGIN = 301;
private static final Integer STATUS_CODE_UNPARAM = 400;
private static final Integer STATUS_CODE_EXCEPTION = 500;
private ExtensionResult<T> extensionResult;
public ExtensionResultUtil() {
extensionResult = new ExtensionResult<>();
extensionResult.setResult(true);
extensionResult.setMsg("success");
extensionResult.setResultcode(STATUS_CODE_SUCCESS);
}
public ExtensionResult<T> setData(T t) {
this.extensionResult.setData(t);
this.extensionResult.setResultcode(STATUS_CODE_SUCCESS);
this.extensionResult.setMsg("success");
return this.extensionResult;
}
public ExtensionResult<T> setSuccessMsg(String msg) {
this.extensionResult.setResult(true);
this.extensionResult.setResultcode(STATUS_CODE_SUCCESS);
this.extensionResult.setMsg(msg);
this.extensionResult.setData(null);
return this.extensionResult;
}
public ExtensionResult<T> setData(T t, String msg) {
this.extensionResult.setData(t);
this.extensionResult.setResultcode(STATUS_CODE_SUCCESS);
this.extensionResult.setMsg(msg);
return this.extensionResult;
}
public ExtensionResult<T> setErrorMsg(T t) {
this.extensionResult.setData(t);
this.extensionResult.setResultcode(STATUS_CODE_UNPARAM);
this.extensionResult.setErrormsg(MESSAGE_PARAMERROR);
return this.extensionResult;
}
public ExtensionResult<T> setErrorMsg(String msg) {
this.extensionResult.setResult(false);
this.extensionResult.setErrormsg(msg);
this.extensionResult.setResultcode(STATUS_CODE_EXCEPTION);
return this.extensionResult;
}
public ExtensionResult<T> setErrorMsg(Integer code, String msg) {
this.extensionResult.setResult(false);
this.extensionResult.setErrormsg(msg);
this.extensionResult.setResultcode(code);
return this.extensionResult;
}
public static <T> ExtensionResult<T> data(T t) {
return new ExtensionResultUtil<T>().setData(t);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment