package cn.axzo.msg.center.domain.dto;


import cn.axzo.msg.center.domain.enums.PlatOmsWhereEnum;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @ClassName PlatDeptUserDto
 * @Description 人员部门岗位
 * @Author zhangran
 * @Date 2022/1/25 14:50
 **/
@Data
@Accessors(chain = true)
public class PlatDeptLogDto {

  private final static String WHERE_OP_TMPL= "{}管理页-{}{}";

  public final static String EDIT_OP = "编辑";
  public final static String ADD_OP = "添加";
  public final static String DELETE_OP = "删除";
  public final static String REMOVE_OP = "移除";


  /**
   * 地方
   */
  private PlatOmsWhereEnum where;
  /**
   * 操作:ADD_OP, EDIT_OP, DELETE_OP
   */
  private String op;
  /**
   * 操作数据
   */
  private String data;

  public String getTitle(){
    return "操作"+where.name;
  }

  public String getContent(String phone){
    String part1 = StrUtil.format(WHERE_OP_TMPL, where.name, op, where.name);
    String part2 = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
    return part1+"、"+part2+"、"+data+"、"+phone;
  }


  public Integer getType(){
    return where.code;
  }

}
