package com.tykj.workflowcore.workflow_editer.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import com.tykj.workflowcore.workflow_editer.entity.vo.InvokeRequestVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.ParameterVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import java.util.List;

/**
 * ClassName:    VariableStorage
 * Package:    com.tykj.entity
 * Description:
 * Datetime:    2021/3/3   10:03
 *
 * @Author: zsp
 */
@AllArgsConstructor
@NoArgsConstructor
@Entity
@WorkFlowCoreNoScan
@Data
public class VariableStorage extends BaseEntity {

    @ApiModelProperty("流程主键")
    private String flowKey;

    @ApiModelProperty("流程主键")
    private String activityId;

    @ApiModelProperty("调用类名")
    private String className;

    @ApiModelProperty("调用方法")
    private String method;

    @ApiModelProperty("详情json")
    private String parameterInfo;

    @JsonGetter
    public List<ParameterVo> getParameterInfo() {
        return JSON.parseObject(parameterInfo,new TypeReference<List<ParameterVo>>(){});
    }

}
