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