Commit 7c35a79c authored by ZhengJie's avatar ZhengJie
Browse files

[新增功能](el-admin v2.5): v2.5 beta

详情 https://www.ydyno.com/archives/1225.html
parent d35ffc9d
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.service.dto.UserDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
/**
......@@ -13,13 +27,4 @@ import org.mapstruct.ReportingPolicy;
*/
@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class, JobMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface UserMapper extends BaseMapper<UserDto, User> {
/**
* 转换
* @param user 原始数据
* @return /
*/
@Override
@Mapping(source = "user.userAvatar.realName",target = "avatar")
UserDto toDto(User user);
}
......@@ -35,12 +35,6 @@ spring:
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
#配置 Jpa
jpa:
hibernate:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto: update
#jwt
jwt:
header: Authorization
......
......@@ -37,12 +37,6 @@ spring:
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
#配置 Jpa
jpa:
hibernate:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto: none
#jwt
jwt:
header: Authorization
......
......@@ -17,6 +17,7 @@ spring:
jpa:
properties:
hibernate:
ddl-auto: none
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
open-in-view: true
......@@ -45,9 +46,9 @@ qiniu:
# 文件大小 /M
max-size: 15
#邮箱验证码有效时间/分钟
#邮箱验证码有效时间/
code:
expiration: 5
expiration: 300
#登录图形验证码有效时间/分钟
loginCode:
......
......@@ -21,7 +21,7 @@
<div style="padding: 10px;padding-bottom: 0px;">
<p style="margin-bottom: 10px;padding-bottom: 0px;">尊敬的用户,您好:</p>
<p style="text-indent: 2em; margin-bottom: 10px;">您正在申请邮箱验证,您的验证码为:</p>
<p style="text-align: center;
<p style="text-align: center;
font-family: Times New Roman;
font-size: 22px;
color: #C60024;
......@@ -29,13 +29,6 @@
margin-bottom: 10px;
font-weight: bold;
background: #ebebeb;">${code}</p>
<div style="list-style: none;
margin-top: 22px;
maigin-bottom: 10px;
font-size: 14px;
color: #555;">
<p style="line-height: 12px;">Github:<a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">https://github.com/elunez/eladmin</a></p>
</div>
<div class="foot-hr hr" style="margin: 0 auto;
z-index: 111;
width: 800px;
......@@ -46,7 +39,7 @@
font-size: 12px;
padding: 20px 0px;
font-family: Microsoft YaHei;">
Copyright &copy;${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved.
Copyright &copy;${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">EL-ADMIN</a> 后台管理系统 All Rights Reserved.
</div>
</div>
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.rest;
import me.zhengjie.aop.log.Log;
......@@ -15,9 +30,11 @@ import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Api(tags = "${apiAlias}管理")
@RestController
@RequestMapping("/api/${changeClassName}")
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.service.dto;
import lombok.Data;
......@@ -14,9 +29,11 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
</#if>
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Data
public class ${className}Dto implements Serializable {
<#if columns??>
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.domain;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
<#if isNotNullColumns??>
......@@ -21,9 +37,11 @@ import java.math.BigDecimal;
import java.io.Serializable;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Entity
@Data
@Table(name="${tableName}")
......@@ -31,9 +49,6 @@ public class ${className} implements Serializable {
<#if columns??>
<#list columns as column>
<#if column.remark != ''>
/** ${column.remark} */
</#if>
<#if column.columnKey = 'PRI'>
@Id
<#if auto>
......@@ -55,6 +70,11 @@ public class ${className} implements Serializable {
@UpdateTimestamp
</#if>
</#if>
<#if column.remark != ''>
@ApiModelProperty(value = "${column.remark}")
<#else>
@ApiModelProperty(value = "${column.changeColumnName}")
</#if>
private ${column.columnType} ${column.changeColumnName};
</#list>
</#if>
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.service.mapper;
import me.zhengjie.base.BaseMapper;
......@@ -7,9 +22,11 @@ import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ${className}Mapper extends BaseMapper<${className}Dto, ${className}> {
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.service.dto;
import lombok.Data;
......@@ -15,9 +30,11 @@ import me.zhengjie.annotation.Query;
</#if>
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Data
public class ${className}QueryCriteria{
<#if queryColumns??>
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.repository;
import ${package}.domain.${className};
......@@ -5,9 +20,11 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
public interface ${className}Repository extends JpaRepository<${className}, ${pkColumnType}>, JpaSpecificationExecutor<${className}> {
<#if columns??>
<#list columns as column>
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.service;
import ${package}.domain.${className};
......@@ -10,9 +25,11 @@ import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
public interface ${className}Service {
/**
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package}.service.impl;
import ${package}.domain.${className};
......@@ -27,10 +42,6 @@ import cn.hutool.core.util.IdUtil;
<#if !auto && pkColumnType = 'String'>
import cn.hutool.core.util.IdUtil;
</#if>
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import me.zhengjie.utils.PageUtil;
......@@ -43,11 +54,12 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
/**
* @website https://docs.auauz.net
* @description /
* @author ${author}
* @date ${date}
*/
**/
@Service
//@CacheConfig(cacheNames = "${changeClassName}")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class ${className}ServiceImpl implements ${className}Service {
......@@ -61,20 +73,17 @@ public class ${className}ServiceImpl implements ${className}Service {
}
@Override
//@Cacheable
public Map<String,Object> queryAll(${className}QueryCriteria criteria, Pageable pageable){
Page<${className}> page = ${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
return PageUtil.toPage(page.map(${changeClassName}Mapper::toDto));
}
@Override
//@Cacheable
public List<${className}Dto> queryAll(${className}QueryCriteria criteria){
return ${changeClassName}Mapper.toDto(${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
}
@Override
//@Cacheable(key = "#p0")
public ${className}Dto findById(${pkColumnType} ${pkChangeColName}) {
${className} ${changeClassName} = ${changeClassName}Repository.findById(${pkChangeColName}).orElseGet(${className}::new);
ValidationUtil.isNull(${changeClassName}.get${pkCapitalColName}(),"${className}","${pkChangeColName}",${pkChangeColName});
......@@ -82,7 +91,6 @@ public class ${className}ServiceImpl implements ${className}Service {
}
@Override
//@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class)
public ${className}Dto create(${className} resources) {
<#if !auto && pkColumnType = 'Long'>
......@@ -105,7 +113,6 @@ public class ${className}ServiceImpl implements ${className}Service {
}
@Override
//@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class)
public void update(${className} resources) {
${className} ${changeClassName} = ${changeClassName}Repository.findById(resources.get${pkCapitalColName}()).orElseGet(${className}::new);
......@@ -128,7 +135,6 @@ public class ${className}ServiceImpl implements ${className}Service {
}
@Override
//@CacheEvict(allEntries = true)
public void deleteAll(${pkColumnType}[] ids) {
for (${pkColumnType} ${pkChangeColName} : ids) {
${changeClassName}Repository.deleteById(${pkChangeColName});
......@@ -153,4 +159,4 @@ public class ${className}ServiceImpl implements ${className}Service {
}
FileUtil.downloadExcel(list, response);
}
}
}
\ No newline at end of file
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
......@@ -12,54 +28,49 @@ import java.io.Serializable;
*/
@Data
@Entity
@Table(name = "alipay_config")
@Table(name = "tool_alipay_config")
public class AlipayConfig implements Serializable {
@Id
@Column(name = "config_id")
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
/** 应用ID,APPID,收款账号既是APPID对应支付宝账号 */
@NotBlank
@Column(name = "app_id")
@ApiModelProperty(value = "应用ID")
private String appId;
/** 商户私钥,您的PKCS8格式RSA2私钥 */
@NotBlank
@Column(name = "private_key", columnDefinition = "text")
@ApiModelProperty(value = "商户私钥")
private String privateKey;
/** 支付宝公钥 */
@NotBlank
@Column(name = "public_key", columnDefinition = "text")
@ApiModelProperty(value = "支付宝公钥")
private String publicKey;
/** 签名方式,固定格式 */
@Column(name = "sign_type")
@ApiModelProperty(value = "签名方式")
private String signType="RSA2";
/** 支付宝开放安全地址,一般不会变 */
@Column(name = "gateway_url")
@ApiModelProperty(value = "支付宝开放安全地址", hidden = true)
private String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
/** 编码,固定格式 */
@ApiModelProperty(value = "编码", hidden = true)
private String charset= "utf-8";
/** 异步通知地址 */
@NotBlank
@Column(name = "notify_url")
@ApiModelProperty(value = "异步通知地址")
private String notifyUrl;
/** 订单完成后返回的页面 */
@NotBlank
@Column(name = "return_url")
@ApiModelProperty(value = "订单完成后返回的页面")
private String returnUrl;
/** 类型,固定格式 */
@ApiModelProperty(value = "类型")
private String format="JSON";
/** 商户号 */
@NotBlank
@Column(name = "sys_service_provider_id")
@ApiModelProperty(value = "商户号")
private String sysServiceProviderId;
}
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
......@@ -13,29 +28,31 @@ import java.io.Serializable;
*/
@Entity
@Data
@Table(name = "email_config")
@Table(name = "tool_email_config")
public class EmailConfig implements Serializable {
@Id
@Column(name = "config_id")
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
/** 邮件服务器SMTP地址 */
@NotBlank
@ApiModelProperty(value = "邮件服务器SMTP地址")
private String host;
/** 邮件服务器 SMTP 端口 */
@NotBlank
@ApiModelProperty(value = "邮件服务器 SMTP 端口")
private String port;
/** 发件者用户名,默认为发件人邮箱前缀 */
@NotBlank
@ApiModelProperty(value = "发件者用户名")
private String user;
@NotBlank
@ApiModelProperty(value = "密码")
private String pass;
/** 收件人 */
@NotBlank
@Column(name = "from_user")
@ApiModelProperty(value = "收件人")
private String fromUser;
}
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import org.hibernate.annotations.CreationTimestamp;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* @author Zheng Jie
......@@ -16,55 +30,41 @@ import java.sql.Timestamp;
@Getter
@Setter
@Entity
@Table(name="local_storage")
@Table(name="tool_local_storage")
@NoArgsConstructor
public class LocalStorage implements Serializable {
public class LocalStorage extends BaseEntity implements Serializable {
@Id
@Column(name = "storage_id")
@ApiModelProperty(value = "ID", hidden = true)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
/** 真实文件名 */
@Column(name = "real_name")
@ApiModelProperty(value = "真实文件名")
private String realName;
/**文件名 */
@Column(name = "name")
@ApiModelProperty(value = "文件名")
private String name;
/**后缀 */
@Column(name = "suffix")
@ApiModelProperty(value = "后缀")
private String suffix;
/** 路径 */
@Column(name = "path")
@ApiModelProperty(value = "路径")
private String path;
/** 类型 */
@Column(name = "type")
@ApiModelProperty(value = "类型")
private String type;
/** 大小 */
@Column(name = "size")
@ApiModelProperty(value = "大小")
private String size;
/** 操作人 */
@Column(name = "operate")
private String operate;
@Column(name = "create_time")
@CreationTimestamp
private Timestamp createTime;
public LocalStorage(String realName,String name, String suffix, String path, String type, String size, String operate) {
public LocalStorage(String realName,String name, String suffix, String path, String type, String size) {
this.realName = realName;
this.name = name;
this.suffix = suffix;
this.path = path;
this.type = type;
this.size = size;
this.operate = operate;
}
public void copy(LocalStorage source){
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
......@@ -15,30 +30,39 @@ import java.sql.Timestamp;
*/
@Data
@Entity
@Table(name = "picture")
@Table(name = "tool_picture")
public class Picture implements Serializable {
@Id
@Column(name = "picture_id")
@ApiModelProperty(value = "ID", hidden = true)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ApiModelProperty(value = "文件名")
private String filename;
@ApiModelProperty(value = "图片url")
private String url;
@ApiModelProperty(value = "图片大小")
private String size;
@ApiModelProperty(value = "图片高")
private String height;
@ApiModelProperty(value = "图片宽")
private String width;
@Column(name = "delete_url")
@ApiModelProperty(value = "用于删除的url")
private String delete;
@ApiModelProperty(value = "创建者")
private String username;
@CreationTimestamp
@Column(name = "create_time")
@ApiModelProperty(value = "创建时间")
private Timestamp createTime;
/** 用于检测文件是否重复 */
......
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
......@@ -12,24 +28,24 @@ import java.io.Serializable;
*/
@Data
@Entity
@Table(name = "qiniu_config")
@Table(name = "tool_qiniu_config")
public class QiniuConfig implements Serializable {
@Id
@Column(name = "config_id")
@ApiModelProperty(value = "ID")
private Long id;
/** 一个账号最多拥有两对密钥(Access/Secret Key) */
@NotBlank
@Column(name = "access_key", columnDefinition = "text")
@ApiModelProperty(value = "accessKey")
private String accessKey;
/** 一个账号最多拥有两对密钥(Access/Secret Key) */
@NotBlank
@Column(name = "secret_key", columnDefinition = "text")
@ApiModelProperty(value = "secretKey")
private String secretKey;
/** 存储空间名称作为唯一的 Bucket 识别符 */
@NotBlank
@ApiModelProperty(value = "存储空间名称作为唯一的 Bucket 识别符")
private String bucket;
/**
......@@ -41,12 +57,13 @@ public class QiniuConfig implements Serializable {
* 东南亚 Zone.zoneAs0()
*/
@NotBlank
@ApiModelProperty(value = "Zone表示与机房的对应关系")
private String zone;
/** 外链域名,可自定义,需在七牛云绑定 */
@NotBlank
@ApiModelProperty(value = "外链域名,可自定义,需在七牛云绑定")
private String host;
/** 空间类型:公开/私有 */
@ApiModelProperty(value = "空间类型:公开/私有")
private String type = "公开";
}
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.UpdateTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
......@@ -14,32 +29,36 @@ import java.sql.Timestamp;
*/
@Data
@Entity
@Table(name = "qiniu_content")
@Table(name = "tool_qiniu_content")
public class QiniuContent implements Serializable {
@Id
@Column(name = "content_id")
@ApiModelProperty(value = "ID", hidden = true)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/** 文件名 */
@Column(name = "name")
@ApiModelProperty(value = "文件名")
private String key;
/** 空间名 */
@ApiModelProperty(value = "空间名")
private String bucket;
/** 大小 */
@ApiModelProperty(value = "大小")
private String size;
/** 文件地址 */
@ApiModelProperty(value = "文件地址")
private String url;
@ApiModelProperty(value = "文件类型")
private String suffix;
/** 空间类型:公开/私有 */
@ApiModelProperty(value = "空间类型:公开/私有")
private String type = "公开";
@UpdateTimestamp
@ApiModelProperty(value = "创建或更新时间")
@Column(name = "update_time")
private Timestamp updateTime;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment