modified: serv_nginx/api_bb/internal/models/training_plan.go

modified:   serv_nginx/bbvue/src/views/Profile.vue
add shadow into avatar image profile page begushiybashkir.ru site
This commit is contained in:
2025-10-19 20:43:36 +05:00
parent 6f77fb08b3
commit 17b936f566
2 changed files with 27 additions and 25 deletions
@@ -3,41 +3,41 @@ package models
import ( import (
"time" "time"
"gorm.io/gorm" "gorm.io/gorm"
) )
type TrainingPlan struct { type TrainingPlan struct {
ID uint `json:"id" gorm:"primaryKey"` ID uint `json:"id" gorm:"primaryKey"`
UserID uint `json:"user_id" gorm:"not null;index"` UserID uint `json:"user_id" gorm:"not null;index"`
Title string `json:"title" gorm:"size:255;not null"` Title string `json:"title" gorm:"size:255;not null"`
Description string `json:"description" gorm:"type:text"` Description string `json:"description" gorm:"type:text"`
Weeks int `json:"weeks" gorm:"not null;default:12"` // Длительность плана в неделях Weeks int `json:"weeks" gorm:"not null;default:12"` // Длительность плана в неделях
WorkoutsPerWeek int `json:"workouts_per_week" gorm:"not null;default:3"` // Тренировок в неделю WorkoutsPerWeek int `json:"workouts_per_week" gorm:"not null;default:3"` // Тренировок в неделю
TargetDistance string `json:"target_distance" gorm:"size:50"` // Целевая дистанция TargetDistance string `json:"target_distance" gorm:"size:50"` // Целевая дистанция
TargetDate time.Time `json:"target_date"` // Дата цели TargetDate time.Time `json:"target_date"` // Дата цели
CurrentWeek int `json:"current_week" gorm:"default:1"` // Текущая неделя CurrentWeek int `json:"current_week" gorm:"default:1"` // Текущая неделя
Completed bool `json:"completed" gorm:"default:false"` // Завершен ли план Completed bool `json:"completed" gorm:"default:false"` // Завершен ли план
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"` UpdatedAt time.Time `json:"updated_at"`
// Связи // Связи
User User `json:"user,omitempty" gorm:"foreignKey:UserID"` User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
Workouts []TrainingWorkout `json:"workouts,omitempty" gorm:"foreignKey:PlanID"` Workouts []TrainingWorkout `json:"workouts,omitempty" gorm:"foreignKey:PlanID"`
} }
type TrainingWorkout struct { type TrainingWorkout struct {
ID uint `json:"id" gorm:"primaryKey"` ID uint `json:"id" gorm:"primaryKey"`
PlanID uint `json:"plan_id" gorm:"not null;index"` PlanID uint `json:"plan_id" gorm:"not null;index"`
Week int `json:"week" gorm:"not null"` // Неделя плана Week int `json:"week" gorm:"not null"` // Неделя плана
Day int `json:"day" gorm:"not null"` // День недели (1-7) Day int `json:"day" gorm:"not null"` // День недели (1-7)
Type WorkoutType `json:"type" gorm:"type:varchar(20);not null"` Type WorkoutType `json:"type" gorm:"type:varchar(20);not null"`
Description string `json:"description" gorm:"type:text"` Description string `json:"description" gorm:"type:text"`
Distance float64 `json:"distance_km" gorm:"type:decimal(5,2)"` Distance float64 `json:"distance_km" gorm:"type:decimal(5,2)"`
Duration int `json:"duration_min"` Duration int `json:"duration_min"`
Completed bool `json:"completed" gorm:"default:false"` Completed bool `json:"completed" gorm:"default:false"`
CompletedAt *time.Time `json:"completed_at"` CompletedAt *time.Time `json:"completed_at"`
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
} }
// BeforeCreate hooks // BeforeCreate hooks
@@ -72,4 +72,4 @@ type TrainingPlanCreateRequest struct {
WorkoutsPerWeek int `json:"workouts_per_week" validate:"required,min=1,max=7"` WorkoutsPerWeek int `json:"workouts_per_week" validate:"required,min=1,max=7"`
TargetDistance string `json:"target_distance" validate:"max=50"` TargetDistance string `json:"target_distance" validate:"max=50"`
TargetDate time.Time `json:"target_date"` TargetDate time.Time `json:"target_date"`
} }
+2
View File
@@ -698,6 +698,7 @@ export default {
isolation: isolate; isolation: isolate;
/* Новое свойство */ /* Новое свойство */
background-image: none !important; background-image: none !important;
box-shadow: 0.2rem 0.2rem 0.3rem rgb(155, 155, 155);
/* Явно убираем фоновое изображение */ /* Явно убираем фоновое изображение */
} }
@@ -707,6 +708,7 @@ export default {
object-fit: cover; object-fit: cover;
transition: transform 0.3s ease; transition: transform 0.3s ease;
display: block; display: block;
box-shadow: 0.2rem 0.2rem 0.3rem rgb(155, 155, 155);
/* Убедитесь, что block */ /* Убедитесь, что block */
} }