package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 项目名: yhlxj2
 * 文件名: GoodsQaShowView
 * 创建者: JavaZou
 * 创建时间:2025/2/7 12:04
 */
@Getter
@Setter
@SearchBean(tables = "goods_don_qa_relate gr inner join goods_don_qa ga on ga.id = gr.question_id" +
		" inner join goods_don g on g.id = gr.goods_id" +
		" left join goods_don_category_relate gcr on gcr.goods_id = g.id" +
		" left join goods_don_category gc on gc.id = gcr.category",
		where = "ga.status is true and ga.deleted is true and g.status is true")
public class GoodsQaShowView {
	/**
	 * 1.售前，2.售后
	 */
	@DbField("ga.type")
	private Integer type;

	@DbIgnore
	private String label;

	@DbIgnore
	private Integer value;

	@DbField("g.id")
	private Long goodsId;

	@DbField("g.title")
	private String title;

	/**
	 * 分类
	 */
	@DbField("gc.name")
	private String categoryName;

	@DbIgnore
	private List<QaGoodsType> children;

	@Getter
	@Setter
	public static class QaGoodsType {
		private Long category;

		//分类名
		private String label;

		//分类名
		private String value;

		private List<GoodsDonQaView> children;

		@Getter
		@Setter
		public static class GoodsDonQaView{
			//平台名
			private String label;

			//平台id
			private Long value;
		}
	}
}
