package com.sysu.admin.support.system.config;

import com.xiesx.fastboot.core.jpa.entity.JpaPlusEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @title Config
 * @description
 * @author XIE
 * @date 2020年4月24日下午10:02:21
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@FieldNameConstants(innerTypeName = "FIELDS")
@Table(name = "sys_config")
@Entity
@DynamicInsert
@DynamicUpdate
public class SConfig extends JpaPlusEntity<SConfig> {

    private static final long serialVersionUID = 1L;

    /**
     * 键
     */
    @Id
    private String k;

    /**
     * 值
     */
    @Column
    private String v;

    @Column
    private String title;

    @Column
    private String remark;

    @Column
    private Integer sort;
    /**
     * 返回的value 类型 json 或 text
     */
    @Transient
    private String resultType;

    public enum ResultType{
        text, json
    }

}
