package com.rongyichuang.rating.dto.response; import com.rongyichuang.rating.entity.RatingScheme; import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; /** * 评分模板响应DTO */ public class RatingSchemeResponse { private Long id; private String name; private String description; private Integer totalScore; private List items; private LocalDateTime createTime; private LocalDateTime updateTime; // 构造函数 public RatingSchemeResponse() {} public RatingSchemeResponse(RatingScheme scheme) { this.id = scheme.getId(); this.name = scheme.getName(); this.description = scheme.getDescription(); this.totalScore = scheme.getTotalScore(); this.createTime = scheme.getCreateTime(); this.updateTime = scheme.getUpdateTime(); if (scheme.getItems() != null) { this.items = scheme.getItems().stream() .map(RatingItemResponse::new) .collect(Collectors.toList()); } } // Getter和Setter方法 public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getTotalScore() { return totalScore; } public void setTotalScore(Integer totalScore) { this.totalScore = totalScore; } public List getItems() { return items; } public void setItems(List items) { this.items = items; } public LocalDateTime getCreateTime() { return createTime; } public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; } public LocalDateTime getUpdateTime() { return updateTime; } public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; } }