package com.bonus.core.nutrition.common.po;

import cn.hutool.core.util.StrUtil;
import com.bonus.core.menu.constant.NutritionConstants;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

public class DishNutritionParam {
   @ApiModelProperty("菜品id")
   private Long dishesId;
   @ApiModelProperty("菜品初始推荐分值")
   private Integer initialScore;
   @ApiModelProperty("菜品分类名称")
   private String classifyName;
   @ApiModelProperty("热量(千卡/100g)")
   private Double calories;
   @ApiModelProperty("蛋白质(g/100g)")
   private Double protein;
   @ApiModelProperty("脂肪(g/100g)")
   private Double fat;
   @ApiModelProperty("碳水化合物(g/100g)")
   private Double carbohydrate;
   @ApiModelProperty("膳食纤维(g/100g)")
   private Double dietaryFiber;
   @ApiModelProperty("胆固醇(mg/100g)")
   private Double cholesterol;
   @ApiModelProperty("钙(mg/100g)")
   private Double calcium;
   @ApiModelProperty("钠(mg/100g)")
   private Double sodium;
   @ApiModelProperty("总嘌呤含量(mg/100g)")
   private Double purine;
   @ApiModelProperty("铁(mg/100g)")
   private Double iron;
   @ApiModelProperty("碘(μg/100g)")
   private Double iodine;
   @ApiModelProperty("钾(mg/100g)")
   private Double kalium;
   @ApiModelProperty("维生素a(μg/100g)")
   private Double vitaminA;
   @ApiModelProperty("维生素c(mg/100g)")
   private Double vitaminC;
   @ApiModelProperty("维生素e(g/100g)")
   private Double vitaminE;
   @ApiModelProperty("镁(mg/100g)")
   private Double magnesium;
   @ApiModelProperty("锌(mg/100g)")
   private Double zinc;
   @ApiModelProperty("血糖生成指数(GI)")
   private Double glycemicIndex;

   public boolean classifyNameNotNull() {
      return StrUtil.isNotBlank(this.classifyName);
   }

   public boolean checkHypertension() {
      return (Objects.isNull(this.sodium) ? Double.NaN : this.sodium) > NutritionConstants.SODIUM_VAL1.doubleValue() || (Objects.isNull(this.calories) ? Double.NaN : this.calories) > NutritionConstants.CALORIES_VAL2.doubleValue();
   }

   public boolean checkPurine() {
      return (Objects.isNull(this.purine) ? Double.NaN : this.purine) > NutritionConstants.PURINE_VAL1.doubleValue() || (Objects.isNull(this.calories) ? Double.NaN : this.calories) > NutritionConstants.CALORIES_VAL2.doubleValue();
   }

   public Long getDishesId() {
      return this.dishesId;
   }

   public Integer getInitialScore() {
      return this.initialScore;
   }

   public String getClassifyName() {
      return this.classifyName;
   }

   public Double getCalories() {
      return this.calories;
   }

   public Double getProtein() {
      return this.protein;
   }

   public Double getFat() {
      return this.fat;
   }

   public Double getCarbohydrate() {
      return this.carbohydrate;
   }

   public Double getDietaryFiber() {
      return this.dietaryFiber;
   }

   public Double getCholesterol() {
      return this.cholesterol;
   }

   public Double getCalcium() {
      return this.calcium;
   }

   public Double getSodium() {
      return this.sodium;
   }

   public Double getPurine() {
      return this.purine;
   }

   public Double getIron() {
      return this.iron;
   }

   public Double getIodine() {
      return this.iodine;
   }

   public Double getKalium() {
      return this.kalium;
   }

   public Double getVitaminA() {
      return this.vitaminA;
   }

   public Double getVitaminC() {
      return this.vitaminC;
   }

   public Double getVitaminE() {
      return this.vitaminE;
   }

   public Double getMagnesium() {
      return this.magnesium;
   }

   public Double getZinc() {
      return this.zinc;
   }

   public Double getGlycemicIndex() {
      return this.glycemicIndex;
   }

   public void setDishesId(final Long dishesId) {
      this.dishesId = dishesId;
   }

   public void setInitialScore(final Integer initialScore) {
      this.initialScore = initialScore;
   }

   public void setClassifyName(final String classifyName) {
      this.classifyName = classifyName;
   }

   public void setCalories(final Double calories) {
      this.calories = calories;
   }

   public void setProtein(final Double protein) {
      this.protein = protein;
   }

   public void setFat(final Double fat) {
      this.fat = fat;
   }

   public void setCarbohydrate(final Double carbohydrate) {
      this.carbohydrate = carbohydrate;
   }

   public void setDietaryFiber(final Double dietaryFiber) {
      this.dietaryFiber = dietaryFiber;
   }

   public void setCholesterol(final Double cholesterol) {
      this.cholesterol = cholesterol;
   }

   public void setCalcium(final Double calcium) {
      this.calcium = calcium;
   }

   public void setSodium(final Double sodium) {
      this.sodium = sodium;
   }

   public void setPurine(final Double purine) {
      this.purine = purine;
   }

   public void setIron(final Double iron) {
      this.iron = iron;
   }

   public void setIodine(final Double iodine) {
      this.iodine = iodine;
   }

   public void setKalium(final Double kalium) {
      this.kalium = kalium;
   }

   public void setVitaminA(final Double vitaminA) {
      this.vitaminA = vitaminA;
   }

   public void setVitaminC(final Double vitaminC) {
      this.vitaminC = vitaminC;
   }

   public void setVitaminE(final Double vitaminE) {
      this.vitaminE = vitaminE;
   }

   public void setMagnesium(final Double magnesium) {
      this.magnesium = magnesium;
   }

   public void setZinc(final Double zinc) {
      this.zinc = zinc;
   }

   public void setGlycemicIndex(final Double glycemicIndex) {
      this.glycemicIndex = glycemicIndex;
   }


   protected boolean canEqual(final Object other) {
      return other instanceof DishNutritionParam;
   }


}
