mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
✨ 下载日志增加下载类型功能
This commit is contained in:
@@ -27,6 +27,10 @@ import java.util.Date;
|
||||
@NoArgsConstructor
|
||||
public class DownloadLog implements Serializable {
|
||||
|
||||
public static final String DOWNLOAD_TYPE_DIRECT_LINK = "directLink";
|
||||
|
||||
public static final String DOWNLOAD_TYPE_SHORT_LINK = "shortLink";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
@@ -34,6 +38,11 @@ public class DownloadLog implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
|
||||
@TableField(value = "`download_type`")
|
||||
@ApiModelProperty(value="下载类型", example = "directLink", allowableValues = "directLink, shortLink")
|
||||
private String downloadType;
|
||||
|
||||
|
||||
@TableField(value = "`path`")
|
||||
@ApiModelProperty(value="文件路径")
|
||||
private String path;
|
||||
@@ -68,7 +77,8 @@ public class DownloadLog implements Serializable {
|
||||
@ApiModelProperty(value="访问 referer")
|
||||
private String referer;
|
||||
|
||||
public DownloadLog(String path, String storageKey, String shortKey) {
|
||||
public DownloadLog(String downloadType, String path, String storageKey, String shortKey) {
|
||||
this.downloadType = downloadType;
|
||||
this.path = path;
|
||||
this.storageKey = storageKey;
|
||||
this.shortKey = shortKey;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
alter table download_log add download_type varchar(32);
|
||||
@@ -0,0 +1 @@
|
||||
alter table download_log add download_type varchar(32);
|
||||
@@ -12,10 +12,11 @@
|
||||
<result column="ip" jdbcType="VARCHAR" property="ip" />
|
||||
<result column="user_agent" jdbcType="VARCHAR" property="userAgent" />
|
||||
<result column="referer" jdbcType="VARCHAR" property="referer" />
|
||||
<result column="download_type" jdbcType="VARCHAR" property="downloadType" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
`id`, `path`, `storage_key`, `create_time`, `ip`, `user_agent`, `referer`, `short_key`
|
||||
`id`, `path`, `storage_key`, `create_time`, `ip`, `user_agent`, `referer`, `short_key`, `download_type`
|
||||
</sql>
|
||||
|
||||
<delete id="deleteByStorageKey">
|
||||
|
||||
Reference in New Issue
Block a user