recommendation service
This commit is contained in:
parent
c9dcb3949d
commit
c637ddb321
103
docs/docs.go
103
docs/docs.go
|
|
@ -519,8 +519,7 @@ const docTemplate = `{
|
|||
"200": {
|
||||
"description": "Recommended games fetched successfully",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"$ref": "#/definitions/domain.RecommendationSuccessfulResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
|
|
@ -3389,6 +3388,44 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/bets": {
|
||||
"get": {
|
||||
"description": "Gets user bets",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Gets user bets",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/domain.BetRes"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/checkPhoneEmailExist": {
|
||||
"post": {
|
||||
"description": "Check if phone number or email exist",
|
||||
|
|
@ -4332,6 +4369,10 @@ const docTemplate = `{
|
|||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"example": "2025-04-08T12:00:00Z"
|
||||
},
|
||||
"full_name": {
|
||||
"type": "string",
|
||||
"example": "John"
|
||||
|
|
@ -4725,6 +4766,20 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.RecommendationSuccessfulResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"recommended_games": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/domain.VirtualGame"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain.ReferralSettings": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -5069,6 +5124,50 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.VirtualGame": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"is_featured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"max_bet": {
|
||||
"type": "number"
|
||||
},
|
||||
"min_bet": {
|
||||
"type": "number"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"popularity_score": {
|
||||
"type": "integer"
|
||||
},
|
||||
"provider": {
|
||||
"type": "string"
|
||||
},
|
||||
"rtp": {
|
||||
"type": "number"
|
||||
},
|
||||
"thumbnail_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"volatility": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.AdminRes": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -511,8 +511,7 @@
|
|||
"200": {
|
||||
"description": "Recommended games fetched successfully",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"$ref": "#/definitions/domain.RecommendationSuccessfulResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
|
|
@ -3381,6 +3380,44 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/bets": {
|
||||
"get": {
|
||||
"description": "Gets user bets",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Gets user bets",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/domain.BetRes"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.APIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/checkPhoneEmailExist": {
|
||||
"post": {
|
||||
"description": "Check if phone number or email exist",
|
||||
|
|
@ -4324,6 +4361,10 @@
|
|||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"example": "2025-04-08T12:00:00Z"
|
||||
},
|
||||
"full_name": {
|
||||
"type": "string",
|
||||
"example": "John"
|
||||
|
|
@ -4717,6 +4758,20 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.RecommendationSuccessfulResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"recommended_games": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/domain.VirtualGame"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain.ReferralSettings": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -5061,6 +5116,50 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.VirtualGame": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"is_featured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"max_bet": {
|
||||
"type": "number"
|
||||
},
|
||||
"min_bet": {
|
||||
"type": "number"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"popularity_score": {
|
||||
"type": "integer"
|
||||
},
|
||||
"provider": {
|
||||
"type": "string"
|
||||
},
|
||||
"rtp": {
|
||||
"type": "number"
|
||||
},
|
||||
"thumbnail_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"volatility": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.AdminRes": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ definitions:
|
|||
cashed_out:
|
||||
example: false
|
||||
type: boolean
|
||||
created_at:
|
||||
example: "2025-04-08T12:00:00Z"
|
||||
type: string
|
||||
full_name:
|
||||
example: John
|
||||
type: string
|
||||
|
|
@ -362,6 +365,15 @@ definitions:
|
|||
message:
|
||||
type: string
|
||||
type: object
|
||||
domain.RecommendationSuccessfulResponse:
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
recommended_games:
|
||||
items:
|
||||
$ref: '#/definitions/domain.VirtualGame'
|
||||
type: array
|
||||
type: object
|
||||
domain.ReferralSettings:
|
||||
properties:
|
||||
betReferralBonusPercentage:
|
||||
|
|
@ -601,6 +613,35 @@ definitions:
|
|||
status:
|
||||
type: string
|
||||
type: object
|
||||
domain.VirtualGame:
|
||||
properties:
|
||||
category:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
id:
|
||||
type: integer
|
||||
is_featured:
|
||||
type: boolean
|
||||
max_bet:
|
||||
type: number
|
||||
min_bet:
|
||||
type: number
|
||||
name:
|
||||
type: string
|
||||
popularity_score:
|
||||
type: integer
|
||||
provider:
|
||||
type: string
|
||||
rtp:
|
||||
type: number
|
||||
thumbnail_url:
|
||||
type: string
|
||||
updated_at:
|
||||
type: string
|
||||
volatility:
|
||||
type: string
|
||||
type: object
|
||||
handlers.AdminRes:
|
||||
properties:
|
||||
created_at:
|
||||
|
|
@ -1783,8 +1824,7 @@ paths:
|
|||
"200":
|
||||
description: Recommended games fetched successfully
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
$ref: '#/definitions/domain.RecommendationSuccessfulResponse'
|
||||
"500":
|
||||
description: Failed to fetch recommendations
|
||||
schema:
|
||||
|
|
@ -3670,6 +3710,31 @@ paths:
|
|||
summary: Get transfer by wallet
|
||||
tags:
|
||||
- transfer
|
||||
/user/bets:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Gets user bets
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/domain.BetRes'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.APIResponse'
|
||||
summary: Gets user bets
|
||||
tags:
|
||||
- user
|
||||
/user/checkPhoneEmailExist:
|
||||
post:
|
||||
consumes:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
package domain
|
||||
|
||||
type RecommendationSuccessfulResponse struct {
|
||||
Message string `json:"message"`
|
||||
RecommendedGames []VirtualGame `json:"recommended_games"`
|
||||
}
|
||||
|
||||
type RecommendationErrorResponse struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,22 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
type VirtualGame struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Provider string `json:"provider"`
|
||||
Category string `json:"category"`
|
||||
MinBet float64 `json:"min_bet"`
|
||||
MaxBet float64 `json:"max_bet"`
|
||||
Volatility string `json:"volatility"`
|
||||
RTP float64 `json:"rtp"`
|
||||
IsFeatured bool `json:"is_featured"`
|
||||
PopularityScore int `json:"popularity_score"`
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
type VirtualGameSession struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param userID path string true "User ID"
|
||||
// @Success 200 {object} map[string]interface{} "Recommended games fetched successfully"
|
||||
// @Success 200 {object} domain.RecommendationSuccessfulResponse "Recommended games fetched successfully"
|
||||
// @Failure 500 {object} domain.RecommendationErrorResponse "Failed to fetch recommendations"
|
||||
// @Router /api/v1/virtual-games/recommendations/{userID} [get]
|
||||
func (h *Handler) GetRecommendations(c *fiber.Ctx) error {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user