package com.app.service.guardian.dto;

import com.app.constant.EnumSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@ApiModel("[微信用户账号]登录Dto")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxmpLoginDto {

    @ApiModelProperty("[微信用户账号]登录认证token")
    private String token;

    @ApiModelProperty("认证状态")
    @JsonSerialize(using = EnumSerializer.class)
    private StateEnum state;

    @ApiModelProperty("信息")
    private String message;

    @Getter
    public enum StateEnum {
        SUCCESS(0, "认证成功"),
        TO_BE_ADDED(1, "待完善信息"),
        FAIL(-1, "认证失败，请重试...");

        private Integer value;
        private String name;

        StateEnum(Integer value, String name) {
            this.value = value;
            this.name = name;
        }
    }

}
