package com.oqpo.api.web.dto.response.ver;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.oqpo.api.entity.oper.AfflEntity;
import com.oqpo.api.entity.oper.AfflSaleInfoEntity;
import com.oqpo.api.entity.oper.FileEntity;
import com.oqpo.api.entity.system.VerInfoEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;
import java.util.stream.Collectors;

@Getter
@Setter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@JsonInclude(JsonInclude.Include.ALWAYS)
public class VerInfoResponse {

    @ApiModelProperty(value = "앱버전번호")
    private String appNo;

    @ApiModelProperty(value = "APP버전")
    private String appVer;

    @ApiModelProperty(value = "버전설명")
    private String desVer;

    @ApiModelProperty(value = "버전생성일")
    private String appVerDt;

    public static VerInfoResponse toDTO(VerInfoEntity entity) {
        if (entity == null) return null;
        return VerInfoResponse.builder()
                .appNo(entity.getAppNo())
                .appVer(entity.getAppVer())
                .desVer(entity.getDesVer())
                .appVerDt(entity.getAppVerDt())
                .build();
    }


}
