智联招聘校招对接
parent
04410771e1
commit
b690938746
@ -0,0 +1,49 @@
|
||||
package com.weaver.recruit.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/25
|
||||
* @description:
|
||||
*/
|
||||
public class RecruitFileObj implements Serializable {
|
||||
private static final long serialVersionUID = -5640565905520711005L;
|
||||
|
||||
//文件流
|
||||
@ApiModelProperty("文件流")
|
||||
private InputStream inputStream;
|
||||
//文件后缀名
|
||||
@ApiModelProperty("文件后缀名")
|
||||
private String extName;
|
||||
//附件名
|
||||
@ApiModelProperty("附件名")
|
||||
private String fileName;
|
||||
|
||||
public InputStream getInputStream() {
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
public void setInputStream(InputStream inputStream) {
|
||||
this.inputStream = inputStream;
|
||||
}
|
||||
|
||||
public String getExtName() {
|
||||
return extName;
|
||||
}
|
||||
|
||||
public void setExtName(String extName) {
|
||||
this.extName = extName;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.weaver.recruit.entity;
|
||||
|
||||
import com.weaver.recruit.enums.PoliticsStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/19
|
||||
* @description:
|
||||
*/
|
||||
public class RecruitJtgxObj implements Serializable {
|
||||
private static final long serialVersionUID = -7947025861540179649L;
|
||||
|
||||
//亲属姓名
|
||||
@ApiModelProperty("亲属姓名")
|
||||
private String relativesName;
|
||||
//亲属关系
|
||||
@ApiModelProperty("亲属关系")
|
||||
private String kinship;
|
||||
//亲属工作单位
|
||||
@ApiModelProperty("亲属工作单位")
|
||||
private String relativesWork;
|
||||
//亲属职位
|
||||
@ApiModelProperty("亲属职位")
|
||||
private String relativesPosition;
|
||||
//年龄:数字,非纯数字请转换或不填
|
||||
@ApiModelProperty("年龄")
|
||||
private String relativesAge;
|
||||
//亲属职位
|
||||
@ApiModelProperty("联系电话")
|
||||
private String relativesPhone;
|
||||
//政治面貌
|
||||
@ApiModelProperty("政治面貌")
|
||||
private PoliticsStatusEnum relativesPolitics;
|
||||
|
||||
public String getRelativesName() {
|
||||
return relativesName;
|
||||
}
|
||||
|
||||
public void setRelativesName(String relativesName) {
|
||||
this.relativesName = relativesName;
|
||||
}
|
||||
|
||||
public String getKinship() {
|
||||
return kinship;
|
||||
}
|
||||
|
||||
public void setKinship(String kinship) {
|
||||
this.kinship = kinship;
|
||||
}
|
||||
|
||||
public String getRelativesWork() {
|
||||
return relativesWork;
|
||||
}
|
||||
|
||||
public void setRelativesWork(String relativesWork) {
|
||||
this.relativesWork = relativesWork;
|
||||
}
|
||||
|
||||
public String getRelativesPosition() {
|
||||
return relativesPosition;
|
||||
}
|
||||
|
||||
public void setRelativesPosition(String relativesPosition) {
|
||||
this.relativesPosition = relativesPosition;
|
||||
}
|
||||
|
||||
public String getRelativesAge() {
|
||||
return relativesAge;
|
||||
}
|
||||
|
||||
public void setRelativesAge(String relativesAge) {
|
||||
this.relativesAge = relativesAge;
|
||||
}
|
||||
|
||||
public String getRelativesPhone() {
|
||||
return relativesPhone;
|
||||
}
|
||||
|
||||
public void setRelativesPhone(String relativesPhone) {
|
||||
this.relativesPhone = relativesPhone;
|
||||
}
|
||||
|
||||
public PoliticsStatusEnum getRelativesPolitics() {
|
||||
return relativesPolitics;
|
||||
}
|
||||
|
||||
public void setRelativesPolitics(PoliticsStatusEnum relativesPolitics) {
|
||||
this.relativesPolitics = relativesPolitics;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/19
|
||||
* @description:
|
||||
*/
|
||||
public enum AbilityEnum {
|
||||
NORMAL("840812592208560134", "一般"),
|
||||
GOOD("840812592208560133", "良好"),
|
||||
PRACTISED("840812592208560132", "熟练"),
|
||||
PROFICIENT("840812592208560130", "精通");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
AbilityEnum(String key, String name) {
|
||||
this.Key = key;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static AbilityEnum getByName(String name) {
|
||||
AbilityEnum[] selcTypes = values();
|
||||
for (AbilityEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/19
|
||||
* @description:
|
||||
*/
|
||||
public enum BooleanEnum {
|
||||
TRUE("1", "是"),
|
||||
FALSE("0", "否");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
BooleanEnum(String key, String name) {
|
||||
this.Key = key;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static BooleanEnum getByName(String name) {
|
||||
BooleanEnum[] selcTypes = values();
|
||||
for (BooleanEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum CadreNameEnum {
|
||||
ZX("0", "主席"),
|
||||
FZX("1", "副主席"),
|
||||
ZXZL("2", "主席助理"),
|
||||
MSZ("3", "秘书长"),
|
||||
SJ("4", "书记"),
|
||||
SZ("5", "社长"),
|
||||
XSHBZ("6", "部长"),
|
||||
BZ("7", "班长"),
|
||||
GS("8", "干事"),
|
||||
QT("9", "其他");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
CadreNameEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static CadreNameEnum getByName(String name) {
|
||||
CadreNameEnum[] selcTypes = values();
|
||||
for (CadreNameEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum CadreRankEnum {
|
||||
TW("0", "团委"),
|
||||
XXSH("1", "校学生会"),
|
||||
YXSH("2", "院学生会"),
|
||||
XSST("3", "学生社团"),
|
||||
BJ("4", "班级");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
CadreRankEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static CadreRankEnum getByName(String name) {
|
||||
CadreRankEnum[] selcTypes = values();
|
||||
for (CadreRankEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum CertificateTypeEnum {
|
||||
SFZ("1", "身份证"),
|
||||
QT("0", "其他");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
CertificateTypeEnum(String key, String name) {
|
||||
this.Key = key;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static CertificateTypeEnum getByName(String name) {
|
||||
CertificateTypeEnum[] selcTypes = values();
|
||||
for (CertificateTypeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum DegreeEnum {
|
||||
BS("0", "博士"),
|
||||
MBA("1", "MBA"),
|
||||
SS("2", "硕士"),
|
||||
SXS("3", "双学士"),
|
||||
XS("4", "学士"),
|
||||
QT("5", "其他"),
|
||||
W("6", "无");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
DegreeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static DegreeEnum getByName(String name) {
|
||||
DegreeEnum[] selcTypes = values();
|
||||
for (DegreeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum EducationTypeEnum {
|
||||
QRZTFZP("0", "全日制统分招聘"),
|
||||
HWLX("1", "海外留学"),
|
||||
CRJY("2", "成人教育"),
|
||||
DX("3", "定向"),
|
||||
FDX("4", "非定向"),
|
||||
WP("5", "委培"),
|
||||
ZF("6", "自费"),
|
||||
QT("7", "其他");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
EducationTypeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static EducationTypeEnum getByName(String name) {
|
||||
EducationTypeEnum[] selcTypes = values();
|
||||
for (EducationTypeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum EnglishLevelEnum {
|
||||
CET4("0", "CET4"),
|
||||
TEM4("1", "TEM4"),
|
||||
CET6("2", "CET6"),
|
||||
TEM8("3", "TEM8"),
|
||||
WCJ("4", "未参加");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
EnglishLevelEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static EnglishLevelEnum getByName(String name) {
|
||||
EnglishLevelEnum[] selcTypes = values();
|
||||
for (EnglishLevelEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum FdDegreeEnum {
|
||||
BSYJS("0", "博士研究生"),
|
||||
MBA("1", "MBA"),
|
||||
DXBK("2", "大学本科"),
|
||||
DXZK("3", "大学专科"),
|
||||
ZZ("4", "中专/技校/职高"),
|
||||
GZ("5", "高中"),
|
||||
CZ("6", "初中");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
FdDegreeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static FdDegreeEnum getByName(String name) {
|
||||
FdDegreeEnum[] selcTypes = values();
|
||||
for (FdDegreeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum HdDegreeEnum {
|
||||
BSYJS("0", "博士研究生"),
|
||||
MBA("1", "MBA"),
|
||||
SSYJS("2", "硕士研究生"),
|
||||
DXBK("3", "大学本科"),
|
||||
DXZK("4", "大学专科"),
|
||||
ZZ("5", "中专/技校/职高"),
|
||||
GZ("6", "高中"),
|
||||
CZ("7", "初中"),
|
||||
QT("8", "其他");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
HdDegreeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static HdDegreeEnum getByName(String name) {
|
||||
HdDegreeEnum[] selcTypes = values();
|
||||
for (HdDegreeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum HealthEnum {
|
||||
JK("0", "健康"),
|
||||
QT("1", "其他");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
HealthEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static HealthEnum getByName(String name) {
|
||||
HealthEnum[] selcTypes = values();
|
||||
for (HealthEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum MaritalStatusEnum {
|
||||
WH("0", "未婚"),
|
||||
YH("1", "已婚"),
|
||||
LY("2", "离异"),
|
||||
BM("3", "保密");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
MaritalStatusEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static MaritalStatusEnum getByName(String name) {
|
||||
MaritalStatusEnum[] selcTypes = values();
|
||||
for (MaritalStatusEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum PoliticsStatusEnum {
|
||||
TY("0", "团员"),
|
||||
ZGDY("1", "中共党员(含预备党员)"),
|
||||
MZDP("2", "民主党派"),
|
||||
WDPRS("3", "无党派人士"),
|
||||
QZ("4", "群众");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
PoliticsStatusEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static PoliticsStatusEnum getByName(String name) {
|
||||
PoliticsStatusEnum[] selcTypes = values();
|
||||
for (PoliticsStatusEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/25
|
||||
* @description:
|
||||
*/
|
||||
public enum ResumeTypeEnum {
|
||||
SZ("0", "社招"),
|
||||
XZ("1", "校招");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
ResumeTypeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static ResumeTypeEnum getByName(String name) {
|
||||
ResumeTypeEnum[] selcTypes = values();
|
||||
for (ResumeTypeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.weaver.recruit.enums;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/20
|
||||
* @description:
|
||||
*/
|
||||
public enum WorkTypeEnum {
|
||||
QZ("0", "全职"),
|
||||
JZ("1", "兼职"),
|
||||
SX("2", "实习");
|
||||
|
||||
private final String Key;
|
||||
|
||||
private final String Name;
|
||||
|
||||
WorkTypeEnum(String key, String name) {
|
||||
Key = key;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return Key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static WorkTypeEnum getByName(String name) {
|
||||
WorkTypeEnum[] selcTypes = values();
|
||||
for (WorkTypeEnum selcType : selcTypes) {
|
||||
if (selcType.getName().equals(name)) {
|
||||
return selcType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.weaver.recruit.rest;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.recruit.entity.RecruitTalentObj;
|
||||
|
||||
/**
|
||||
* @author: YH
|
||||
* @createDate: 2023/9/18
|
||||
* @description:
|
||||
*/
|
||||
public interface RecruitCandidateRemoteService {
|
||||
|
||||
WeaResult createCandidateByThird(String tenantKey, String operatorId, RecruitTalentObj obj);
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,402 @@
|
||||
|
||||
package com.weaver.sxjg.util;
|
||||
import com.weaver.common.security.util.StringUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 获取文件 content-type工具类
|
||||
*/
|
||||
public class ContentTypeUtil {
|
||||
|
||||
private static Map<String, String> map = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* @param fileName 文件名
|
||||
* @return
|
||||
*/
|
||||
public static String getContentTypeByFileName(String fileName) {
|
||||
String result = map.get("anno");
|
||||
fileName = StringUtil.null2String(fileName);
|
||||
int index = fileName.lastIndexOf(".");
|
||||
if (!fileName.isEmpty() && index != -1) {
|
||||
result = getContentType(fileName.substring(index).toLowerCase());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileExt 文件扩展名
|
||||
* @return
|
||||
*/
|
||||
public static String getContentType(String fileExt) {
|
||||
String result = map.get("anno");
|
||||
fileExt = StringUtil.null2String(fileExt);
|
||||
if (!fileExt.isEmpty()) {
|
||||
fileExt = fileExt.contains(".") ? fileExt : "." + fileExt;
|
||||
result = map.get(fileExt);
|
||||
if (result == null) {
|
||||
result = map.get("anno");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static {
|
||||
map.put("anno", "application/octet-stream");
|
||||
map.put(".tif", "image/tiff");
|
||||
map.put("0.001", "application/x-001");
|
||||
map.put("0.301", "application/x-301");
|
||||
map.put("0.323", "text/h323");
|
||||
map.put("0.906", "application/x-906");
|
||||
map.put("0.907", "drawing/907");
|
||||
|
||||
map.put(".a11", "application/x-a11");
|
||||
map.put(".acp", "audio/x-mei-aac");
|
||||
map.put(".ai", "application/postscript");
|
||||
map.put(".aif", "audio/aiff");
|
||||
map.put(".aifc", "audio/aiff");
|
||||
map.put(".aiff", "audio/aiff");
|
||||
map.put(".anv", "application/x-anv");
|
||||
map.put(".asa", "text/asa");
|
||||
map.put(".asf", "video/x-ms-asf");
|
||||
map.put(".asp", "text/asp");
|
||||
map.put(".asx", "video/x-ms-asf");
|
||||
map.put(".au", "audio/basic");
|
||||
map.put(".avi", "video/avi");
|
||||
map.put(".awf", "application/vnd.adobe.workflow");
|
||||
|
||||
map.put(".biz", "text/xml");
|
||||
map.put(".bmp", "application/x-bmp");
|
||||
map.put(".bot", "application/x-bot");
|
||||
|
||||
map.put(".c4t", "application/x-c4t");
|
||||
map.put(".c90", "application/x-c90");
|
||||
map.put(".cal", "application/x-cals");
|
||||
map.put(".cat", "application/vnd.ms-pki.seccat");
|
||||
map.put(".cdf", "application/x-netcdf");
|
||||
map.put(".cdr", "application/x-cdr");
|
||||
map.put(".cel", "application/x-cel");
|
||||
map.put(".cer", "application/x-x509-ca-cert");
|
||||
map.put(".cg4", "application/x-g4");
|
||||
map.put(".cgm", "application/x-cgm");
|
||||
map.put(".cit", "application/x-cit");
|
||||
map.put(".class", "java/");
|
||||
map.put(".cml", "text/xml");
|
||||
map.put(".cmp", "application/x-cmp");
|
||||
map.put(".cmx", "application/x-cmx");
|
||||
map.put(".cot", "application/x-cot");
|
||||
map.put(".crl", "application/pkix-crl");
|
||||
map.put(".crt", "application/x-x509-ca-cert");
|
||||
map.put(".csi", "application/x-csi");
|
||||
map.put(".css", "text/css");
|
||||
map.put(".cut", "application/x-cut");
|
||||
|
||||
map.put(".dbf", "application/x-dbf");
|
||||
map.put(".dbm", "application/x-dbm");
|
||||
map.put(".dbx", "application/x-dbx");
|
||||
map.put(".dcd", "text/xml");
|
||||
map.put(".dcx", "application/x-dcx");
|
||||
map.put(".der", "application/x-x509-ca-cert");
|
||||
map.put(".dgn", "application/x-dgn");
|
||||
map.put(".dib", "application/x-dib");
|
||||
map.put(".dll", "application/x-msdownload");
|
||||
map.put(".doc", "application/msword");
|
||||
map.put(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
map.put(".dot", "application/msword");
|
||||
map.put(".drw", "application/x-drw");
|
||||
map.put(".dtd", "text/xml");
|
||||
map.put(".dwf", "Model/vnd.dwf");
|
||||
map.put(".dwf", "application/x-dwf");
|
||||
map.put(".dwg", "application/x-dwg");
|
||||
map.put(".dxb", "application/x-dxb");
|
||||
map.put(".dxf", "application/x-dxf");
|
||||
map.put(".edn", "application/vnd.adobe.edn");
|
||||
|
||||
map.put(".emf", "application/x-emf");
|
||||
map.put(".eml", "message/rfc822");
|
||||
map.put(".ent", "text/xml");
|
||||
map.put(".epi", "application/x-epi");
|
||||
map.put(".eps", "application/x-ps");
|
||||
map.put(".eps", "application/postscript");
|
||||
map.put(".etd", "application/x-ebx");
|
||||
map.put(".exe", "application/x-msdownload");
|
||||
map.put(".fax", "image/fax");
|
||||
map.put(".fdf", "application/vnd.fdf");
|
||||
map.put(".fif", "application/fractals");
|
||||
map.put(".fo", "text/xml");
|
||||
map.put(".frm", "application/x-frm");
|
||||
map.put(".g4", "application/x-g4");
|
||||
map.put(".gbr", "application/x-gbr");
|
||||
map.put(".", "application/x-");
|
||||
map.put(".gif", "image/gif");
|
||||
map.put(".gl2", "application/x-gl2");
|
||||
map.put(".gp4", "application/x-gp4");
|
||||
map.put(".hgl", "application/x-hgl");
|
||||
map.put(".hmr", "application/x-hmr");
|
||||
map.put(".hpg", "application/x-hpgl");
|
||||
map.put(".hpl", "application/x-hpl");
|
||||
map.put(".hqx", "application/mac-binhex40");
|
||||
map.put(".hrf", "application/x-hrf");
|
||||
map.put(".hta", "application/hta");
|
||||
map.put(".htc", "text/x-component");
|
||||
map.put(".htm", "text/html");
|
||||
map.put(".html", "text/html");
|
||||
map.put(".htt", "text/webviewhtml");
|
||||
map.put(".htx", "text/html");
|
||||
map.put(".icb", "application/x-icb");
|
||||
map.put(".ico", "image/x-icon");
|
||||
map.put(".ico", "application/x-ico");
|
||||
map.put(".iff", "application/x-iff");
|
||||
map.put(".ig4", "application/x-g4");
|
||||
map.put(".igs", "application/x-igs");
|
||||
map.put(".iii", "application/x-iphone");
|
||||
map.put(".img", "application/x-img");
|
||||
map.put(".ins", "application/x-internet-signup");
|
||||
map.put(".isp", "application/x-internet-signup");
|
||||
map.put(".IVF", "video/x-ivf");
|
||||
map.put(".java", "java/*");
|
||||
map.put(".jfif", "image/jpeg");
|
||||
map.put(".jpe", "image/jpeg");
|
||||
map.put(".jpe", "application/x-jpe");
|
||||
map.put(".jpeg", "image/jpeg");
|
||||
map.put(".jpg", "image/jpeg");
|
||||
map.put(".jpg", "application/x-jpg");
|
||||
map.put(".js", "application/x-javascript");
|
||||
map.put(".jsp", "text/html");
|
||||
map.put(".la1", "audio/x-liquid-file");
|
||||
map.put(".lar", "application/x-laplayer-reg");
|
||||
map.put(".latex", "application/x-latex");
|
||||
map.put(".lavs", "audio/x-liquid-secure");
|
||||
map.put(".lbm", "application/x-lbm");
|
||||
map.put(".lmsff", "audio/x-la-lms");
|
||||
map.put(".ls", "application/x-javascript");
|
||||
map.put(".ltr", "application/x-ltr");
|
||||
map.put(".m1v", "video/x-mpeg");
|
||||
map.put(".m2v", "video/x-mpeg");
|
||||
map.put(".m3u", "audio/mpegurl");
|
||||
map.put(".m4e", "video/mpeg4");
|
||||
map.put(".mac", "application/x-mac");
|
||||
map.put(".man", "application/x-troff-man");
|
||||
map.put(".math", "text/xml");
|
||||
map.put(".mdb", "application/msaccess");
|
||||
map.put(".mdb", "application/x-mdb");
|
||||
map.put(".mfp", "application/x-shockwave-flash");
|
||||
map.put(".mht", "message/rfc822");
|
||||
map.put(".mhtml", "message/rfc822");
|
||||
map.put(".mi", "application/x-mi");
|
||||
map.put(".mid", "audio/mid");
|
||||
map.put(".midi", "audio/mid");
|
||||
map.put(".mil", "application/x-mil");
|
||||
map.put(".mml", "text/xml");
|
||||
map.put(".mnd", "audio/x-musicnet-download");
|
||||
map.put(".mns", "audio/x-musicnet-stream");
|
||||
map.put(".mocha", "application/x-javascript");
|
||||
map.put(".movie", "video/x-sgi-movie");
|
||||
map.put(".mp1", "audio/mp1");
|
||||
map.put(".mp2", "audio/mp2");
|
||||
map.put(".mp2v", "video/mpeg");
|
||||
map.put(".mp3", "audio/mp3");
|
||||
map.put(".mp4", "video/mpeg4");
|
||||
map.put(".mpa", "video/x-mpg");
|
||||
map.put(".mpd", "application/vnd.ms-project");
|
||||
map.put(".mpe", "video/x-mpeg");
|
||||
map.put(".mpeg", "video/mpg");
|
||||
map.put(".mpg", "video/mpg");
|
||||
map.put(".mpga", "audio/rn-mpeg");
|
||||
map.put(".mpp", "application/vnd.ms-project");
|
||||
map.put(".mps", "video/x-mpeg");
|
||||
map.put(".mpt", "application/vnd.ms-project");
|
||||
map.put(".mpv", "video/mpg");
|
||||
map.put(".mpv2", "video/mpeg");
|
||||
map.put(".mpw", "application/vnd.ms-project");
|
||||
map.put(".mpx", "application/vnd.ms-project");
|
||||
map.put(".mtx", "text/xml");
|
||||
map.put(".mxp", "application/x-mmxp");
|
||||
map.put(".net", "image/pnetvue");
|
||||
map.put(".nrf", "application/x-nrf");
|
||||
map.put(".nws", "message/rfc822");
|
||||
map.put(".odc", "text/x-ms-odc");
|
||||
map.put(".out", "application/x-out");
|
||||
map.put(".p10", "application/pkcs10");
|
||||
map.put(".p12", "application/x-pkcs12");
|
||||
map.put(".p7b", "application/x-pkcs7-certificates");
|
||||
map.put(".p7c", "application/pkcs7-mime");
|
||||
map.put(".p7m", "application/pkcs7-mime");
|
||||
map.put(".p7r", "application/x-pkcs7-certreqresp");
|
||||
map.put(".p7s", "application/pkcs7-signature");
|
||||
map.put(".pc5", "application/x-pc5");
|
||||
map.put(".pci", "application/x-pci");
|
||||
map.put(".pcl", "application/x-pcl");
|
||||
map.put(".pcx", "application/x-pcx");
|
||||
map.put(".pdf", "application/pdf");
|
||||
map.put(".pdf", "application/pdf");
|
||||
map.put(".pdx", "application/vnd.adobe.pdx");
|
||||
map.put(".pfx", "application/x-pkcs12");
|
||||
map.put(".pgl", "application/x-pgl");
|
||||
map.put(".pic", "application/x-pic");
|
||||
map.put(".pko", "application/vnd.ms-pki.pko");
|
||||
map.put(".pl", "application/x-perl");
|
||||
map.put(".plg", "text/html");
|
||||
map.put(".pls", "audio/scpls");
|
||||
map.put(".plt", "application/x-plt");
|
||||
map.put(".png", "image/png");
|
||||
map.put(".png", "application/x-png");
|
||||
map.put(".pot", "application/vnd.ms-powerpoint");
|
||||
map.put(".ppa", "application/vnd.ms-powerpoint");
|
||||
map.put(".ppm", "application/x-ppm");
|
||||
map.put(".pps", "application/vnd.ms-powerpoint");
|
||||
map.put(".ppt", "application/vnd.ms-powerpoint");
|
||||
map.put(".ppt", "application/x-ppt");
|
||||
map.put(".pr", "application/x-pr");
|
||||
map.put(".prf", "application/pics-rules");
|
||||
map.put(".prn", "application/x-prn");
|
||||
map.put(".prt", "application/x-prt");
|
||||
map.put(".ps", "application/x-ps");
|
||||
map.put(".ps", "application/postscript");
|
||||
map.put(".ptn", "application/x-ptn");
|
||||
map.put(".pwz", "application/vnd.ms-powerpoint");
|
||||
map.put(".r3t", "text/vnd.rn-realtext3d");
|
||||
map.put(".ra", "audio/vnd.rn-realaudio");
|
||||
map.put(".ram", "audio/x-pn-realaudio");
|
||||
map.put(".ras", "application/x-ras");
|
||||
map.put(".rat", "application/rat-file");
|
||||
map.put(".rdf", "text/xml");
|
||||
map.put(".rec", "application/vnd.rn-recording");
|
||||
map.put(".red", "application/x-red");
|
||||
map.put(".rgb", "application/x-rgb");
|
||||
map.put(".rjs", "application/vnd.rn-realsystem-rjs");
|
||||
map.put(".rjt", "application/vnd.rn-realsystem-rjt");
|
||||
map.put(".rlc", "application/x-rlc");
|
||||
map.put(".rle", "application/x-rle");
|
||||
map.put(".rm", "application/vnd.rn-realmedia");
|
||||
map.put(".rmf", "application/vnd.adobe.rmf");
|
||||
map.put(".rmi", "audio/mid");
|
||||
map.put(".rmj", "application/vnd.rn-realsystem-rmj");
|
||||
map.put(".rmm", "audio/x-pn-realaudio");
|
||||
map.put(".rmp", "application/vnd.rn-rn_music_package");
|
||||
map.put(".rms", "application/vnd.rn-realmedia-secure");
|
||||
map.put(".rmvb", "application/vnd.rn-realmedia-vbr");
|
||||
map.put(".rmx", "application/vnd.rn-realsystem-rmx");
|
||||
map.put(".rnx", "application/vnd.rn-realplayer");
|
||||
map.put(".rp", "image/vnd.rn-realpix");
|
||||
map.put(".rpm", "audio/x-pn-realaudio-plugin");
|
||||
map.put(".rsml", "application/vnd.rn-rsml");
|
||||
map.put(".rt", "text/vnd.rn-realtext");
|
||||
map.put(".rtf", "application/msword");
|
||||
map.put(".rtf", "application/x-rtf");
|
||||
map.put(".rv", "video/vnd.rn-realvideo");
|
||||
map.put(".sam", "application/x-sam");
|
||||
map.put(".sat", "application/x-sat");
|
||||
map.put(".sdp", "application/sdp");
|
||||
map.put(".sdw", "application/x-sdw");
|
||||
map.put(".sit", "application/x-stuffit");
|
||||
map.put(".slb", "application/x-slb");
|
||||
map.put(".sld", "application/x-sld");
|
||||
map.put(".slk", "drawing/x-slk");
|
||||
map.put(".smi", "application/smil");
|
||||
map.put(".smil", "application/smil");
|
||||
map.put(".smk", "application/x-smk");
|
||||
map.put(".snd", "audio/basic");
|
||||
map.put(".sol", "text/plain");
|
||||
map.put(".sor", "text/plain");
|
||||
map.put(".spc", "application/x-pkcs7-certificates");
|
||||
map.put(".spl", "application/futuresplash");
|
||||
map.put(".spp", "text/xml");
|
||||
map.put(".ssm", "application/streamingmedia");
|
||||
map.put(".sst", "application/vnd.ms-pki.certstore");
|
||||
map.put(".stl", "application/vnd.ms-pki.stl");
|
||||
map.put(".stm", "text/html");
|
||||
map.put(".sty", "application/x-sty");
|
||||
map.put(".svg", "text/xml");
|
||||
map.put(".swf", "application/x-shockwave-flash");
|
||||
map.put(".tdf", "application/x-tdf");
|
||||
map.put(".tg4", "application/x-tg4");
|
||||
map.put(".tga", "application/x-tga");
|
||||
map.put(".tif", "image/tiff");
|
||||
map.put(".tif", "application/x-tif");
|
||||
map.put(".tiff", "image/tiff");
|
||||
map.put(".tld", "text/xml");
|
||||
map.put(".top", "drawing/x-top");
|
||||
map.put(".torrent", "application/x-bittorrent");
|
||||
map.put(".tsd", "text/xml");
|
||||
map.put(".txt", "text/plain");
|
||||
map.put(".uin", "application/x-icq");
|
||||
map.put(".uls", "text/iuls");
|
||||
map.put(".vcf", "text/x-vcard");
|
||||
map.put(".vda", "application/x-vda");
|
||||
map.put(".vdx", "application/vnd.visio");
|
||||
map.put(".vml", "text/xml");
|
||||
map.put(".vpg", "application/x-vpeg005");
|
||||
map.put(".vsd", "application/vnd.visio");
|
||||
map.put(".vsd", "application/x-vsd");
|
||||
map.put(".vss", "application/vnd.visio");
|
||||
map.put(".vst", "application/vnd.visio");
|
||||
map.put(".vst", "application/x-vst");
|
||||
map.put(".vsw", "application/vnd.visio");
|
||||
map.put(".vsx", "application/vnd.visio");
|
||||
map.put(".vtx", "application/vnd.visio");
|
||||
map.put(".vxml", "text/xml");
|
||||
map.put(".wav", "audio/wav");
|
||||
map.put(".wax", "audio/x-ms-wax");
|
||||
map.put(".wb1", "application/x-wb1");
|
||||
map.put(".wb2", "application/x-wb2");
|
||||
map.put(".wb3", "application/x-wb3");
|
||||
map.put(".wbmp", "image/vnd.wap.wbmp");
|
||||
map.put(".wiz", "application/msword");
|
||||
map.put(".wk3", "application/x-wk3");
|
||||
map.put(".wk4", "application/x-wk4");
|
||||
map.put(".wkq", "application/x-wkq");
|
||||
map.put(".wks", "application/x-wks");
|
||||
map.put(".wm", "video/x-ms-wm");
|
||||
map.put(".wma", "audio/x-ms-wma");
|
||||
map.put(".wmd", "application/x-ms-wmd");
|
||||
map.put(".wmf", "application/x-wmf");
|
||||
map.put(".wml", "text/vnd.wap.wml");
|
||||
map.put(".wmv", "video/x-ms-wmv");
|
||||
map.put(".wmx", "video/x-ms-wmx");
|
||||
map.put(".wmz", "application/x-ms-wmz");
|
||||
map.put(".wp6", "application/x-wp6");
|
||||
map.put(".wpd", "application/x-wpd");
|
||||
map.put(".wpg", "application/x-wpg");
|
||||
map.put(".wpl", "application/vnd.ms-wpl");
|
||||
map.put(".wq1", "application/x-wq1");
|
||||
map.put(".wr1", "application/x-wr1");
|
||||
map.put(".wri", "application/x-wri");
|
||||
map.put(".wrk", "application/x-wrk");
|
||||
map.put(".ws", "application/x-ws");
|
||||
map.put(".ws2", "application/x-ws");
|
||||
map.put(".wsc", "text/scriptlet");
|
||||
map.put(".wsdl", "text/xml");
|
||||
map.put(".wvx", "video/x-ms-wvx");
|
||||
map.put(".xdp", "application/vnd.adobe.xdp");
|
||||
map.put(".xdr", "text/xml");
|
||||
map.put(".xfd", "application/vnd.adobe.xfd");
|
||||
map.put(".xfdf", "application/vnd.adobe.xfdf");
|
||||
map.put(".xhtml", "text/html");
|
||||
map.put(".xls", "application/vnd.ms-excel");
|
||||
map.put(".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
map.put(".xlw", "application/x-xlw");
|
||||
map.put(".xml", "text/xml");
|
||||
map.put(".xpl", "audio/scpls");
|
||||
map.put(".xq", "text/xml");
|
||||
map.put(".xql", "text/xml");
|
||||
map.put(".xquery", "text/xml");
|
||||
map.put(".xsd", "text/xml");
|
||||
map.put(".xsl", "text/xml");
|
||||
map.put(".xslt", "text/xml");
|
||||
map.put(".xwd", "application/x-xwd");
|
||||
map.put(".x_b", "application/x-x_b");
|
||||
map.put(".sis", "application/vnd.symbian.install");
|
||||
map.put(".sisx", "application/vnd.symbian.install");
|
||||
map.put(".x_t", "application/x-x_t");
|
||||
map.put(".ipa", "application/vnd.iphone");
|
||||
map.put(".apk", "application/vnd.android.package-archive");
|
||||
map.put(".xap", "application/x-silverlight-app");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//System.out.println(getContentType(".xls"));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue