package com.zy.asrs.common.openapi.entity;
|
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
import com.zy.asrs.framework.common.Cools;
|
import com.zy.asrs.framework.common.SpringUtils;
|
import com.zy.asrs.common.sys.entity.User;
|
import com.zy.asrs.common.sys.entity.Host;
|
import com.zy.asrs.common.sys.service.UserService;
|
import com.zy.asrs.common.sys.service.HostService;
|
|
import java.io.Serializable;
|
import java.util.Date;
|
|
@Data
|
@TableName("openapi_host_key")
|
public class HostKey implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
* ID
|
*/
|
@ApiModelProperty(value= "ID")
|
@TableId(value = "id", type = IdType.AUTO)
|
private Long id;
|
|
/**
|
* 签名密钥
|
*/
|
@ApiModelProperty(value = "签名密钥")
|
private String signKey;
|
|
/**
|
* 接口请求密钥
|
*/
|
@ApiModelProperty(value = "接口请求密钥")
|
private String appKey;
|
|
/**
|
* 创建时间
|
*/
|
@ApiModelProperty(value= "创建时间")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
private Date createTime;
|
|
/**
|
* 授权商户
|
*/
|
@ApiModelProperty(value= "授权商户")
|
private Long hostId;
|
|
/**
|
* 签名开启状态{0:关闭,1:开启}
|
*/
|
@ApiModelProperty(value= "签名开启状态")
|
private Integer signStatus;
|
|
public HostKey() {}
|
|
public HostKey(Long id, String signKey, String appKey, Date createTime, Long hostId) {
|
this.id = id;
|
this.signKey = signKey;
|
this.appKey = appKey;
|
this.createTime = createTime;
|
this.hostId = hostId;
|
}
|
|
// HostKey hostKey = new HostKey(
|
// null, // 密钥
|
// null, // 创建时间
|
// null // 授权商户
|
// );
|
|
public String getCreateTime$(){
|
if (Cools.isEmpty(this.createTime)){
|
return "";
|
}
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
|
}
|
|
public String getHostId$(){
|
HostService service = SpringUtils.getBean(HostService.class);
|
Host host = service.getById(this.hostId);
|
if (!Cools.isEmpty(host)){
|
return String.valueOf(host.getName());
|
}
|
return null;
|
}
|
|
|
}
|