Skip to content

Commit

Permalink
Merge pull request #375 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Join Event by Facebook account
  • Loading branch information
phuonghuynh committed Aug 26, 2015
2 parents 798b3d6 + 2524ce3 commit fe144c2
Show file tree
Hide file tree
Showing 36 changed files with 665 additions and 368 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class SocialController {
@Resource
private VietnamWorksUserService vietnamWorksUserService;


@RequestMapping(value = "login/social/{social}", method = RequestMethod.GET)
public void loginBySocial(@PathVariable SocialProvider social, @RequestParam(required = false) String code, HttpServletResponse response) throws IOException {
response.sendRedirect(code == null ? "/#/?action=cancel" : String.format("/#/?action=loginBySocial&social=%s&code=%s", social, code));
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/techlooper/controller/UserController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.techlooper.controller;

import com.techlooper.dto.DashBoardInfo;
import com.techlooper.dto.JoinBySocialDto;
import com.techlooper.dto.WebinarInfoDto;
import com.techlooper.entity.GetPromotedEntity;
import com.techlooper.entity.PriceJobEntity;
Expand Down Expand Up @@ -314,4 +315,9 @@ public Collection<WebinarInfoDto> findAvailableWebinars() {
public WebinarInfoDto findWebinarById(@PathVariable Long id) {
return webinarService.findWebinarById(id);
}

@RequestMapping(value = "user/webinar/join", method = RequestMethod.POST)
public WebinarInfoDto joinWebinar(@RequestBody JoinBySocialDto joinBySocialDto) {
return webinarService.joinWebinar(joinBySocialDto);
}
}
49 changes: 49 additions & 0 deletions src/main/java/com/techlooper/dto/JoinBySocialDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.techlooper.dto;

import java.io.Serializable;

/**
* Created by phuonghqh on 8/26/15.
*/
public class JoinBySocialDto implements Serializable {

private Long id;

private String firstName;

private String lastName;

private String email;

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getLastName() {
return lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}
}
123 changes: 67 additions & 56 deletions src/main/java/com/techlooper/dto/WebinarInfoDto.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.techlooper.dto;

import com.techlooper.model.EmployerDto;
import com.techlooper.model.UserProfileDto;

import java.io.Serializable;
Expand All @@ -10,83 +11,93 @@
*/
public class WebinarInfoDto implements Serializable {

private Long createdDateTime;
private Long createdDateTime;

private String name;
private String name;

private String startDate;
private String startDate;

private String endDate;
private String endDate;

private String description;
private String description;

private Set<String> attendees;
private Set<UserProfileDto> attendees;

private String whatEvent;
private String whatEvent;

private UserProfileDto organiser;
private UserProfileDto organiser;

public String getWhatEvent() {
return whatEvent;
}
private EmployerDto company;

public void setWhatEvent(String whatEvent) {
this.whatEvent = whatEvent;
}
public EmployerDto getCompany() {
return company;
}

public String getName() {
return name;
}
public void setCompany(EmployerDto company) {
this.company = company;
}

public void setName(String name) {
this.name = name;
}
public String getWhatEvent() {
return whatEvent;
}

public String getStartDate() {
return startDate;
}
public void setWhatEvent(String whatEvent) {
this.whatEvent = whatEvent;
}

public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getName() {
return name;
}

public String getEndDate() {
return endDate;
}
public void setName(String name) {
this.name = name;
}

public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getStartDate() {
return startDate;
}

public String getDescription() {
return description;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}

public void setDescription(String description) {
this.description = description;
}
public String getEndDate() {
return endDate;
}

public Set<String> getAttendees() {
return attendees;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}

public void setAttendees(Set<String> attendees) {
this.attendees = attendees;
}
public String getDescription() {
return description;
}

public UserProfileDto getOrganiser() {
return organiser;
}
public void setDescription(String description) {
this.description = description;
}

public void setOrganiser(UserProfileDto organiser) {
this.organiser = organiser;
}
public Set<UserProfileDto> getAttendees() {
return attendees;
}

public Long getCreatedDateTime() {
return createdDateTime;
}
public void setAttendees(Set<UserProfileDto> attendees) {
this.attendees = attendees;
}

public void setCreatedDateTime(Long createdDateTime) {
this.createdDateTime = createdDateTime;
}
public UserProfileDto getOrganiser() {
return organiser;
}

public void setOrganiser(UserProfileDto organiser) {
this.organiser = organiser;
}

public Long getCreatedDateTime() {
return createdDateTime;
}

public void setCreatedDateTime(Long createdDateTime) {
this.createdDateTime = createdDateTime;
}
}
60 changes: 59 additions & 1 deletion src/main/java/com/techlooper/entity/ScrapeJobEntity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.techlooper.entity;

import com.techlooper.model.JobSkill;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import static org.springframework.data.elasticsearch.annotations.FieldType.String;
import java.util.List;

import static org.springframework.data.elasticsearch.annotations.FieldType.*;

@Document(indexName = "techlooper", type = "job")
public class ScrapeJobEntity {
Expand Down Expand Up @@ -32,6 +35,21 @@ public class ScrapeJobEntity {
@Field(type = String, index = FieldIndex.not_analyzed)
private String crawlSource;

@Field(type = Long)
private Long salaryMin;

@Field(type = Long)
private Long salaryMax;

@Field(type = Boolean)
private Boolean topPriority;

@Field(type = Nested)
private List<CompanyBenefit> benefits;

@Field(type = Nested)
private List<JobSkill> skills;

public String getJobTitleUrl() {
return jobTitleUrl;
}
Expand Down Expand Up @@ -95,4 +113,44 @@ public String getCrawlSource() {
public void setCrawlSource(String crawlSource) {
this.crawlSource = crawlSource;
}

public Long getSalaryMin() {
return salaryMin;
}

public void setSalaryMin(Long salaryMin) {
this.salaryMin = salaryMin;
}

public Long getSalaryMax() {
return salaryMax;
}

public void setSalaryMax(Long salaryMax) {
this.salaryMax = salaryMax;
}

public Boolean getTopPriority() {
return topPriority;
}

public void setTopPriority(Boolean topPriority) {
this.topPriority = topPriority;
}

public List<CompanyBenefit> getBenefits() {
return benefits;
}

public void setBenefits(List<CompanyBenefit> benefits) {
this.benefits = benefits;
}

public List<JobSkill> getSkills() {
return skills;
}

public void setSkills(List<JobSkill> skills) {
this.skills = skills;
}
}
8 changes: 4 additions & 4 deletions src/main/java/com/techlooper/entity/WebinarEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class WebinarEntity {
@Field(type = FieldType.String)
private String description;

@Field(type = FieldType.String)
private Collection<String> attendees;
@Field(type = FieldType.Nested)
private Collection<UserProfileDto> attendees;

@Field(type = FieldType.Nested)
private UserProfileDto organiser;
Expand Down Expand Up @@ -86,11 +86,11 @@ public void setDescription(String description) {
this.description = description;
}

public Collection<String> getAttendees() {
public Collection<UserProfileDto> getAttendees() {
return attendees;
}

public void setAttendees(Collection<String> attendees) {
public void setAttendees(Collection<UserProfileDto> attendees) {
this.attendees = attendees;
}

Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/techlooper/model/JobResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class JobResponse {

private Long salaryMax;

private Integer techlooperJobType = 0;
private Boolean topPriority;

private List<CompanyBenefit> benefits;

Expand Down Expand Up @@ -97,8 +97,8 @@ public Builder withSalaryMax(Long salaryMax) {
return this;
}

public Builder withTechlooperJobType(Integer techlooperJobType) {
instance.techlooperJobType = techlooperJobType;
public Builder withTopPriority(Boolean topPriority) {
instance.topPriority = topPriority;
return this;
}

Expand Down Expand Up @@ -220,14 +220,6 @@ public void setSalaryMax(Long salaryMax) {
this.salaryMax = salaryMax;
}

public Integer getTechlooperJobType() {
return techlooperJobType;
}

public void setTechlooperJobType(Integer techlooperJobType) {
this.techlooperJobType = techlooperJobType;
}

public List<CompanyBenefit> getBenefits() {
return benefits;
}
Expand All @@ -243,4 +235,12 @@ public List<JobSkill> getSkills() {
public void setSkills(List<JobSkill> skills) {
this.skills = skills;
}

public Boolean getTopPriority() {
return topPriority;
}

public void setTopPriority(Boolean topPriority) {
this.topPriority = topPriority;
}
}
Loading

0 comments on commit fe144c2

Please sign in to comment.