package com.yonge.cooleshow.biz.dal.wrapper;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableId;
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * 平台建议表
 * 2022-11-15 17:59:45
 */
public class SysSuggestionWrapper {

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SysSuggestionQuery implements QueryInfo {

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

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

        @ApiModelProperty("关键字")
        private String keyword;

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

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

        @TableId(value = "建议类型ID")
        private Long suggestionTypeId;

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

        @ApiModelProperty("建议类型名称")
        private String suggestionTypeName;

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

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

        @ApiModelProperty("处理状态,true:是，false:否")
        private Boolean handleStatus;

        @ApiModelProperty("处理人")
        private Long handleBy;

        @ApiModelProperty("处理人")
        private String handleName;

        @ApiModelProperty("是否反馈用户,true:是，false:否")
        private Boolean feedback;

        @ApiModelProperty("开始处理时间")
        private Date handStartTime;

        @ApiModelProperty("结束处理时间")
        private Date handEndTime;

        @ApiModelProperty("处理态度，NEED:需要处理，NO：不予处理")
        private ESuggestionHandleAttitude handleAttitude;

        @ApiModelProperty("用户ID")
        private Long userId;

        @ApiModelProperty("客户端类型,多个用逗号隔开")
        private String clientTypes;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SysSuggestion {

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

        @ApiModelProperty("建议类型ID")
        private Long suggestionTypeId;

        @ApiModelProperty("建议类型名称")
        private String suggestionTypeName;

        @ApiModelProperty("联系方式")
        private String mobileNo;

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

        @ApiModelProperty("标题")
        private String title;

        @ApiModelProperty("内容")
        private String content;

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

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

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

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

        @ApiModelProperty("提交时间")
        private Date createTime;

        @ApiModelProperty("用户名")
        private String nickname;

        @ApiModelProperty("处理状态：true:已处理，false:待处理")
        private Boolean handleStatus;

        @ApiModelProperty("处理时间")
        private Date handleTime;

        @ApiModelProperty("处理人")
        private Long handleBy;

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

        @ApiModelProperty("处理人姓名")
        private String handleName;

        @ApiModelProperty("是否反馈用户,true:是，false:否")
        private Boolean feedback;

        @ApiModelProperty("反馈内容")
        private String feedbackContent;

        @ApiModelProperty("学校ID")
        private Long schoolId;

        @ApiModelProperty("学校名称")
        private String schoolName;

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

    }

    /**
     * 客服
     */
    @Data
    public static class CustomerServiceContact {

        @ApiModelProperty("客服电话")
        private String phone;

        @ApiModelProperty("客服邮箱")
        private String email;
    }

    @ApiModel("处理反馈意见模型")
    @Data
    public static class HandleSuggestion {

        @ApiModelProperty(value = "id", required = true)
        @NotNull
        private Long id;

        @ApiModelProperty(value = "是否反馈用户,true:是，false:否", required = true)
        @NotNull
        private Boolean feedback;

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

        @ApiModelProperty(value = "处理态度", required = true)
        @NotNull
        private ESuggestionHandleAttitude handleAttitude;

        @ApiModelProperty(value = "处理人", hidden = true)
        private Long handleBy;


    }

}
