feat:
Some checks failed
Build and Deploy Go App / build (push) Failing after 2m37s
Build and Deploy Go App / deploy (push) Has been skipped

This commit is contained in:
Iron_Felix 2025-11-25 03:20:39 +03:00
parent 9f74c9eeb6
commit 4c7d03cddc
7 changed files with 28 additions and 6 deletions

View file

@ -412,6 +412,10 @@ components:
format: int64
storage_type:
type: string
description: Image storage type
enum:
- s3
- local
image_path:
type: string
TitleStatus:

View file

@ -16,6 +16,12 @@ import (
openapi_types "github.com/oapi-codegen/runtime/types"
)
// Defines values for ImageStorageType.
const (
Local ImageStorageType = "local"
S3 ImageStorageType = "s3"
)
// Defines values for ReleaseSeason.
const (
Fall ReleaseSeason = "fall"
@ -57,9 +63,14 @@ type CursorObj struct {
type Image struct {
Id *int64 `json:"id,omitempty"`
ImagePath *string `json:"image_path,omitempty"`
StorageType *string `json:"storage_type,omitempty"`
// StorageType Image storage type
StorageType *ImageStorageType `json:"storage_type,omitempty"`
}
// ImageStorageType Image storage type
type ImageStorageType string
// ReleaseSeason Title release season
type ReleaseSeason string

View file

@ -5,6 +5,6 @@ properties:
type: integer
format: int64
storage_type:
type: string
$ref: './enums/StorageType.yaml'
image_path:
type: string

View file

@ -0,0 +1,5 @@
type: string
description: Image storage type
enum:
- s3
- local

View file

@ -141,7 +141,7 @@ func UserTitleStatus2Sqlc1(s *oapi.UserTitleStatus) (*sqlc.UsertitleStatusT, err
case oapi.UserTitleStatusPlanned:
sqlc_status = sqlc.UsertitleStatusTPlanned
default:
return nil, fmt.Errorf("unexpected tittle status: %s", s)
return nil, fmt.Errorf("unexpected tittle status: %s", *s)
}
return &sqlc_status, nil

View file

@ -334,7 +334,7 @@ WHERE
sqlc.narg('usertitle_statuses')::usertitle_status_t[] IS NULL
OR array_length(sqlc.narg('usertitle_statuses')::usertitle_status_t[], 1) IS NULL
OR array_length(sqlc.narg('usertitle_statuses')::usertitle_status_t[], 1) = 0
OR t.title_status = ANY(sqlc.narg('usertitle_statuses')::usertitle_status_t[])
OR u.status = ANY(sqlc.narg('usertitle_statuses')::usertitle_status_t[])
)
AND (sqlc.narg('rate')::int IS NULL OR u.rate >= sqlc.narg('rate')::int)
AND (sqlc.narg('rating')::float IS NULL OR t.rating >= sqlc.narg('rating')::float)

View file

@ -14,6 +14,8 @@ sql:
emit_pointers_for_null_types: true
emit_empty_slices: true #slices returned by :many queries will be empty instead of nil
overrides:
- column: "titles.title_storage_type"
go_type: "*string"
- db_type: "jsonb"
go_type: "encoding/json.RawMessage"
- db_type: "uuid"