/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.youchain.basicdata.domain;

import com.youchain.base.BaseEntity;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author DengJiangKun
* @date 2023-11-14
**/
@Entity
@Data
@Table(name="sys_lamp_log")
public class LampLog  extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private Long id;

    @Column(name = "`ip`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "ip")
    private String ip;

    @Column(name = "`button_box`")
    @ApiModelProperty(value = "所属按钮盒")
    private String buttonBox;

    @Column(name = "`button_code`")
    @ApiModelProperty(value = "按钮编码")
    private String buttonCode;

    @Column(name = "`operation_type`")
    @ApiModelProperty(value = "操作类型")
    private String operationType;

    @Column(name = "`request_content`")
    @ApiModelProperty(value = "请求内容")
    private String requestContent;

    @Column(name = "`return_content`")
    @ApiModelProperty(value = "返回内容")
    private String returnContent;

    @Column(name = "`return_state`")
    @ApiModelProperty(value = "返回状态")
    private String returnState;

    public void copy(LampLog source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
