This commit is contained in:
Elshimy Ziad Magdy Taha 2025-11-01 17:52:12 +05:00
parent 8ac872bdc6
commit 06f5f9cf02
9 changed files with 503 additions and 5 deletions

2
.env
View file

@ -9,4 +9,4 @@ SERVER_PORT=8080
SERVER_HOST=localhost SERVER_HOST=localhost
CV_AI_MODEL=your_ai_model CV_AI_MODEL=your_ai_model
OPENROUTER_API_KEY=your_openrouter_api_key OPENROUTER_API_KEY=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

View file

@ -7,7 +7,7 @@ SCRAPER_LINKEDIN_DIR=./services/scraper-linkedin
SCRAPER_GLASSDOOR_DIR=./services/scraper-glassdoor SCRAPER_GLASSDOOR_DIR=./services/scraper-glassdoor
CRON_ANALYZER_DIR=./apps/cron-analyzer CRON_ANALYZER_DIR=./apps/cron-analyzer
CV_ANALYZER_DIR=./apps/cv-analyzer CV_ANALYZER_DIR=./apps/cv-analyzer
DOCS_DIR=./internal/swagger DOCS_DIR=./services/api/pkg/swagger
BIN_DIR=./bin BIN_DIR=./bin
API_MAIN_FILE=$(API_DIR)/cmd/server/main.go API_MAIN_FILE=$(API_DIR)/cmd/server/main.go
SCRAPER_LINKEDIN_MAIN_FILE=$(SCRAPER_LINKEDIN_DIR)/main.go SCRAPER_LINKEDIN_MAIN_FILE=$(SCRAPER_LINKEDIN_DIR)/main.go

View file

