Add client banner-by-id API and point frontend at new client endpoints.
Also save admin uploads locally under /public/images with a 10MB limit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -180,6 +180,27 @@ func (r repository) GetBanners(ctx context.Context, limit, page int) (users.Data
|
||||
return dt, nil
|
||||
}
|
||||
|
||||
func (r repository) GetBannerById(ctx context.Context, id int) (users.BannerDTO, error) {
|
||||
var b users.BannerDTO
|
||||
|
||||
q := ` SELECT
|
||||
id, title,
|
||||
content_tm, content_ru, content_en,
|
||||
img, created_at
|
||||
FROM banner
|
||||
WHERE id = $1;`
|
||||
|
||||
err := r.client.QueryRow(ctx, q, id).Scan(
|
||||
&b.Id, &b.Title,
|
||||
&b.ContentTm, &b.ContentRu, &b.ContentEn,
|
||||
&b.Image, &b.CreatedAt,
|
||||
)
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func (r repository) GetStatics(ctx context.Context, limit, page int) (users.DataStaticDTO, error) {
|
||||
|
||||
var dt users.DataStaticDTO
|
||||
|
||||
Reference in New Issue
Block a user