Skip to content

Commit

Permalink
Merge pull request #402 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Sep 10, 2015
2 parents 4c4ad4d + 41ccac2 commit e5d9915
Show file tree
Hide file tree
Showing 26 changed files with 590 additions and 441 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.techlooper.cron;

import com.techlooper.model.JobCrawlerSourceEnum;
import com.techlooper.model.JobSearchCriteria;
import com.techlooper.model.JobTypeEnum;
import com.techlooper.service.JobAggregatorService;
import org.slf4j.Logger;
Expand Down Expand Up @@ -35,6 +37,10 @@ public void indexJobFromVietnamworks() throws Exception {
int numberOfNormalJobs = jobAggregatorService.importVietnamworksJob(JobTypeEnum.NORMAL);
LOGGER.info(numberOfTopPriorityJobs + " top priority jobs has been indexed already.");
LOGGER.info(numberOfNormalJobs + " normal jobs has been indexed already.");

JobSearchCriteria criteria = new JobSearchCriteria();
criteria.setCrawlSource(JobCrawlerSourceEnum.VIETNAMWORKS.getValue());
jobAggregatorService.updateJobExpiration(criteria);
} catch (Throwable ex) {
LOGGER.error(ex.getMessage(), ex);
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/techlooper/entity/JobEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.List;

import static org.springframework.data.elasticsearch.annotations.FieldType.Integer;
import static org.springframework.data.elasticsearch.annotations.FieldType.Long;
import static org.springframework.data.elasticsearch.annotations.FieldType.String;

Expand Down Expand Up @@ -36,6 +37,9 @@ public class JobEntity {
@Field(type = FieldType.Nested)
private List<JobSkill> skills;

@Field(type = Integer)
private Integer isActive;

public String getId() {
return id;
}
Expand Down Expand Up @@ -84,6 +88,14 @@ public void setSkills(List<JobSkill> skills) {
this.skills = skills;
}

public Integer getIsActive() {
return isActive;
}

public void setIsActive(Integer isActive) {
this.isActive = isActive;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/techlooper/entity/ScrapeJobEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class ScrapeJobEntity {
@Field(type = Nested)
private List<JobSkill> skills;

@Field(type = Integer)
private Integer isActive;

public String getJobId() {
return jobId;
}
Expand Down Expand Up @@ -167,4 +170,12 @@ public List<JobSkill> getSkills() {
public void setSkills(List<JobSkill> skills) {
this.skills = skills;
}

public Integer getIsActive() {
return isActive;
}

public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/techlooper/model/JobCrawlerSourceEnum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.techlooper.model;

public enum JobCrawlerSourceEnum {

VIETNAMWORKS("vietnamworks");

private String value;

private JobCrawlerSourceEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}
}
Loading

0 comments on commit e5d9915

Please sign in to comment.