package com.yonge.cooleshow.admin.io.request;

import com.alibaba.fastjson.JSON;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.enums.SuggestionType;
import com.yonge.cooleshow.common.enums.ESuggestionHandleAttitude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 平台建议表
 * 2022-11-15 17:59:45
 */
@ApiModel(value = "SysSuggestionVo对象", description = "平台建议表查询视图对象")
public class SysSuggestionVo {

    @Data
    @ApiModel(" SysSuggestionList-平台建议表")
    public static class SysSuggestionQuery implements QueryInfo {

        @ApiModelProperty(value = "当前页")
        private Integer page;

        @ApiModelProperty(value = "分页行数")
        private Integer rows;

        @ApiModelProperty(value = "客户端类型")
        private ClientEnum clientType;

        @ApiModelProperty("建议类型")
        private SuggestionType suggestionType;

        @ApiModelProperty("开始时间")
        private Date startTime;

        @ApiModelProperty("结束时间")
        private Date endTime;
    }

    @Data
    @ApiModel(" SysSuggestion-平台建议表")
    public static class SysSuggestion {


        @ApiModelProperty("编号")
        private Long id;

        @ApiModelProperty(value = "建议类型ID", required = true)
        @NotNull
        private Long suggestionTypeId;

        @ApiModelProperty(value = "联系方式", required = true)
        @NotNull
        private String mobileNo;

        @ApiModelProperty(value = "建议类型", required = true)
        @NotNull
        private SuggestionType type;

        @ApiModelProperty(value = "内容", required = true)
        @NotNull
        private String content;

        @ApiModelProperty("附件信息, 多个,隔开")
        private String attachmentUrls;

        @ApiModelProperty("用户编号")
        private Long userId;

        @ApiModelProperty("客户端类型")
        private ClientEnum clientType;

        @ApiModelProperty("客户端信息")
        private String userAgent;

        @ApiModelProperty("处理态度")
        private ESuggestionHandleAttitude handleAttitude;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static SysSuggestion from(String json) {
            return JSON.parseObject(json, SysSuggestion.class);
        }

    }

}
