下载日志增加下载类型功能

This commit is contained in:
zhaojun
2023-05-27 16:25:53 +08:00
parent e078366395
commit 008425734c
4 changed files with 15 additions and 2 deletions

View File

@@ -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;

View File

@@ -0,0 +1 @@
alter table download_log add download_type varchar(32);

View File

@@ -0,0 +1 @@
alter table download_log add download_type varchar(32);

View File

@@ -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">