Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions JobPortal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<java.version>21</java.version>
</properties>
<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
11 changes: 11 additions & 0 deletions JobPortal/src/main/java/com/jobportal/dto/ProfileRequestDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.jobportal.dto;

public class ProfileRequestDto {

private String FullName;
private String Email;
private String Phone;
private String Skills;
private int Experience;

}
15 changes: 15 additions & 0 deletions JobPortal/src/main/java/com/jobportal/dto/ProfileResponseDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.jobportal.dto;

public class ProfileResponseDto {

private Long Id;
private String Fullname;
private String Email;
private String Phone;
private String Skills;
private int Experience;

private String ResumePath;


}
5 changes: 5 additions & 0 deletions JobPortal/src/main/java/com/jobportal/entity/Entit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.jobportal.entity;

public @interface Entit {

}
30 changes: 30 additions & 0 deletions JobPortal/src/main/java/com/jobportal/entity/Profile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.jobportal.entity;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

@Data
@Entity
@Table(name = "profiles")
public class Profile {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String FullName;
private String Email;
private String Phone;

private String Skills;

private int Experience;

private String ResumePath;


}
43 changes: 43 additions & 0 deletions JobPortal/src/main/java/com/jobportal/mapper/ProfileMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.jobportal.mapper;

import org.springframework.stereotype.Component;

import com.jobportal.dto.ProfileRequestDto;
import com.jobportal.dto.ProfileResponseDto;
import com.jobportal.entity.Profile;

import lombok.Data;

@Data
@Component
public class ProfileMapper {

// Dto = Entity

public Profile dtoToEntity(ProfileRequestDto dto) {
Profile profile = new Profile();
profile.setFullName(dto.getFullName());
profile.setEmail(dto.getEmail());
profile.setPhone(dto.getPhone());
profile.setSkills(dto.getSkills());
profile.setExperience(dto.getExperience());
return profile;
}


// Entity → DTO
public ProfileResponseDto toDto(Profile profile) {

ProfileResponseDto dto = new ProfileResponseDto();

dto.setId(profile.getId());
dto.setFullName(profile.getFullName());
dto.setEmail(profile.getEmail());
dto.setPhone(profile.getPhone());
dto.setSkills(profile.getSkills());
dto.setExperience(profile.getExperience());
dto.setResumePath(profile.getResumePath());

return dto;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.jobportal.repository;

import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;

import com.jobportal.entity.Profile;

public interface ProfileRepository extends JpaRepository<Profile, Long> {

Optional<Profile> findByEmail(String email);

}
18 changes: 18 additions & 0 deletions JobPortal/src/main/java/com/jobportal/service/ProfileService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.jobportal.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jobportal.mapper.ProfileMapper;
import com.jobportal.repository.ProfileRepository;

@Service
public interface ProfileService {

@Autowired
private ProfileRepository profileRepo;




}
2 changes: 1 addition & 1 deletion JobPortal/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring.application.name=JobPortal
# ===============================
spring.datasource.url=jdbc:mysql://localhost:3306/student_db?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.password=himanshu1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# ===============================
Expand Down