package com.yeejoin.amos.boot.module.jxiop.api.dto;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.module.jxiop.api.entity.CommonFile;
import lombok.Data;

import java.util.List;

/**
 * @description:
 * @author: tw
 * @createDate: 2023/4/22
 */
@Data
public class UserMapperDto {

    private String  sequenceNbr;
    //头像
    private List<CommonFile> photo;
    private String headPhoto;
    //姓名
    private String  name;
    //性别
    private String  sex;
    //联系电话
    private String  phone;
    //所属场站
    private String  projectName;
    //岗位名称
    private String   postName;
    //系统账户
    private String  accountName;

    public String getHeadPhoto() {
        return headPhoto;
    }

    public void setHeadPhoto(String headPhoto) {

        this.photo= headPhoto!=null? JSON.parseArray(headPhoto,CommonFile.class):null;
       if(!this.photo.isEmpty()){
           this.headPhoto = this.photo.get(0).getUrl();
       }
    }

    public List<CommonFile> getPhoto() {

        return photo;
    }

    public void setPhoto(List<CommonFile> photo) {
        this.photo =photo;
    }
}