@ -8,7 +8,6 @@ use (
./internal/pkg/infrastructure ./internal/pkg/infrastructure
./internal/pkg/openrouter ./internal/pkg/openrouter
./internal/pkg/utils ./internal/pkg/utils
./internal/swagger
./libs/ports ./libs/ports
./libs/repo ./libs/repo
./libs/server ./libs/server

12
services/api/.env Normal file
View file

@ -0,0 +1,12 @@
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=linkedin_jobs
DB_SSLMODE=disable
SERVER_PORT=8080
SERVER_HOST=localhost
CV_AI_MODEL=your_ai_model
OPENROUTER_API_KEY=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

View file

@ -1,5 +1,5 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT // Package swagger Code generated by swaggo/swag. DO NOT EDIT
package docs package swagger
import "github.com/swaggo/swag" import "github.com/swaggo/swag"
@ -69,9 +69,183 @@ const docTemplate = `{
} }
} }
} }
},
"/jobs/analysis": {
"get": {
"description": "Retrieves all job analysis results from the database",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get all job analysis results",
"responses": {
"200": {
"description": "List of job analysis results",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/jobs/analysis/top-matches": {
"get": {
"description": "Retrieves jobs with high analysis match scores",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get top matching jobs",
"parameters": [
{
"type": "integer",
"description": "Minimum match score (default: 70)",
"name": "min_score",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of top matching job analysis results",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
}
},
"400": {
"description": "Invalid minimum score",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/jobs/{id}/analysis": {
"get": {
"description": "Retrieves the analysis result for a specific job",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get job analysis result by job ID",
"parameters": [
{
"type": "integer",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Job analysis result",
"schema": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
},
"400": {
"description": "Invalid job ID",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Analysis result not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
} }
}, },
"definitions": { "definitions": {
"domain.JobAnalysisResult": {
"type": "object",
"properties": {
"analysisResult": {
"type": "string"
},
"analyzedAt": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"jobID": {
"type": "integer",
"format": "int64"
},
"keySkills": {
"type": "array",
"items": {
"type": "string"
}
},
"matchScore": {
"type": "integer"
},
"missingSkills": {
"type": "array",
"items": {
"type": "string"
}
},
"recommendations": {
"type": "string"
}
}
},
"domain.JobProvider": { "domain.JobProvider": {
"type": "integer", "type": "integer",
"enum": [ "enum": [

View file

@ -62,9 +62,183 @@
} }
} }
} }
},
"/jobs/analysis": {
"get": {
"description": "Retrieves all job analysis results from the database",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get all job analysis results",
"responses": {
"200": {
"description": "List of job analysis results",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/jobs/analysis/top-matches": {
"get": {
"description": "Retrieves jobs with high analysis match scores",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get top matching jobs",
"parameters": [
{
"type": "integer",
"description": "Minimum match score (default: 70)",
"name": "min_score",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of top matching job analysis results",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
}
},
"400": {
"description": "Invalid minimum score",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/jobs/{id}/analysis": {
"get": {
"description": "Retrieves the analysis result for a specific job",
"produces": [
"application/json"
],
"tags": [
"jobs"
],
"summary": "Get job analysis result by job ID",
"parameters": [
{
"type": "integer",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Job analysis result",
"schema": {
"$ref": "#/definitions/domain.JobAnalysisResult"
}
},
"400": {
"description": "Invalid job ID",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Analysis result not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
} }
}, },
"definitions": { "definitions": {
"domain.JobAnalysisResult": {
"type": "object",
"properties": {
"analysisResult": {
"type": "string"
},
"analyzedAt": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"jobID": {
"type": "integer",
"format": "int64"
},
"keySkills": {
"type": "array",
"items": {
"type": "string"
}
},
"matchScore": {
"type": "integer"
},
"missingSkills": {
"type": "array",
"items": {
"type": "string"
}
},
"recommendations": {
"type": "string"
}
}
},
"domain.JobProvider": { "domain.JobProvider": {
"type": "integer", "type": "integer",
"enum": [ "enum": [

View file

@ -1,5 +1,30 @@
basePath: / basePath: /
definitions: definitions:
domain.JobAnalysisResult:
properties:
analysisResult:
type: string
analyzedAt:
type: string
id:
format: int64
type: integer
jobID:
format: int64
type: integer
keySkills:
items:
type: string
type: array
matchScore:
type: integer
missingSkills:
items:
type: string
type: array
recommendations:
type: string
type: object
domain.JobProvider: domain.JobProvider:
enum: enum:
- 0 - 0
@ -71,4 +96,94 @@ paths:
summary: Create a new job summary: Create a new job
tags: tags:
- jobs - jobs
/jobs/{id}/analysis:
get:
description: Retrieves the analysis result for a specific job
parameters:
- description: Job ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Job analysis result
schema:
$ref: '#/definitions/domain.JobAnalysisResult'
"400":
description: Invalid job ID
schema:
additionalProperties:
type: string
type: object
"404":
description: Analysis result not found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal server error
schema:
additionalProperties:
type: string
type: object
summary: Get job analysis result by job ID
tags:
- jobs
/jobs/analysis:
get:
description: Retrieves all job analysis results from the database
produces:
- application/json
responses:
"200":
description: List of job analysis results
schema:
items:
$ref: '#/definitions/domain.JobAnalysisResult'
type: array
"500":
description: Internal server error
schema:
additionalProperties:
type: string
type: object
summary: Get all job analysis results
tags:
- jobs
/jobs/analysis/top-matches:
get:
description: Retrieves jobs with high analysis match scores
parameters:
- description: 'Minimum match score (default: 70)'
in: query
name: min_score
type: integer
produces:
- application/json
responses:
"200":
description: List of top matching job analysis results
schema:
items:
$ref: '#/definitions/domain.JobAnalysisResult'
type: array
"400":
description: Invalid minimum score
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal server error
schema:
additionalProperties:
type: string
type: object
summary: Get top matching jobs
tags:
- jobs
swagger: "2.0" swagger: "2.0"

View file

@ -0,0 +1,12 @@
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=linkedin_jobs
DB_SSLMODE=disable
SERVER_PORT=8080
SERVER_HOST=localhost
CV_AI_MODEL=your_ai_model
OPENROUTER_API_KEY=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

View file

@ -0,0 +1,12 @@
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=linkedin_jobs
DB_SSLMODE=disable
SERVER_PORT=8080
SERVER_HOST=localhost
CV_AI_MODEL=your_ai_model
OPENROUTER_API_KEY=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