├── README.md ├── pom.xml ├── quartz.sql └── src ├── main ├── java │ └── com │ │ └── baozi │ │ ├── BecatBootApplication.java │ │ ├── annotation │ │ ├── NoOperator.java │ │ └── Operator.java │ │ ├── config │ │ ├── AlipayConfig.java │ │ ├── Iconfig.java │ │ └── WeChatConfig.java │ │ ├── configurer │ │ ├── CorsConfig.java │ │ ├── DubboConfig.java │ │ ├── ElasticsearchConfig.java │ │ ├── MybatisPlusConfig.java │ │ ├── SwaggerConfig.java │ │ ├── WebMvcConfig.java │ │ ├── quartz │ │ │ ├── SchedledConfiguration.java │ │ │ └── SpringJobFactory.java │ │ └── redis │ │ │ └── RedisConfig.java │ │ ├── constants │ │ └── Constants.java │ │ ├── controller │ │ ├── base │ │ │ └── ResponseBase.java │ │ ├── coupon │ │ │ └── LpzTaobaoCouponController.java │ │ ├── quartz │ │ │ ├── ScheduleJobController.java │ │ │ └── ScheduleJobGroupController.java │ │ └── view │ │ │ └── QuartzViewController.java │ │ ├── dao │ │ ├── coupon │ │ │ └── LpzTaobaoCouponMapper.java │ │ └── quartz │ │ │ ├── QuartzSchedulejobGroupMapper.java │ │ │ └── QuartzSchedulejobMapper.java │ │ ├── entity │ │ ├── coupon │ │ │ └── LpzTaobaoCoupon.java │ │ └── quartz │ │ │ ├── QuartzSchedulejob.java │ │ │ └── QuartzSchedulejobGroup.java │ │ ├── enums │ │ └── StatusType.java │ │ ├── exception │ │ ├── BecatBootException.java │ │ └── GlobalDefaultExceptionHandler.java │ │ ├── factory │ │ └── quartz │ │ │ ├── QuartzJobFactory.java │ │ │ └── SchedulerFactory.java │ │ ├── service │ │ ├── alipay │ │ │ └── AlipayService.java │ │ ├── coupon │ │ │ └── ILpzTaobaoCouponService.java │ │ ├── dubbo │ │ │ └── IDubboService.java │ │ ├── impl │ │ │ ├── alipay │ │ │ │ └── AlipayServiceImpl.java │ │ │ ├── coupon │ │ │ │ └── LpzTaobaoCouponServiceImpl.java │ │ │ ├── dubbo │ │ │ │ └── DubboServiceImpl.java │ │ │ ├── quartz │ │ │ │ ├── QuartzSchedulejobGroupServiceImpl.java │ │ │ │ └── QuartzSchedulejobServiceImpl.java │ │ │ └── wechat │ │ │ │ ├── WXPayConfigImpl.java │ │ │ │ └── WeChatPayServiceImpl.java │ │ ├── quartz │ │ │ ├── IQuartzSchedulejobGroupService.java │ │ │ └── IQuartzSchedulejobService.java │ │ └── wechat │ │ │ └── WeChatPayService.java │ │ ├── servlet │ │ ├── DruidConfiguration.java │ │ └── DruidStatViewServlet.java │ │ ├── task │ │ ├── QqScheduleJob.java │ │ └── WeChatScheduleJob.java │ │ ├── util │ │ ├── AssertUtil.java │ │ ├── BeanUtil.java │ │ ├── DateUtil.java │ │ ├── JsonResult.java │ │ ├── LogUtils.java │ │ ├── LoggerUtils.java │ │ ├── RedisUtil.java │ │ ├── ReflectToStringUtil.java │ │ ├── TokenUtil.java │ │ ├── WebUtil.java │ │ ├── json │ │ │ └── JsonUtil.java │ │ └── spring │ │ │ ├── RequestUtil.java │ │ │ └── SpringContextUtil.java │ │ └── vo │ │ ├── QuartzSchedulejobGroupVo.java │ │ └── QuartzSchedulejobVo.java └── resources │ ├── application.yml │ ├── config.properties │ ├── dubbo.properties │ ├── log4j2.xml │ ├── mapper │ ├── coupon │ │ └── LpzTaobaoCouponMapper.xml │ └── quartz │ │ ├── QuartzSchedulejobGroupMapper.xml │ │ └── QuartzSchedulejobMapper.xml │ ├── static │ ├── favicon.ico │ ├── layui │ │ ├── css │ │ │ ├── layui.css │ │ │ ├── layui.mobile.css │ │ │ ├── modules │ │ │ │ ├── code.css │ │ │ │ ├── images │ │ │ │ │ └── logo-1.png │ │ │ │ ├── index │ │ │ │ │ └── global.css │ │ │ │ ├── laydate │ │ │ │ │ ├── default │ │ │ │ │ │ └── laydate.css │ │ │ │ │ ├── icon.png │ │ │ │ │ └── laydate.css │ │ │ │ ├── layer │ │ │ │ │ └── default │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── layer.css │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ └── loading-2.gif │ │ │ │ ├── login │ │ │ │ │ └── login.css │ │ │ │ └── main.css │ │ │ ├── quartzGroup.css │ │ │ └── quartzList.css │ │ ├── font │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.svg │ │ │ ├── iconfont.ttf │ │ │ └── iconfont.woff │ │ ├── images │ │ │ └── face │ │ │ │ ├── 0.gif │ │ │ │ ├── 1.gif │ │ │ │ ├── 10.gif │ │ │ │ ├── 11.gif │ │ │ │ ├── 12.gif │ │ │ │ ├── 13.gif │ │ │ │ ├── 14.gif │ │ │ │ ├── 15.gif │ │ │ │ ├── 16.gif │ │ │ │ ├── 17.gif │ │ │ │ ├── 18.gif │ │ │ │ ├── 19.gif │ │ │ │ ├── 2.gif │ │ │ │ ├── 20.gif │ │ │ │ ├── 21.gif │ │ │ │ ├── 22.gif │ │ │ │ ├── 23.gif │ │ │ │ ├── 24.gif │ │ │ │ ├── 25.gif │ │ │ │ ├── 26.gif │ │ │ │ ├── 27.gif │ │ │ │ ├── 28.gif │ │ │ │ ├── 29.gif │ │ │ │ ├── 3.gif │ │ │ │ ├── 30.gif │ │ │ │ ├── 31.gif │ │ │ │ ├── 32.gif │ │ │ │ ├── 33.gif │ │ │ │ ├── 34.gif │ │ │ │ ├── 35.gif │ │ │ │ ├── 36.gif │ │ │ │ ├── 37.gif │ │ │ │ ├── 38.gif │ │ │ │ ├── 39.gif │ │ │ │ ├── 4.gif │ │ │ │ ├── 40.gif │ │ │ │ ├── 41.gif │ │ │ │ ├── 42.gif │ │ │ │ ├── 43.gif │ │ │ │ ├── 44.gif │ │ │ │ ├── 45.gif │ │ │ │ ├── 46.gif │ │ │ │ ├── 47.gif │ │ │ │ ├── 48.gif │ │ │ │ ├── 49.gif │ │ │ │ ├── 5.gif │ │ │ │ ├── 50.gif │ │ │ │ ├── 51.gif │ │ │ │ ├── 52.gif │ │ │ │ ├── 53.gif │ │ │ │ ├── 54.gif │ │ │ │ ├── 55.gif │ │ │ │ ├── 56.gif │ │ │ │ ├── 57.gif │ │ │ │ ├── 58.gif │ │ │ │ ├── 59.gif │ │ │ │ ├── 6.gif │ │ │ │ ├── 60.gif │ │ │ │ ├── 61.gif │ │ │ │ ├── 62.gif │ │ │ │ ├── 63.gif │ │ │ │ ├── 64.gif │ │ │ │ ├── 65.gif │ │ │ │ ├── 66.gif │ │ │ │ ├── 67.gif │ │ │ │ ├── 68.gif │ │ │ │ ├── 69.gif │ │ │ │ ├── 7.gif │ │ │ │ ├── 70.gif │ │ │ │ ├── 71.gif │ │ │ │ ├── 8.gif │ │ │ │ └── 9.gif │ │ ├── lay │ │ │ ├── all-mobile.js │ │ │ ├── all.js │ │ │ └── modules │ │ │ │ ├── carousel.js │ │ │ │ ├── code.js │ │ │ │ ├── element.js │ │ │ │ ├── flow.js │ │ │ │ ├── form.js │ │ │ │ ├── jquery.js │ │ │ │ ├── laydate.js │ │ │ │ ├── layedit.js │ │ │ │ ├── layer.js │ │ │ │ ├── laypage.js │ │ │ │ ├── laytpl.js │ │ │ │ ├── mobile.js │ │ │ │ ├── mobile │ │ │ │ ├── layer-mobile.js │ │ │ │ ├── layim-mobile-open.js │ │ │ │ ├── upload-mobile.js │ │ │ │ └── zepto.js │ │ │ │ ├── table.js │ │ │ │ ├── tree.js │ │ │ │ ├── upload.js │ │ │ │ └── util.js │ │ ├── layui.all.js │ │ └── layui.js │ ├── plugins │ │ └── font-awesome │ │ │ ├── css │ │ │ ├── font-awesome.css │ │ │ └── font-awesome.min.css │ │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ └── quartz │ │ ├── quartzGroup.js │ │ └── quartzList.js │ └── templates │ └── quartz │ ├── quartzGroup.html │ └── quartzList.html └── test └── java └── com └── baozi ├── ElasticsearchTest.java ├── MpCodeGenerator.java └── RedisTest.java /README.md: -------------------------------------------------------------------------------- 1 | # SpringBoot集成支付宝、微信支付sdk、实现动态配置quartz任务 2 |

3 | ## 一.部署项目
4 | 1.请自行百度安装`idea`、`redis`、`mysql`、`dubbo`、`zookeeper`,这些是项目运行的基础支撑。
5 | 2.项目导入idea,修改`application.yml`和`dubbo.properties`配置信息,改成自己本地的。
6 | 3.运行项目下的`quartz.sql`文件,数据库名称随意叫,但是记得保持和`application.yml`mysql配置保持一致。
7 | 4.如果不想装`dubbo`、`zookeeper`、`redis`这些,可以直接将相关代码注释掉或者直接干掉,运行main入口程序启动。
8 | 5.项目遇到任何问题,启动不了的同学请联系我,我会提供相应支持。
9 | 6.如果quartz任务不执行,看看quartz所属的任务组是不是启动了!!!特别注意,必须启动任务组,quartz才能启动!!!
10 | 7.访问路径
11 | 任务组列表:http://127.0.0.1:8080/group
12 | 任务列表:http://127.0.0.1:8080/quartz
13 | swagger:http://127.0.0.1:8080/swagger-ui.html 14 | ## 二.效果截图
15 | ![](http://source.doudoucat.com/任务组.png) 16 | ![](http://source.doudoucat.com/任务列表.png) 17 | ![](http://source.doudoucat.com/quartz1.png) 18 |
19 | ## 三.说明与结语
20 | springboot动态配置quartz的demo,实现任务智能化便捷化执行。本项目可直接当做前后端分离的脚手架,除此以外,项目继承了微信、支付宝支付感兴趣的同学可以看看看
21 | 有问题或者有任何疑问请加QQ群:259217951 包括你运行项目的问题,各种问题。我会一一回复你们。如果觉得代码生成器好用,请不要吝啬你的小星星,帮我点点star thanks~~ 那将会是支持我前进的源动力!
22 | 另外推荐一个特别好用的基金自选助手,[https://www.jrcfn.com](https://www.jrcfn.com/) 23 | -------------------------------------------------------------------------------- /quartz.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : 本地环境 5 | Source Server Version : 50610 6 | Source Host : 127.0.0.1:3306 7 | Source Database : test 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50610 11 | File Encoding : 65001 12 | 13 | Date: 2018-08-08 19:35:45 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for quartz_schedulejob 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `quartz_schedulejob`; 22 | CREATE TABLE `quartz_schedulejob` ( 23 | `schedule_job_id` int(11) NOT NULL AUTO_INCREMENT, 24 | `schedule_job_name` varchar(250) NOT NULL DEFAULT '0', 25 | `schedule_job_group_id` int(11) DEFAULT '0', 26 | `status` bit(1) NOT NULL DEFAULT b'0', 27 | `schedule_job_description` varchar(250) DEFAULT '0', 28 | `create_time` datetime NOT NULL, 29 | `schedule_job_cron_expression` varchar(250) NOT NULL DEFAULT '0', 30 | `schedule_job_method` varchar(250) NOT NULL, 31 | `schedule_job_class` varchar(250) NOT NULL, 32 | PRIMARY KEY (`schedule_job_id`), 33 | UNIQUE KEY `schedule_job_name` (`schedule_job_name`), 34 | KEY `schedule_job_group_id` (`schedule_job_group_id`), 35 | CONSTRAINT `schedule_job_group_id` FOREIGN KEY (`schedule_job_group_id`) REFERENCES `quartz_schedulejob_group` (`schedule_job_groupId`) 36 | ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; 37 | 38 | -- ---------------------------- 39 | -- Records of quartz_schedulejob 40 | -- ---------------------------- 41 | INSERT INTO `quartz_schedulejob` VALUES ('20', '微信积分推送任务', '17', '\0', '微信积分推送任务', '2017-04-17 15:32:24', '0 0/1 * * * ? *', 'wechatPush', 'com.baozi.task.WeChatScheduleJob'); 42 | INSERT INTO `quartz_schedulejob` VALUES ('24', 'QQ新闻推送任务', '37', '\0', 'QQ新闻推送任务', '2018-08-08 09:55:29', '* 1-59 * * * ?', 'qqPush', 'com.baozi.task.QqScheduleJob'); 43 | 44 | -- ---------------------------- 45 | -- Table structure for quartz_schedulejob_group 46 | -- ---------------------------- 47 | DROP TABLE IF EXISTS `quartz_schedulejob_group`; 48 | CREATE TABLE `quartz_schedulejob_group` ( 49 | `schedule_job_groupId` int(11) NOT NULL AUTO_INCREMENT, 50 | `schedule_job_group_name` varchar(250) NOT NULL DEFAULT '0', 51 | `schedule_job_group_description` varchar(250) DEFAULT '0', 52 | `status` bit(1) NOT NULL DEFAULT b'1', 53 | `create_time` datetime NOT NULL, 54 | PRIMARY KEY (`schedule_job_groupId`), 55 | UNIQUE KEY `schedule_job_group_name` (`schedule_job_group_name`) 56 | ) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; 57 | 58 | -- ---------------------------- 59 | -- Records of quartz_schedulejob_group 60 | -- ---------------------------- 61 | INSERT INTO `quartz_schedulejob_group` VALUES ('17', '微信任务组', '微信任务组(推送优惠券、推送消息、每日早报)', '\0', '2018-08-03 14:18:14'); 62 | INSERT INTO `quartz_schedulejob_group` VALUES ('37', 'QQ任务组', 'QQ任务组(推送新闻资讯)', '\0', '2018-08-08 09:53:41'); 63 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/BecatBootApplication.java: -------------------------------------------------------------------------------- 1 | package com.baozi; 2 | 3 | import com.alibaba.fastjson.serializer.SerializerFeature; 4 | import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.boot.autoconfigure.http.HttpMessageConverters; 8 | import org.springframework.context.ApplicationContext; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.http.MediaType; 11 | import org.springframework.http.converter.HttpMessageConverter; 12 | import org.springframework.transaction.annotation.EnableTransactionManagement; 13 | import org.mybatis.spring.annotation.MapperScan; 14 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 15 | 16 | import java.nio.charset.Charset; 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | /** 21 | * 系统启动入口 22 | * @author wenjunzhangp 23 | * @since 2018-08-01 24 | */ 25 | @EnableTransactionManagement 26 | @SpringBootApplication 27 | @MapperScan("com.baozi.dao") 28 | @EnableWebMvc 29 | public class BecatBootApplication { 30 | 31 | public static void main(String[] args) { 32 | ApplicationContext run = SpringApplication.run(BecatBootApplication.class, args); 33 | } 34 | 35 | @Bean 36 | public HttpMessageConverters fastJsonHttpMessageConverters() { 37 | FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter(); 38 | List supportedMediaTypes = new ArrayList(); 39 | supportedMediaTypes.add(new MediaType("text", "html", Charset.forName("UTF-8"))); 40 | supportedMediaTypes.add(new MediaType("application", "json", Charset.forName("UTF-8"))); 41 | fastConverter.setSupportedMediaTypes(supportedMediaTypes); 42 | 43 | SerializerFeature[] features = { 44 | // 输出key时是否使用双引号 45 | SerializerFeature.QuoteFieldNames, 46 | //是否输出值为null的字段 47 | SerializerFeature.WriteMapNullValue, 48 | //数值字段如果为null,输出为0,而非null 49 | SerializerFeature.WriteNullNumberAsZero, 50 | //List字段如果为null,输出为[],而非null 51 | SerializerFeature.WriteNullListAsEmpty, 52 | //字符类型字段如果为null,输出为"",而非null 53 | SerializerFeature.WriteNullStringAsEmpty, 54 | //Boolean字段如果为null,输出为false,而非null 55 | //SerializerFeature.WriteNullBooleanAsFalse 56 | // null String不输出 57 | //SerializerFeature.WriteNullStringAsEmpty 58 | //null String也要输出 59 | SerializerFeature.WriteMapNullValue, 60 | //Date的日期转换器 61 | SerializerFeature.WriteDateUseDateFormat, 62 | //禁止循环引用 63 | SerializerFeature.DisableCircularReferenceDetect 64 | }; 65 | 66 | fastConverter.setFeatures(features); 67 | HttpMessageConverter converter = fastConverter; 68 | return new HttpMessageConverters(converter); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/annotation/NoOperator.java: -------------------------------------------------------------------------------- 1 | package com.baozi.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 不需要记录操作日志 10 | * @author wenjunzhangp 11 | * @since 2018-08-01 12 | */ 13 | @Target({ElementType.METHOD, ElementType.TYPE}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface NoOperator { 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/annotation/Operator.java: -------------------------------------------------------------------------------- 1 | package com.baozi.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | 9 | /** 10 | * 记录操作日志 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | @Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | public @interface Operator { 17 | //执行方法的动作 18 | public String story() default ""; 19 | //类名 20 | public String name() default ""; 21 | //是否是标记日志类 22 | public boolean operatorClass() default true; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.config; 2 | 3 | /** 4 | * Copyright: 张文君 5 | * 支付宝支付基础配置类 6 | * 7 | * @author: zhangwenjun 8 | * @version: V1.0 9 | * @Date: 2018-11-02 11:07:23 10 | */ 11 | public class AlipayConfig { 12 | 13 | // 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号 14 | public static String app_id = Iconfig.get("alipay_appid"); 15 | 16 | // 商户私钥,您的PKCS8格式RSA2私钥 17 | public static String merchant_private_key = Iconfig.get("alipay_merchant_private_key"); 18 | 19 | // 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。 20 | public static String alipay_public_key = Iconfig.get("alipay_alipay_public_key"); 21 | 22 | // 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 23 | public static String alipay_pc_notify_url = Iconfig.get("alipay_pc_notify_url"); 24 | 25 | // 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 26 | public static String alipay_pc_return_url = Iconfig.get("alipay_pc_return_url"); 27 | 28 | // 服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 29 | public static String alipay_wap_notify_url = Iconfig.get("alipay_wap_notify_url"); 30 | 31 | // 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 32 | public static String alipay_wap_return_url = Iconfig.get("alipay_wap_return_url"); 33 | 34 | // 签名方式 35 | public static String sign_type = Iconfig.get("alipay_sign_type"); 36 | 37 | // 字符编码格式 38 | public static String charset = Iconfig.get("alipay_charset"); 39 | 40 | // 支付宝网关 41 | public static String gatewayUrl = Iconfig.get("alipay_gatewayUrl"); 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/config/Iconfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.config; 2 | 3 | 4 | import com.baozi.util.LogUtils; 5 | 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.util.Properties; 9 | 10 | public class Iconfig { 11 | 12 | /** 13 | * 同步锁 14 | */ 15 | private static final Object OBJECT = new Object(); 16 | 17 | /** 18 | * 配置文件 19 | */ 20 | private static Properties prop = null; 21 | 22 | /** 23 | * 配置对象单例模式 24 | */ 25 | private static Iconfig config = null; 26 | 27 | /** 28 | * 配置文件名称 29 | */ 30 | private final static String FILE_NAME = "/config.properties"; 31 | 32 | static{ 33 | prop = new Properties(); 34 | try { 35 | InputStream inputStream = Iconfig.class.getResourceAsStream(FILE_NAME); 36 | prop.load(inputStream); 37 | } catch (IOException e) { 38 | LogUtils.logError("加载文件异常,文件路径:%s", e); 39 | } 40 | } 41 | 42 | /** 43 | * 获取单例模式对象实例 44 | * @return 唯一对象实例 45 | */ 46 | public static Iconfig getInstance(){ 47 | if(null==config){ 48 | synchronized (OBJECT) { 49 | config = new Iconfig(); 50 | } 51 | } 52 | return config; 53 | } 54 | 55 | /** 56 | */ 57 | public static String get(String key){ 58 | return prop.getProperty(key); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/config/WeChatConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.config; 2 | 3 | 4 | /** 5 | * Copyright: 包子 6 | * 微信扫码支付配置类 7 | * @author: zhangwenjun 8 | * @version: V1.0 9 | * @Date: 2019-01-02 10:28 10 | */ 11 | public class WeChatConfig { 12 | 13 | // 微信应用的appid 14 | public static String wechat_pay_appid = Iconfig.get("wechat_pay_appid"); 15 | 16 | // 微信商家后台商户id 17 | public static String wechat_pay_mchid = Iconfig.get("wechat_pay_mchid"); 18 | 19 | // 商户自主生成的32位私钥,线上交易切不可随意更改! 20 | public static String wechat_pay_key = Iconfig.get("wechat_pay_key"); 21 | 22 | // 证书路径,某些微信接口需要API证书授权 23 | public static String wechat_pay_cert_path = Iconfig.get("wechat_pay_cert_path"); 24 | 25 | // 证书路径,某些微信接口需要API证书授权 26 | public static String wechat_pay_pkcs8_path = Iconfig.get("wechat_pay_pkcs8_path"); 27 | 28 | // 微信扫码支付异步回调地址 29 | public static String wechat_pc_pay_do_unifiedorder_notify_url = Iconfig.get("wechat_pc_pay_do_unifiedorder_notify_url"); 30 | 31 | // 微信扫码支付异步回调地址 32 | public static String wechat_wap_pay_do_unifiedorder_notify_url = Iconfig.get("wechat_wap_pay_do_unifiedorder_notify_url"); 33 | 34 | // 微信退款异步通知地址 35 | public static String wechat_pay_do_refundorder_notify_url = Iconfig.get("wechat_pay_do_refundorder_notify_url"); 36 | 37 | // 支付方式,此处固定位扫码支付 NATIVE 38 | public static String wechat_pay_trade_type_pc = Iconfig.get("wechat_pay_trade_type_pc"); 39 | 40 | // 支付方式,此处固定位扫码支付 NATIVE 41 | public static String wechat_pay_trade_type_wap = Iconfig.get("wechat_pay_trade_type_wap"); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 10 | 11 | /** 12 | * 黑名单 白名单 跨域策略 13 | * @author wenjunzhangp 14 | * @since 2018-08-01 15 | */ 16 | @Configuration 17 | public class CorsConfig extends WebMvcConfigurerAdapter { 18 | 19 | private CorsConfiguration buildConfig() { 20 | CorsConfiguration corsConfiguration = new CorsConfiguration(); 21 | // 允许任何域名使用 22 | corsConfiguration.addAllowedOrigin("*"); 23 | // 允许任何头 24 | corsConfiguration.addAllowedHeader("*"); 25 | // 允许任何方法(post、get等) 26 | corsConfiguration.addAllowedMethod("*"); 27 | corsConfiguration.setAllowCredentials(true); 28 | return corsConfiguration; 29 | } 30 | 31 | @Bean 32 | public CorsFilter corsFilter() { 33 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 34 | source.registerCorsConfiguration("/**", buildConfig()); 35 | return new CorsFilter(source); 36 | } 37 | 38 | @Override 39 | public void addCorsMappings(CorsRegistry registry) { 40 | registry.addMapping("/**") 41 | .allowedOrigins("*") 42 | .allowCredentials(true) 43 | .allowedMethods("GET", "POST", "DELETE", "PUT") 44 | .maxAge(3600); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/DubboConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer; 2 | 3 | import com.alibaba.dubbo.config.ApplicationConfig; 4 | import com.alibaba.dubbo.config.ProtocolConfig; 5 | import com.alibaba.dubbo.config.ProviderConfig; 6 | import com.alibaba.dubbo.config.RegistryConfig; 7 | import com.alibaba.dubbo.config.spring.AnnotationBean; 8 | import com.alibaba.dubbo.rpc.Exporter; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 11 | import org.springframework.context.annotation.Bean; 12 | import org.springframework.context.annotation.Configuration; 13 | import org.springframework.context.annotation.PropertySource; 14 | 15 | /** 16 | * Copyright: 张文君 17 | * 18 | * @author: zhangwenjun 19 | * @version: V1.0 20 | * @Date: 2018-08-08 15:17 21 | */ 22 | @Configuration 23 | @ConditionalOnClass(Exporter.class) 24 | @PropertySource(value = "classpath:/dubbo.properties") 25 | public class DubboConfig { 26 | 27 | @Value("${dubbo.application.name}") 28 | private String applicationName; 29 | 30 | @Value("${dubbo.registr.protocol}") 31 | private String protocol; 32 | 33 | @Value("${dubbo.registry.address}") 34 | private String registryAddress; 35 | 36 | @Value("${dubbo.protocol.name}") 37 | private String protocolName; 38 | 39 | @Value("${dubbo.protocol.port}") 40 | private int protocolPort; 41 | 42 | @Value("${dubbo.provider.timeout}") 43 | private int timeout; 44 | 45 | @Value("${dubbo.provider.retries}") 46 | private int retries; 47 | 48 | @Value("${dubbo.provider.delay}") 49 | private int delay; 50 | 51 | /** 52 | * 设置dubbo扫描包 53 | * 54 | * @param packageName 55 | * @return 56 | */ 57 | @Bean 58 | public static AnnotationBean annotationBean(@Value("${dubbo.annotation.package}") String packageName) { 59 | AnnotationBean annotationBean = new AnnotationBean(); 60 | annotationBean.setPackage(packageName); 61 | return annotationBean; 62 | } 63 | 64 | /** 65 | * 注入dubbo上下文 66 | * 67 | * @return 68 | */ 69 | @Bean 70 | public ApplicationConfig applicationConfig() { 71 | // 当前应用配置 72 | ApplicationConfig applicationConfig = new ApplicationConfig(); 73 | applicationConfig.setName(this.applicationName); 74 | return applicationConfig; 75 | } 76 | 77 | /** 78 | * 注入dubbo注册中心配置,基于zookeeper 79 | * 80 | * @return 81 | */ 82 | @Bean 83 | public RegistryConfig registryConfig() { 84 | // 连接注册中心配置 85 | RegistryConfig registry = new RegistryConfig(); 86 | registry.setProtocol(protocol); 87 | registry.setAddress(registryAddress); 88 | registry.setPort(protocolPort); 89 | return registry; 90 | } 91 | 92 | /** 93 | * 默认基于dubbo协议提供服务 94 | * 95 | * @return 96 | */ 97 | @Bean 98 | public ProtocolConfig protocolConfig() { 99 | // 服务提供者协议配置 100 | ProtocolConfig protocolConfig = new ProtocolConfig(); 101 | protocolConfig.setName(protocolName); 102 | protocolConfig.setPort(protocolPort); 103 | protocolConfig.setThreads(200); 104 | return protocolConfig; 105 | } 106 | 107 | /** 108 | * dubbo服务提供 109 | * 110 | * @param applicationConfig 111 | * @param registryConfig 112 | * @param protocolConfig 113 | * @return 114 | */ 115 | @Bean(name = "defaultProvider") 116 | public ProviderConfig providerConfig(ApplicationConfig applicationConfig, RegistryConfig registryConfig, 117 | ProtocolConfig protocolConfig) { 118 | ProviderConfig providerConfig = new ProviderConfig(); 119 | providerConfig.setTimeout(timeout); 120 | providerConfig.setRetries(retries); 121 | providerConfig.setDelay(delay); 122 | providerConfig.setApplication(applicationConfig); 123 | providerConfig.setRegistry(registryConfig); 124 | providerConfig.setProtocol(protocolConfig); 125 | return providerConfig; 126 | } 127 | 128 | public String getApplicationName() { 129 | return applicationName; 130 | } 131 | 132 | public void setApplicationName(String applicationName) { 133 | this.applicationName = applicationName; 134 | } 135 | 136 | public String getProtocol() { 137 | return protocol; 138 | } 139 | 140 | public void setProtocol(String protocol) { 141 | this.protocol = protocol; 142 | } 143 | 144 | public String getRegistryAddress() { 145 | return registryAddress; 146 | } 147 | 148 | public void setRegistryAddress(String registryAddress) { 149 | this.registryAddress = registryAddress; 150 | } 151 | 152 | public String getProtocolName() { 153 | return protocolName; 154 | } 155 | 156 | public void setProtocolName(String protocolName) { 157 | this.protocolName = protocolName; 158 | } 159 | 160 | public int getProtocolPort() { 161 | return protocolPort; 162 | } 163 | 164 | public void setProtocolPort(int protocolPort) { 165 | this.protocolPort = protocolPort; 166 | } 167 | 168 | public int getTimeout() { 169 | return timeout; 170 | } 171 | 172 | public void setTimeout(int timeout) { 173 | this.timeout = timeout; 174 | } 175 | 176 | public int getRetries() { 177 | return retries; 178 | } 179 | 180 | public void setRetries(int retries) { 181 | this.retries = retries; 182 | } 183 | 184 | public int getDelay() { 185 | return delay; 186 | } 187 | 188 | public void setDelay(int delay) { 189 | this.delay = delay; 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer; 2 | 3 | import com.baomidou.mybatisplus.MybatisConfiguration; 4 | import com.baomidou.mybatisplus.MybatisXMLLanguageDriver; 5 | import com.baomidou.mybatisplus.entity.GlobalConfiguration; 6 | import com.baomidou.mybatisplus.enums.DBType; 7 | import com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean; 8 | import com.github.pagehelper.PageInterceptor; 9 | import org.apache.ibatis.mapping.DatabaseIdProvider; 10 | import org.apache.ibatis.plugin.Interceptor; 11 | import org.mybatis.spring.boot.autoconfigure.MybatisProperties; 12 | import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.context.annotation.Bean; 15 | import org.springframework.context.annotation.Configuration; 16 | import org.springframework.core.io.DefaultResourceLoader; 17 | import org.springframework.core.io.ResourceLoader; 18 | import org.springframework.util.ObjectUtils; 19 | import org.springframework.util.StringUtils; 20 | 21 | import javax.sql.DataSource; 22 | import java.util.Properties; 23 | 24 | /** 25 | * mybatis插件配置类 26 | * @author wenjunzhangp 27 | * @since 2018-08-01 28 | */ 29 | @Configuration 30 | public class MybatisPlusConfig { 31 | 32 | @Autowired 33 | private DataSource dataSource; 34 | 35 | @Autowired 36 | private MybatisProperties properties; 37 | 38 | @Autowired 39 | private ResourceLoader resourceLoader = new DefaultResourceLoader(); 40 | 41 | @Autowired(required = false) 42 | private Interceptor[] interceptors; 43 | 44 | @Autowired(required = false) 45 | private DatabaseIdProvider databaseIdProvider; 46 | 47 | /** 48 | * pagehelper分页插件 49 | */ 50 | @Bean 51 | public Interceptor getPageHelper(){ 52 | Properties properties=new Properties(); 53 | properties.setProperty("helperDialect","mysql"); 54 | properties.setProperty("reasonable","true"); 55 | properties.setProperty("supportMethodsArguments","true"); 56 | properties.setProperty("params","count=countSql"); 57 | Interceptor interceptor = new PageInterceptor(); 58 | interceptor.setProperties(properties); 59 | return interceptor; 60 | } 61 | 62 | /** 63 | * 这里全部使用mybatis-autoconfigure 已经自动加载的资源。不手动指定 64 | * 配置文件和mybatis-boot的配置文件同步 65 | * @return 66 | */ 67 | @Bean 68 | public MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean() { 69 | MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean(); 70 | mybatisPlus.setDataSource(dataSource); 71 | mybatisPlus.setVfs(SpringBootVFS.class); 72 | if (StringUtils.hasText(this.properties.getConfigLocation())) { 73 | mybatisPlus.setConfigLocation(this.resourceLoader.getResource(this.properties.getConfigLocation())); 74 | } 75 | mybatisPlus.setConfiguration(properties.getConfiguration()); 76 | if (!ObjectUtils.isEmpty(this.interceptors)) { 77 | mybatisPlus.setPlugins(this.interceptors); 78 | } 79 | // pagehelper分页插件实现 80 | mybatisPlus.setPlugins(new Interceptor[] {getPageHelper()}); 81 | // MP 全局配置,更多内容进入类看注释 82 | GlobalConfiguration globalConfig = new GlobalConfiguration(); 83 | globalConfig.setDbType(DBType.MYSQL.name()); 84 | // ID 策略 AUTO->`0`("数据库ID自增") INPUT->`1`(用户输入ID") ID_WORKER->`2`("全局唯一ID") UUID->`3`("全局唯一ID") 85 | globalConfig.setIdType(3); 86 | mybatisPlus.setGlobalConfig(globalConfig); 87 | MybatisConfiguration mc = new MybatisConfiguration(); 88 | mc.setDefaultScriptingLanguage(MybatisXMLLanguageDriver.class); 89 | mybatisPlus.setConfiguration(mc); 90 | if (this.databaseIdProvider != null) { 91 | mybatisPlus.setDatabaseIdProvider(this.databaseIdProvider); 92 | } 93 | if (StringUtils.hasLength(this.properties.getTypeAliasesPackage())) { 94 | mybatisPlus.setTypeAliasesPackage(this.properties.getTypeAliasesPackage()); 95 | } 96 | if (StringUtils.hasLength(this.properties.getTypeHandlersPackage())) { 97 | mybatisPlus.setTypeHandlersPackage(this.properties.getTypeHandlersPackage()); 98 | } 99 | if (!ObjectUtils.isEmpty(this.properties.resolveMapperLocations())) { 100 | mybatisPlus.setMapperLocations(this.properties.resolveMapperLocations()); 101 | } 102 | return mybatisPlus; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 6 | import springfox.documentation.builders.ApiInfoBuilder; 7 | import springfox.documentation.builders.PathSelectors; 8 | import springfox.documentation.builders.RequestHandlerSelectors; 9 | import springfox.documentation.service.ApiInfo; 10 | import springfox.documentation.service.Contact; 11 | import springfox.documentation.spi.DocumentationType; 12 | import springfox.documentation.spring.web.plugins.Docket; 13 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 14 | 15 | /** 16 | * Copyright: 张文君 17 | * 18 | * @author: zhangwenjun 19 | * @version: V1.0 20 | * @Date: 2018-08-06 19:52 21 | */ 22 | @Configuration 23 | @EnableSwagger2 24 | public class SwaggerConfig extends WebMvcConfigurerAdapter { 25 | 26 | @Bean 27 | public Docket createRestApi() { 28 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()) 29 | .select() 30 | .apis(RequestHandlerSelectors.basePackage("com.baozi.controller")) 31 | .paths(PathSelectors.any()).build(); 32 | } 33 | 34 | private ApiInfo apiInfo() { 35 | return new ApiInfoBuilder() 36 | .title("becatBoot API") 37 | .description("API接口手册") 38 | .termsOfServiceUrl("https://www.doudoucat.com") 39 | .contact(new Contact("豆豆的蓝胖子", "https://www.doudoucat.com", "zhangwenjunp@126.com")) 40 | .version("1.0").build(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 6 | 7 | /** 8 | * Copyright: 张文君 9 | * 10 | * @author: zhangwenjun 11 | * @version: V1.0 12 | * @Date: 2018-08-07 13:47 13 | */ 14 | @Configuration 15 | public class WebMvcConfig extends WebMvcConfigurerAdapter { 16 | 17 | @Override 18 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 19 | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); 20 | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); 21 | registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/quartz/SchedledConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer.quartz; 2 | 3 | import org.quartz.Scheduler; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.context.ApplicationContext; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.scheduling.quartz.SchedulerFactoryBean; 11 | 12 | /** 13 | * 14 | * @author wenjunzhangp 15 | * @since 2018-08-01 16 | */ 17 | @Configuration 18 | public class SchedledConfiguration { 19 | 20 | private static Logger logger = LoggerFactory.getLogger(SchedledConfiguration.class); 21 | 22 | @Autowired 23 | private ApplicationContext applicationContext; 24 | @Autowired 25 | private SpringJobFactory springJobFactory; 26 | @Bean 27 | public SchedulerFactoryBean schedulerFactoryBean(){ 28 | 29 | SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); 30 | 31 | return schedulerFactoryBean; 32 | } 33 | 34 | @Bean 35 | public Scheduler scheduler() { 36 | logger.info("scheduler1=" + schedulerFactoryBean().getScheduler()); 37 | return schedulerFactoryBean().getScheduler(); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/quartz/SpringJobFactory.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer.quartz; 2 | 3 | import org.quartz.spi.TriggerFiredBundle; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.beans.factory.config.AutowireCapableBeanFactory; 6 | import org.springframework.scheduling.quartz.AdaptableJobFactory; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | @Component 15 | public class SpringJobFactory extends AdaptableJobFactory { 16 | 17 | @Autowired 18 | private AutowireCapableBeanFactory capableBeanFactory; 19 | 20 | @Override 21 | protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { 22 | Object jobInstance = super.createJobInstance(bundle); 23 | capableBeanFactory.autowireBean(jobInstance); 24 | return jobInstance; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/configurer/redis/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.baozi.configurer.redis; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.PropertyAccessor; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.springframework.cache.CacheManager; 7 | import org.springframework.cache.annotation.CachingConfigurerSupport; 8 | import org.springframework.cache.annotation.EnableCaching; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.data.redis.cache.RedisCacheConfiguration; 12 | import org.springframework.data.redis.cache.RedisCacheManager; 13 | import org.springframework.data.redis.connection.RedisConnectionFactory; 14 | import org.springframework.data.redis.core.RedisTemplate; 15 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 16 | import org.springframework.data.redis.serializer.RedisSerializationContext; 17 | import org.springframework.data.redis.serializer.RedisSerializer; 18 | import org.springframework.data.redis.serializer.StringRedisSerializer; 19 | 20 | import java.time.Duration; 21 | 22 | /** 23 | * Copyright: 张文君 24 | * 25 | * @author: zhangwenjun 26 | * @version: V1.0 27 | * @Date: 2018-08-08 11:58 28 | */ 29 | @Configuration 30 | @EnableCaching 31 | public class RedisConfig extends CachingConfigurerSupport { 32 | 33 | @Bean 34 | public CacheManager cacheManager(RedisConnectionFactory factory) { 35 | RedisSerializer redisSerializer = new StringRedisSerializer(); 36 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); 37 | //解决查询缓存转换异常的问题 38 | ObjectMapper om = new ObjectMapper(); 39 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 40 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 41 | jackson2JsonRedisSerializer.setObjectMapper(om); 42 | // 配置序列化(解决乱码的问题),过期时间30秒 43 | RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig() 44 | .entryTtl(Duration.ofSeconds(30)) 45 | .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) 46 | .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer)) 47 | .disableCachingNullValues(); 48 | RedisCacheManager cacheManager = RedisCacheManager.builder(factory) 49 | .cacheDefaults(config) 50 | .build(); 51 | return cacheManager; 52 | } 53 | 54 | @Bean 55 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) { 56 | RedisTemplate template = new RedisTemplate<>(); 57 | RedisSerializer redisSerializer = new StringRedisSerializer(); 58 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); 59 | ObjectMapper om = new ObjectMapper(); 60 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 61 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 62 | jackson2JsonRedisSerializer.setObjectMapper(om); 63 | template.setConnectionFactory(factory); 64 | //key序列化方式 65 | template.setKeySerializer(redisSerializer); 66 | //value序列化 67 | template.setValueSerializer(jackson2JsonRedisSerializer); 68 | //value hashmap序列化 69 | template.setHashValueSerializer(jackson2JsonRedisSerializer); 70 | return template; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package com.baozi.constants; 2 | 3 | /** 4 | * 系统常量定义类 5 | * @author wenjunzhangp 6 | * @since 2018-08-01 7 | */ 8 | @SuppressWarnings("ALL") 9 | public interface Constants { 10 | 11 | /** 12 | * 错误返回码 13 | */ 14 | int SUCCESS = 0; 15 | /** 16 | * 默认错误 17 | */ 18 | int ERROE = 1; 19 | /** 20 | * 参数错误 21 | */ 22 | int PARAMETER_VALIDATION_ERROR = 2; 23 | /** 24 | * 逻辑业务处理异常 25 | */ 26 | int BUSINESS_ERROR = 3; 27 | /** 28 | * 系统错误 29 | */ 30 | int SYSTEM_ERROR = 4; 31 | 32 | /** 33 | * CACHE_TOKNID 34 | */ 35 | String CACHE_TOKNID = "becatBoot:tokenId_"; 36 | /** 37 | * CACHE_USER_ID 38 | */ 39 | String CACHE_USER_ID = "becatBoot:userId_"; 40 | /** 41 | * token有效期 42 | */ 43 | int CACHE_TOKENID_TIME = 30; 44 | 45 | /** 46 | * 时间判断 30 47 | */ 48 | int DATE_HALF = 30; 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/controller/base/ResponseBase.java: -------------------------------------------------------------------------------- 1 | package com.baozi.controller.base; 2 | 3 | import com.baozi.constants.Constants; 4 | import com.github.pagehelper.PageInfo; 5 | import lombok.Data; 6 | 7 | import java.util.LinkedHashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * 自定义返回响应体 12 | * @author wenjunzhangp 13 | * @since 2018-08-01 14 | */ 15 | @Data 16 | public class ResponseBase { 17 | 18 | /** 响应码 */ 19 | private int code; 20 | /** 错误原因 */ 21 | private String error; 22 | /** 响应数据 */ 23 | private Object data; 24 | 25 | /** 26 | * 处理成功 27 | * @param t 28 | * @return 29 | */ 30 | public ResponseBase successSenior(T t){ 31 | ResponseBase responseBase = new ResponseBase<>(); 32 | responseBase.setCode(Constants.SUCCESS); 33 | responseBase.setData(t); 34 | return responseBase; 35 | } 36 | public static ResponseBase success(String data){ 37 | ResponseBase responseBase = new ResponseBase(); 38 | responseBase.setCode(Constants.SUCCESS); 39 | responseBase.setData(data); 40 | return responseBase; 41 | } 42 | 43 | /** 44 | * 处理失败 45 | * @param msg 46 | * @return 47 | */ 48 | public ResponseBase errorSenior(String msg){ 49 | ResponseBase responseBase = new ResponseBase<>(); 50 | responseBase.setCode(Constants.ERROE); 51 | responseBase.setError(msg); 52 | return responseBase; 53 | } 54 | public static ResponseBase error(String msg){ 55 | ResponseBase responseBase = new ResponseBase<>(); 56 | responseBase.setCode(Constants.ERROE); 57 | responseBase.setError(msg); 58 | return responseBase; 59 | } 60 | 61 | /** 62 | * 自定义返回处理失败的方法 63 | * @param msg 64 | * @param code 65 | * @return 66 | */ 67 | public ResponseBase error(String msg,int code){ 68 | ResponseBase responseBase = new ResponseBase<>(); 69 | responseBase.setCode(code); 70 | responseBase.setError(msg); 71 | return responseBase; 72 | } 73 | 74 | /** 75 | * 自定义返回分页组装数据方法 76 | * @param pageInfo 77 | */ 78 | public static Map setResultMapOkByPage(PageInfo pageInfo){ 79 | Map resultMap = new LinkedHashMap(16); 80 | resultMap.put("code",Constants.SUCCESS); 81 | resultMap.put("msg",""); 82 | resultMap.put("count",pageInfo.getTotal()); 83 | resultMap.put("data",pageInfo.getList()); 84 | return resultMap; 85 | } 86 | 87 | /** 88 | * 分页返回失败的响应体 89 | * @param e 异常信息 90 | */ 91 | public static Map setResultMapError( Exception e ){ 92 | Map resultMap = new LinkedHashMap(16); 93 | resultMap.put("code",Constants.ERROE); 94 | resultMap.put("msg",e.getMessage()); 95 | return resultMap; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/controller/coupon/LpzTaobaoCouponController.java: -------------------------------------------------------------------------------- 1 | package com.baozi.controller.coupon; 2 | 3 | import com.baozi.controller.base.ResponseBase; 4 | import com.baozi.service.coupon.ILpzTaobaoCouponService; 5 | import com.baozi.util.LoggerUtils; 6 | import com.baozi.util.WebUtil; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.util.Map; 16 | 17 | /** 18 | *

19 | * 前端控制器 20 | *

21 | * 22 | * @author wenjunzhangp 23 | * @since 2019-05-14 24 | */ 25 | @Controller 26 | @RequestMapping("coupon") 27 | @Api(tags = "优惠券controller", description = "优惠券controller") 28 | public class LpzTaobaoCouponController { 29 | 30 | @Autowired 31 | ILpzTaobaoCouponService lpzTaobaoCouponService; 32 | 33 | /** 34 | * 优惠券分页列表查询 35 | * @return 36 | */ 37 | @RequestMapping("query/coupon/couponList") 38 | @ResponseBody 39 | @ApiOperation(value="优惠券分页查询", notes="优惠券分页查询") 40 | public Map queryCoupon(HttpServletRequest request){ 41 | try { 42 | Map paramMap = WebUtil.genRequestMapSingle(request); 43 | return ResponseBase.setResultMapOkByPage(lpzTaobaoCouponService.selectCouponList(paramMap)); 44 | } catch ( Exception e ) { 45 | LoggerUtils.logError("优惠券分页查询出现异常",e); 46 | return ResponseBase.setResultMapError(e); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/controller/quartz/ScheduleJobGroupController.java: -------------------------------------------------------------------------------- 1 | package com.baozi.controller.quartz; 2 | 3 | import com.baozi.controller.base.ResponseBase; 4 | import com.baozi.entity.quartz.QuartzSchedulejobGroup; 5 | import com.baozi.enums.StatusType; 6 | import com.baozi.exception.BecatBootException; 7 | import com.baozi.service.quartz.IQuartzSchedulejobGroupService; 8 | import com.baozi.util.LoggerUtils; 9 | import com.baozi.util.WebUtil; 10 | import io.swagger.annotations.Api; 11 | import io.swagger.annotations.ApiImplicitParam; 12 | import io.swagger.annotations.ApiOperation; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | import javax.servlet.http.HttpServletRequest; 19 | import java.util.Date; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | /** 24 | * 任务组controller 25 | * @author wenjunzhangp 26 | * @since 2018-08-01 27 | */ 28 | @RestController 29 | @RequestMapping(value="quartz") 30 | @Api(tags = "定时器任务组controller", description = "定时器任务组controller") 31 | public class ScheduleJobGroupController{ 32 | 33 | @Autowired 34 | private IQuartzSchedulejobGroupService schedulejobGroupService; 35 | 36 | /** 37 | * 新增一个定时器组 状态默认为停止 38 | * @param schedulejobGroup 39 | * @return 40 | */ 41 | @PostMapping("add/quartz/schedulejobGroup") 42 | @ApiOperation(value="新增定时器组", notes="新增定时器组") 43 | @ApiImplicitParam(name = "schedulejobGroup", value = "定时器组实体", required = true, dataType = "QuartzSchedulejobGroup") 44 | public ResponseBase addScheduleJobGroup(QuartzSchedulejobGroup schedulejobGroup){ 45 | schedulejobGroup.setCreateTime(new Date()); 46 | schedulejobGroup.setStatus(StatusType.CONGEAL.getValue()); 47 | boolean result = schedulejobGroupService.insert(schedulejobGroup); 48 | if (result) { 49 | return ResponseBase.success("新增成功"); 50 | }else{ 51 | return ResponseBase.error("新增失败"); 52 | } 53 | } 54 | 55 | /** 56 | * 删除定时器组 57 | * @param scheduleJobGroupId 58 | * @return 59 | */ 60 | @PostMapping("del/quartz/schedulejobGroup") 61 | @ApiOperation(value="删除定时器组", notes="删除定时器组") 62 | @ApiImplicitParam(name = "scheduleJobGroupId", value = "定时器组标志ID", required = true, dataType = "Integer") 63 | public ResponseBase delScheduleJobGroup(Integer scheduleJobGroupId){ 64 | try { 65 | schedulejobGroupService.deleteById(scheduleJobGroupId); 66 | return ResponseBase.success("删除成功"); 67 | } catch ( BecatBootException e ){ 68 | LoggerUtils.logError("删除【"+scheduleJobGroupId+"】任务出现异常",e); 69 | return ResponseBase.error(e.getMessage()); 70 | } 71 | } 72 | 73 | /** 74 | * 编辑定时器组 75 | * @param schedulejobGroup 76 | * @return 77 | */ 78 | @PostMapping("edit/quartz/scheduleJobGroup") 79 | @ApiOperation(value="编辑定时器组", notes="编辑定时器组") 80 | @ApiImplicitParam(name = "schedulejobGroup", value = "定时器组实体", required = true, dataType = "QuartzSchedulejobGroup") 81 | public ResponseBase editScheduleJobGroup(QuartzSchedulejobGroup schedulejobGroup ){ 82 | boolean result = schedulejobGroupService.updateById(schedulejobGroup); 83 | if(result){ 84 | return ResponseBase.success("编辑成功"); 85 | }else { 86 | return ResponseBase.error("编辑失败"); 87 | } 88 | } 89 | 90 | /** 91 | * 分页查询定时器组 默认每页5个 92 | * @param request 93 | * @return 94 | */ 95 | @RequestMapping("query/quartz/scheduleJobGroupList") 96 | @ApiOperation(value="分页查询定时器组 默认每页5个", notes="分页查询定时器组 默认每页5个") 97 | @ApiImplicitParam(name = "schedulejobGroup", value = "定时器组实体", required = true, dataType = "QuartzSchedulejobGroup") 98 | public Map queryScheduleJobGroupList(HttpServletRequest request ){ 99 | try { 100 | Map paramMap = WebUtil.genRequestMapSingle(request); 101 | return ResponseBase.setResultMapOkByPage(schedulejobGroupService.selectQuartzSchedulejobGroupList(paramMap)); 102 | } catch ( Exception e ) { 103 | LoggerUtils.logError("分页查询定时器组出现异常",e); 104 | return ResponseBase.setResultMapError(e); 105 | } 106 | } 107 | 108 | /** 109 | * 加载下拉框数据 110 | * @return 111 | */ 112 | @RequestMapping("query/quartz/scheduleJobGroupAll") 113 | public ResponseBase queryScheduleJobGroupAll(){ 114 | ResponseBase > responseMessage = new ResponseBase<>(); 115 | List list = schedulejobGroupService.selectList(null); 116 | responseMessage.setData(list); 117 | return responseMessage; 118 | } 119 | 120 | /** 121 | * 启动定时器组 122 | * @param scheduleJobGroupId 123 | * @return 124 | */ 125 | @PostMapping("start/quartz/schedulejobGroup") 126 | @ApiOperation(value="启动定时器组", notes="启动定时器组") 127 | @ApiImplicitParam(name = "scheduleJobGroupId", value = "定时器组ID", required = true, dataType = "Integer") 128 | public ResponseBase startScheduleJobGroup( Integer scheduleJobGroupId){ 129 | try { 130 | QuartzSchedulejobGroup quartzSchedulejobGroup = schedulejobGroupService.selectById(scheduleJobGroupId); 131 | quartzSchedulejobGroup.setStatus(StatusType.NORMAL.getValue()); 132 | schedulejobGroupService.updateById(quartzSchedulejobGroup); 133 | return ResponseBase.success("启动成功"); 134 | } catch ( BecatBootException e ){ 135 | LoggerUtils.logError("启动定时器组【"+scheduleJobGroupId+"】任务出现异常",e); 136 | return ResponseBase.error("启动定时器组失败出现异常"); 137 | } 138 | } 139 | 140 | /** 141 | * 停止定时器组 142 | * @param scheduleJobGroupId 143 | * @return 144 | */ 145 | @PostMapping("stop/quartz/schedulejobGroup") 146 | @ApiOperation(value="停止定时器组", notes="停止定时器组") 147 | @ApiImplicitParam(name = "scheduleJobGroupId", value = "定时器组ID", required = true, dataType = "Integer") 148 | public ResponseBase stopScheduleJobGroup(Integer scheduleJobGroupId){ 149 | try { 150 | schedulejobGroupService.congeal(scheduleJobGroupId); 151 | return ResponseBase.success("停止成功"); 152 | } catch ( BecatBootException e ){ 153 | LoggerUtils.logError("停止定时器组【"+scheduleJobGroupId+"】任务出现异常",e); 154 | return ResponseBase.error("停止定时器组失败出现异常"); 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/controller/view/QuartzViewController.java: -------------------------------------------------------------------------------- 1 | package com.baozi.controller.view; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import springfox.documentation.annotations.ApiIgnore; 6 | 7 | /** 8 | * Copyright: 张文君 9 | * 视图跳转controller 10 | * @author: zhangwenjun 11 | * @version: V1.0 12 | * @Date: 2018-08-01 13:38 13 | */ 14 | @Controller 15 | @ApiIgnore() 16 | public class QuartzViewController { 17 | 18 | @RequestMapping("/group") 19 | public String quartzGroup(){ 20 | return "/quartz/quartzGroup"; 21 | } 22 | 23 | @RequestMapping("/quartz") 24 | public String quartzList(){ 25 | return "/quartz/quartzList"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/dao/coupon/LpzTaobaoCouponMapper.java: -------------------------------------------------------------------------------- 1 | package com.baozi.dao.coupon; 2 | 3 | 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import com.baozi.entity.coupon.LpzTaobaoCoupon; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * Mapper 接口 13 | *

14 | * 15 | * @author wenjunzhangp 16 | * @since 2019-05-14 17 | */ 18 | public interface LpzTaobaoCouponMapper extends BaseMapper { 19 | 20 | List selectCouponList(Map paramMap); 21 | 22 | List selectLpzTaobaoCouponAll(Map paramMap); 23 | } -------------------------------------------------------------------------------- /src/main/java/com/baozi/dao/quartz/QuartzSchedulejobGroupMapper.java: -------------------------------------------------------------------------------- 1 | package com.baozi.dao.quartz; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baozi.entity.quartz.QuartzSchedulejobGroup; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * mapper接口 10 | * @author wenjunzhangp 11 | * @since 2018-08-01 12 | */ 13 | public interface QuartzSchedulejobGroupMapper extends BaseMapper { 14 | 15 | /** 16 | * 分页查询任务列表 17 | * @return 18 | */ 19 | List selectQuartzSchedulejobGroupList(); 20 | } -------------------------------------------------------------------------------- /src/main/java/com/baozi/dao/quartz/QuartzSchedulejobMapper.java: -------------------------------------------------------------------------------- 1 | package com.baozi.dao.quartz; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baozi.entity.quartz.QuartzSchedulejob; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * mapper接口 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | public interface QuartzSchedulejobMapper extends BaseMapper { 15 | 16 | /** 17 | * 根据任务id查找具体任务 18 | * @param scheduleJobGroupId 任务id 19 | * @return 20 | */ 21 | List selectQuartzSchedulejobGroupId(@Param("scheduleJobGroupId") Integer scheduleJobGroupId); 22 | 23 | /** 24 | * 分页查询任务列表 25 | * @return 26 | */ 27 | List selectQuartzSchedulejobList(); 28 | 29 | /** 30 | * 查询全部任务 31 | * @return 32 | */ 33 | List selectQuartzSchedulejobAll(); 34 | } -------------------------------------------------------------------------------- /src/main/java/com/baozi/entity/coupon/LpzTaobaoCoupon.java: -------------------------------------------------------------------------------- 1 | package com.baozi.entity.coupon; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import java.math.BigDecimal; 5 | import java.util.Date; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | *

14 | * 15 | *

16 | * 17 | * @author wenjunzhangp 18 | * @since 2019-05-14 19 | */ 20 | @TableName("lpz_taobao_coupon") 21 | @Data 22 | public class LpzTaobaoCoupon extends Model { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * 主键ID 28 | */ 29 | private String id; 30 | /** 31 | * 商品名称 32 | */ 33 | private String goodsname; 34 | /** 35 | * 商品卖点 36 | */ 37 | private String goodsremark; 38 | /** 39 | * 在售价 40 | */ 41 | private BigDecimal onlineprice; 42 | /** 43 | * 折后价 44 | */ 45 | private BigDecimal couponprice; 46 | /** 47 | * 累计销量 48 | */ 49 | private Integer sellcount; 50 | /** 51 | * 上新时间 52 | */ 53 | private String update; 54 | /** 55 | * 卷入库更新时间 56 | */ 57 | private Date createdate; 58 | /** 59 | * 领劵地址 60 | */ 61 | private String linkurl; 62 | 63 | @Override 64 | protected Serializable pkVal() { 65 | return this.id; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/entity/quartz/QuartzSchedulejob.java: -------------------------------------------------------------------------------- 1 | package com.baozi.entity.quartz; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | import com.fasterxml.jackson.annotation.JsonFormat; 9 | import lombok.Data; 10 | 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | 14 | 15 | /** 16 | * 任务实体类 17 | * @author wenjunzhangp 18 | * @since 2018-08-01 19 | */ 20 | @TableName("quartz_schedulejob") 21 | @Data 22 | public class QuartzSchedulejob extends Model { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 任务id */ 27 | @TableId(value = "schedule_job_id", type = IdType.AUTO) 28 | private Integer scheduleJobId; 29 | /** 任务名称 */ 30 | @TableField("schedule_job_name") 31 | private String scheduleJobName; 32 | /** 关联任务组id */ 33 | @TableField("schedule_job_group_id") 34 | private Integer scheduleJobGroupId; 35 | /** 任务分组 */ 36 | @TableField(exist = false) 37 | private QuartzSchedulejobGroup quartzSchedulejobGroup; 38 | /** 任务状态 */ 39 | @TableField("status") 40 | private Integer status; 41 | /** 任务描述 */ 42 | @TableField("schedule_job_description") 43 | private String scheduleJobDescription; 44 | /** 任务创建时间 */ 45 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 46 | @TableField("create_time") 47 | private Date createTime; 48 | /** 任务运行时间表达式 */ 49 | @TableField("schedule_job_cron_expression") 50 | private String scheduleJobCronExpression; 51 | /** 执行方法 */ 52 | @TableField("schedule_job_method") 53 | private String scheduleJobMethod; 54 | /** 任务具体的类 全路径 */ 55 | @TableField("schedule_job_class") 56 | private String scheduleJobClass; 57 | 58 | @Override 59 | protected Serializable pkVal() { 60 | return this.scheduleJobId; 61 | } 62 | 63 | public QuartzSchedulejob() {} 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/entity/quartz/QuartzSchedulejobGroup.java: -------------------------------------------------------------------------------- 1 | package com.baozi.entity.quartz; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | import com.fasterxml.jackson.annotation.JsonFormat; 9 | import lombok.Data; 10 | 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | 14 | 15 | /** 16 | * 任务组实体类 17 | * @author wenjunzhangp 18 | * @since 2018-08-01 19 | */ 20 | @TableName("quartz_schedulejob_group") 21 | @Data 22 | public class QuartzSchedulejobGroup extends Model { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 任务组id */ 27 | @TableId(value = "schedule_job_groupId", type = IdType.AUTO) 28 | private Integer scheduleJobGroupId; 29 | /** 任务组名称 */ 30 | @TableField("schedule_job_group_name") 31 | private String scheduleJobGroupName; 32 | /** 任务组描述 */ 33 | @TableField("schedule_job_group_description") 34 | private String scheduleJobGroupDescription; 35 | /** 任务组状态 */ 36 | @TableField("status") 37 | private Integer status; 38 | /** 任务创建时间 */ 39 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 40 | @TableField("create_time") 41 | private Date createTime; 42 | 43 | @Override 44 | protected Serializable pkVal() { 45 | return this.scheduleJobGroupId; 46 | } 47 | 48 | public QuartzSchedulejobGroup(String scheduleJobGroupName){ 49 | this.scheduleJobGroupName = scheduleJobGroupName; 50 | } 51 | 52 | public QuartzSchedulejobGroup() {} 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/enums/StatusType.java: -------------------------------------------------------------------------------- 1 | package com.baozi.enums; 2 | 3 | /** 4 | * 定时器状态枚举类 5 | * @author wenjunzhangp 6 | * @since 2018-08-01 7 | */ 8 | public enum StatusType { 9 | 10 | /** 11 | * 运行状态 12 | */ 13 | NORMAL(0), 14 | /** 15 | * 停止状态 16 | */ 17 | CONGEAL(1), 18 | /** 19 | * 删除状态 20 | */ 21 | DELETE(2); 22 | 23 | private int value; 24 | 25 | private StatusType(int value){ 26 | this.value = value; 27 | } 28 | 29 | public int getValue(){ 30 | return this.value; 31 | } 32 | 33 | public static StatusType fromTo(int value) 34 | { 35 | StatusType[] values = StatusType.values(); 36 | for (StatusType type : values) 37 | { 38 | if (type.getValue() == value) 39 | { 40 | return type; 41 | } 42 | } 43 | throw new IllegalArgumentException("类型不正确,不能识别为[" + value + "]的类型."); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/exception/BecatBootException.java: -------------------------------------------------------------------------------- 1 | package com.baozi.exception; 2 | 3 | /** 4 | * 自定义业务异常处理类 5 | * @author wenjunzhangp 6 | * @since 2018-08-01 7 | */ 8 | public class BecatBootException extends RuntimeException{ 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | public BecatBootException(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/exception/GlobalDefaultExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.baozi.exception; 2 | 3 | import com.baozi.constants.Constants; 4 | import com.baozi.controller.base.ResponseBase; 5 | import com.baozi.util.DateUtil; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.validation.BindException; 9 | import org.springframework.validation.BindingResult; 10 | import org.springframework.validation.FieldError; 11 | import org.springframework.web.bind.MethodArgumentNotValidException; 12 | import org.springframework.web.bind.WebDataBinder; 13 | import org.springframework.web.bind.annotation.ControllerAdvice; 14 | import org.springframework.web.bind.annotation.ExceptionHandler; 15 | import org.springframework.web.bind.annotation.InitBinder; 16 | import org.springframework.web.bind.annotation.ResponseBody; 17 | 18 | import java.beans.PropertyEditorSupport; 19 | import java.util.Date; 20 | import java.util.List; 21 | 22 | /** 23 | * 异常集中处理 24 | * @author wenjunzhangp 25 | * @since 2018-08-01 26 | */ 27 | @ControllerAdvice 28 | public class GlobalDefaultExceptionHandler{ 29 | 30 | private static final Logger logger = LoggerFactory.getLogger(GlobalDefaultExceptionHandler.class); 31 | 32 | /** 33 | * 全局异常拦截,统一返回错误消息 34 | * @param ex 35 | * @return 36 | */ 37 | @ExceptionHandler({Exception.class}) 38 | @ResponseBody 39 | public ResponseBase exceptionHandle(Exception ex) { 40 | String message = ex.getMessage(); 41 | ResponseBase responseBaseVo = new ResponseBase(); 42 | if (ex instanceof BecatBootException) { 43 | responseBaseVo.setCode(Constants.BUSINESS_ERROR); 44 | logger.error(message); 45 | } else if (ex instanceof BindException){ 46 | BindException bindException = (BindException) ex; 47 | message = getBindingErrors(bindException.getBindingResult()); 48 | responseBaseVo.setCode(Constants.PARAMETER_VALIDATION_ERROR); 49 | logger.error(message); 50 | }else if (ex instanceof MethodArgumentNotValidException){ 51 | MethodArgumentNotValidException methodArgumentNotValidException = (MethodArgumentNotValidException) ex; 52 | message = getBindingErrors(methodArgumentNotValidException.getBindingResult()); 53 | responseBaseVo.setCode(Constants.PARAMETER_VALIDATION_ERROR); 54 | logger.error(message); 55 | } else { 56 | responseBaseVo.setCode(Constants.SYSTEM_ERROR); 57 | logger.error(message,ex); 58 | } 59 | responseBaseVo.setError(message); 60 | return responseBaseVo; 61 | } 62 | 63 | /** 64 | * 组装参数校验错误信息 65 | * @param bindingResult 66 | * @return 67 | */ 68 | private String getBindingErrors(BindingResult bindingResult) { 69 | List fieldErrors = bindingResult.getFieldErrors(); 70 | StringBuilder errorMsg = new StringBuilder(); 71 | for (FieldError fieldError : fieldErrors) { 72 | errorMsg.append(fieldError.getDefaultMessage()).append(";"); 73 | } 74 | return errorMsg.toString(); 75 | } 76 | 77 | /** 78 | * 参数绑定 79 | * @param binder 80 | */ 81 | @InitBinder 82 | protected void initBinder(WebDataBinder binder) { 83 | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { 84 | @Override 85 | public void setAsText(String text) { 86 | setValue(DateUtil.str2Date(text)); 87 | } 88 | }); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/factory/quartz/QuartzJobFactory.java: -------------------------------------------------------------------------------- 1 | package com.baozi.factory.quartz; 2 | 3 | import com.baozi.entity.quartz.QuartzSchedulejob; 4 | import org.quartz.DisallowConcurrentExecution; 5 | import org.quartz.Job; 6 | import org.quartz.JobExecutionContext; 7 | import org.quartz.JobExecutionException; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.lang.reflect.Method; 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | 17 | /** 18 | * 定时器工厂类 19 | * @author wenjunzhangp 20 | * @since 2018-08-01 21 | */ 22 | @DisallowConcurrentExecution 23 | public class QuartzJobFactory implements Job{ 24 | 25 | private static final Logger logger = LoggerFactory.getLogger(QuartzJobFactory.class); 26 | private static Map> maps = new HashMap>(); 27 | 28 | @Override 29 | public void execute(JobExecutionContext context) throws JobExecutionException { 30 | QuartzSchedulejob scheduleJob = (QuartzSchedulejob)context.getMergedJobDataMap().get("scheduleJob"); 31 | logger.info("执行任务--->>>>:"+scheduleJob.getScheduleJobName()); 32 | try { 33 | String className = scheduleJob.getScheduleJobClass(); 34 | Class exec = null; 35 | if(maps.containsKey(className)){ 36 | exec = maps.get(className); 37 | }else{ 38 | ClassLoader clazz = Thread.currentThread().getContextClassLoader(); 39 | if(null==clazz){ 40 | clazz = QuartzJobFactory.class.getClassLoader(); 41 | } 42 | exec=clazz.loadClass(className); 43 | maps.put(className, exec); 44 | } 45 | try { 46 | Method method = exec.getMethod(scheduleJob.getScheduleJobMethod()); 47 | method.invoke(exec.newInstance()); 48 | } catch (NoSuchMethodException e1) { 49 | e1.printStackTrace(); 50 | } catch (SecurityException e1) { 51 | e1.printStackTrace(); 52 | } catch (IllegalAccessException e) { 53 | e.printStackTrace(); 54 | } catch (IllegalArgumentException e) { 55 | e.printStackTrace(); 56 | } catch (InvocationTargetException e) { 57 | e.printStackTrace(); 58 | } catch (InstantiationException e) { 59 | e.printStackTrace(); 60 | } 61 | } catch (ClassNotFoundException e) { 62 | e.printStackTrace(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/alipay/AlipayService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.alipay; 2 | 3 | import com.baozi.util.JsonResult; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | /** 8 | * Copyright: 包子 9 | * 封装支付宝支付工具类 10 | * @author: zhangwenjun 11 | * @version: V1.0 12 | * @Date: 2018-11-19 19:17 13 | */ 14 | public interface AlipayService { 15 | 16 | /** 17 | * 统一收单下单并支付页面接口 18 | * alipay.trade.page.pay 19 | * @param orderno 订单号 20 | * @return 21 | */ 22 | JsonResult pcPay(String orderno, HttpServletRequest request); 23 | 24 | /** 25 | * H5下单接口 26 | * @param orderno 订单号 27 | * @param request 28 | * @return 29 | */ 30 | JsonResult wapPay(String orderno, HttpServletRequest request); 31 | 32 | /** 33 | * app 支付接口 34 | * alipay.trade.app.pay 35 | * @param orderno 订单号 36 | * @return 37 | */ 38 | JsonResult appPay(String orderno, HttpServletRequest request); 39 | 40 | /** 41 | * 统一收单交易关闭接口 42 | * alipay.trade.close 43 | * @param orderno 商户订单号 44 | * @param alipayno 阿里订单号 45 | * @return 46 | */ 47 | JsonResult handlePayClose(String orderno, String alipayno); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/coupon/ILpzTaobaoCouponService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.coupon; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.baozi.entity.coupon.LpzTaobaoCoupon; 5 | import com.github.pagehelper.PageInfo; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 服务类 13 | *

14 | * 15 | * @author wenjunzhangp 16 | * @since 2019-05-14 17 | */ 18 | public interface ILpzTaobaoCouponService extends IService { 19 | 20 | /** 21 | * 优惠券列表分页查询 22 | * @param paramMap 23 | * @return 24 | */ 25 | PageInfo selectCouponList(Map paramMap); 26 | 27 | /** 28 | * 查询所有优惠券数据灌入es中 29 | * @return 30 | */ 31 | PageInfo selectLpzTaobaoCouponAll(Map paramMap); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/dubbo/IDubboService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.dubbo; 2 | 3 | /** 4 | * Copyright: 张文君 5 | * 6 | * @author: zhangwenjun 7 | * @version: V1.0 8 | * @Date: 2018-08-08 14:45 9 | */ 10 | public interface IDubboService { 11 | 12 | /** 13 | * dubbo服务接口 14 | */ 15 | void registerServer(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/impl/coupon/LpzTaobaoCouponServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.impl.coupon; 2 | 3 | import com.baozi.dao.coupon.LpzTaobaoCouponMapper; 4 | import com.baozi.entity.coupon.LpzTaobaoCoupon; 5 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 6 | import com.baozi.service.coupon.ILpzTaobaoCouponService; 7 | import com.github.pagehelper.PageHelper; 8 | import com.github.pagehelper.PageInfo; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | /** 16 | *

17 | * 服务实现类 18 | *

19 | * 20 | * @author wenjunzhangp 21 | * @since 2019-05-14 22 | */ 23 | @Service 24 | public class LpzTaobaoCouponServiceImpl extends ServiceImpl implements ILpzTaobaoCouponService { 25 | 26 | @Autowired(required = false) 27 | LpzTaobaoCouponMapper lpzTaobaoCouponMapper; 28 | 29 | /** 30 | * 优惠券列表分页查询 31 | * 32 | * @param paramMap 33 | * @return 34 | */ 35 | @Override 36 | public PageInfo selectCouponList(Map paramMap) { 37 | PageHelper.startPage(Integer.valueOf(paramMap.get("page").toString()),Integer.valueOf(paramMap.get("limit").toString()),true); 38 | List dataList = lpzTaobaoCouponMapper.selectCouponList(paramMap); 39 | return new PageInfo(dataList); 40 | } 41 | 42 | /** 43 | * 查询所有优惠券数据灌入es中 44 | * 45 | * @return 46 | */ 47 | @Override 48 | public PageInfo selectLpzTaobaoCouponAll(Map paramMap) { 49 | PageHelper.startPage(Integer.valueOf(paramMap.get("page").toString()),Integer.valueOf(paramMap.get("limit").toString()),true); 50 | List dataList = lpzTaobaoCouponMapper.selectLpzTaobaoCouponAll(paramMap); 51 | return new PageInfo(dataList); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/impl/dubbo/DubboServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.impl.dubbo; 2 | 3 | import com.alibaba.dubbo.config.annotation.Service; 4 | import com.baozi.service.dubbo.IDubboService; 5 | import com.baozi.util.LoggerUtils; 6 | 7 | /** 8 | * Copyright: 张文君 9 | * 10 | * @author: zhangwenjun 11 | * @version: V1.0 12 | * @Date: 2018-08-08 14:46 13 | */ 14 | @Service(version = "1.0.0") 15 | public class DubboServiceImpl implements IDubboService{ 16 | 17 | @Override 18 | public void registerServer() { 19 | LoggerUtils.logInfo("hello,this is bebcatboot dubbo!!"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/impl/quartz/QuartzSchedulejobGroupServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.impl.quartz; 2 | 3 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 4 | import com.baozi.annotation.Operator; 5 | import com.baozi.dao.quartz.QuartzSchedulejobGroupMapper; 6 | import com.baozi.dao.quartz.QuartzSchedulejobMapper; 7 | import com.baozi.entity.quartz.QuartzSchedulejob; 8 | import com.baozi.entity.quartz.QuartzSchedulejobGroup; 9 | import com.baozi.enums.StatusType; 10 | import com.baozi.exception.BecatBootException; 11 | import com.baozi.factory.quartz.SchedulerFactory; 12 | import com.baozi.service.quartz.IQuartzSchedulejobGroupService; 13 | import com.github.pagehelper.PageHelper; 14 | import com.github.pagehelper.PageInfo; 15 | import org.quartz.Scheduler; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Service; 18 | import org.springframework.transaction.annotation.Propagation; 19 | import org.springframework.transaction.annotation.Transactional; 20 | 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | /** 25 | * 系统常量定义类 26 | * @author wenjunzhangp 27 | * @since 2018-08-01 28 | */ 29 | @Service 30 | public class QuartzSchedulejobGroupServiceImpl extends ServiceImpl implements IQuartzSchedulejobGroupService { 31 | 32 | @Autowired(required = false) 33 | private QuartzSchedulejobMapper quartzSchedulejobMapper; 34 | 35 | @Autowired(required = false) 36 | private QuartzSchedulejobGroupMapper quartzSchedulejobGroupMapper; 37 | 38 | @Autowired 39 | private Scheduler scheduler; 40 | 41 | @Override 42 | @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Exception.class) 43 | @Operator(story="停止定时器分组") 44 | public void congeal(Integer scheduleJobGroupId) { 45 | QuartzSchedulejobGroup quartzSchedulejobGroup = baseMapper.selectById(scheduleJobGroupId); 46 | QuartzSchedulejob scheduleJob = new QuartzSchedulejob(); 47 | scheduleJob.setQuartzSchedulejobGroup(quartzSchedulejobGroup); 48 | scheduleJobGroupId = quartzSchedulejobGroup.getScheduleJobGroupId(); 49 | List list = quartzSchedulejobMapper.selectQuartzSchedulejobGroupId(scheduleJobGroupId); 50 | //把定时器分组下的所有定时器都停止掉 51 | for(QuartzSchedulejob scheduleJob2 : list){ 52 | scheduleJob2.setQuartzSchedulejobGroup(quartzSchedulejobGroup); 53 | SchedulerFactory.stop(scheduleJob2, scheduler); 54 | //1冻结 0 启动 2 删除 55 | scheduleJob2.setStatus(StatusType.CONGEAL.getValue()); 56 | quartzSchedulejobMapper.updateById(scheduleJob2); 57 | } 58 | quartzSchedulejobGroup.setStatus(StatusType.CONGEAL.getValue()); 59 | baseMapper.updateById(quartzSchedulejobGroup); 60 | } 61 | 62 | @Override 63 | @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Exception.class) 64 | @Operator(story="启动定时器分组") 65 | public void start(Integer scheduleJobGroupId) { 66 | QuartzSchedulejobGroup quartzSchedulejobGroup = baseMapper.selectById(scheduleJobGroupId); 67 | QuartzSchedulejob scheduleJob = new QuartzSchedulejob(); 68 | scheduleJob.setQuartzSchedulejobGroup(quartzSchedulejobGroup); 69 | List list = (List) quartzSchedulejobMapper.selectQuartzSchedulejobGroupId(quartzSchedulejobGroup.getScheduleJobGroupId()); 70 | //把定时器分组下的所有定时器都启动 71 | for(QuartzSchedulejob scheduleJob2 : list){ 72 | //添加到执行队列中 73 | SchedulerFactory.add(scheduleJob2,true, scheduler); 74 | //1冻结 0 启动 2 删除 75 | scheduleJob2.setStatus(StatusType.NORMAL.getValue()); 76 | //启动 77 | quartzSchedulejobMapper.updateById(scheduleJob2); 78 | } 79 | //启动 80 | quartzSchedulejobGroup.setStatus(StatusType.NORMAL.getValue()); 81 | baseMapper.updateById(quartzSchedulejobGroup); 82 | } 83 | 84 | @Override 85 | public boolean deleteById(Integer scheduleJobGroupId) { 86 | List list = (List) quartzSchedulejobMapper.selectQuartzSchedulejobGroupId(scheduleJobGroupId); 87 | if(list != null && list.size() > 0){ 88 | throw new BecatBootException("请先删除该分组下面的任务."); 89 | } 90 | quartzSchedulejobGroupMapper.deleteById(scheduleJobGroupId); 91 | return true; 92 | } 93 | 94 | @Override 95 | public PageInfo selectQuartzSchedulejobGroupList(Map paramMap) { 96 | PageHelper.startPage(Integer.valueOf(paramMap.get("page").toString()),Integer.valueOf(paramMap.get("limit").toString()),true); 97 | List dataList = quartzSchedulejobGroupMapper.selectQuartzSchedulejobGroupList(); 98 | return new PageInfo(dataList); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/impl/wechat/WXPayConfigImpl.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.impl.wechat; 2 | 3 | import com.baozi.config.WeChatConfig; 4 | import com.github.wxpay.sdk.WXPayConfig; 5 | 6 | import java.io.ByteArrayInputStream; 7 | import java.io.File; 8 | import java.io.FileInputStream; 9 | import java.io.InputStream; 10 | 11 | /** 12 | * 配置接口实现类 13 | * 14 | * @author zhangwenjun 15 | * @date 2017-12-18 16 | * @time 10:40 17 | */ 18 | public class WXPayConfigImpl implements WXPayConfig { 19 | 20 | private byte[] certData; 21 | private static WXPayConfigImpl INSTANCE; 22 | 23 | private WXPayConfigImpl() throws Exception { 24 | String certPath = WeChatConfig.wechat_pay_cert_path; 25 | File file = new File(certPath); 26 | InputStream certStream = new FileInputStream(file); 27 | this.certData = new byte[(int) file.length()]; 28 | certStream.read(this.certData); 29 | certStream.close(); 30 | } 31 | 32 | public static WXPayConfigImpl getInstance() throws Exception { 33 | if (INSTANCE == null) { 34 | synchronized (WXPayConfigImpl.class) { 35 | if (INSTANCE == null) { 36 | INSTANCE = new WXPayConfigImpl(); 37 | } 38 | } 39 | } 40 | return INSTANCE; 41 | } 42 | 43 | @Override 44 | public String getAppID() { 45 | return WeChatConfig.wechat_pay_appid; 46 | } 47 | 48 | @Override 49 | public String getMchID() { 50 | return WeChatConfig.wechat_pay_mchid; 51 | } 52 | 53 | @Override 54 | public String getKey() { 55 | return WeChatConfig.wechat_pay_key; 56 | } 57 | 58 | @Override 59 | public InputStream getCertStream() { 60 | ByteArrayInputStream certBis; 61 | certBis = new ByteArrayInputStream(this.certData); 62 | return certBis; 63 | } 64 | 65 | @Override 66 | public int getHttpConnectTimeoutMs() { 67 | return 10000; 68 | } 69 | 70 | @Override 71 | public int getHttpReadTimeoutMs() { 72 | return 30000; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/quartz/IQuartzSchedulejobGroupService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.quartz; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.baozi.entity.quartz.QuartzSchedulejobGroup; 5 | import com.github.pagehelper.PageInfo; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * 具体执行任务的逻辑类 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | public interface IQuartzSchedulejobGroupService extends IService { 15 | 16 | /** 17 | * 停止某个分组下面所有的定时器 18 | * @param scheduleJobGroupId 任务组id 19 | */ 20 | void congeal(Integer scheduleJobGroupId); 21 | 22 | /** 23 | * 启动定时器分组 24 | * @param scheduleJobGroupId 任务组id 25 | */ 26 | void start(Integer scheduleJobGroupId); 27 | 28 | /** 29 | * 删除一个任务组,如果该组下面有任务执行,则不能删除 30 | * @param scheduleJobGroupId 任务组id 31 | * @return 32 | */ 33 | boolean deleteById(Integer scheduleJobGroupId); 34 | 35 | /** 36 | * 分页查询定时器组 37 | * @param paramMap 38 | * @return 39 | */ 40 | PageInfo selectQuartzSchedulejobGroupList(Map paramMap); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/quartz/IQuartzSchedulejobService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.quartz; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.baozi.entity.quartz.QuartzSchedulejob; 5 | import com.github.pagehelper.PageInfo; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * 具体执行任务的逻辑类 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | public interface IQuartzSchedulejobService extends IService { 15 | 16 | /** 17 | * 新增一个执行任务 18 | * @param scheduleJob 19 | * @return 20 | */ 21 | @Override 22 | boolean insert(QuartzSchedulejob scheduleJob); 23 | 24 | /** 25 | * 修改任务 26 | * @param scheduleJob 27 | */ 28 | void update(QuartzSchedulejob scheduleJob); 29 | 30 | /** 31 | * 根据主键删除任务 32 | * @param scheduleJobId 33 | * @return 34 | */ 35 | int delete(Integer scheduleJobId); 36 | 37 | /** 38 | * 停止定时器 39 | * @param scheduleJobId 40 | */ 41 | void congeal(Integer scheduleJobId); 42 | 43 | /** 44 | * 启动定时器 45 | * @param scheduleJobId 46 | */ 47 | void thaw(Integer scheduleJobId); 48 | 49 | /** 50 | * 重启定时器 51 | * @param scheduleJobId 52 | */ 53 | void restart(Integer scheduleJobId); 54 | 55 | /** 56 | * 同步定时器 57 | */ 58 | void async(); 59 | 60 | /** 61 | * 任务列表分页查询 62 | * @param paramMap 63 | * @return 64 | */ 65 | PageInfo selectQuartzSchedulejobList(Map paramMap); 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/service/wechat/WeChatPayService.java: -------------------------------------------------------------------------------- 1 | package com.baozi.service.wechat; 2 | 3 | 4 | import com.baozi.util.JsonResult; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | /** 9 | * Copyright: 包子 10 | * 11 | * @author: zhangwenjun 12 | * @version: V1.0 13 | * @Date: 2019-01-02 10:45 14 | */ 15 | public interface WeChatPayService { 16 | 17 | /** 18 | * 扫码支付:统一下单 19 | * @param orderno 用户订单号(统一下单时所用的订单号) 20 | * @param request 获取下单客户IP 21 | * @return 22 | */ 23 | JsonResult handleDoUnifiedOrder(String orderno, HttpServletRequest request); 24 | 25 | /** 26 | * 微信WAP支付 27 | * @param orderno 订单号 28 | * @param request 29 | * @return 30 | */ 31 | JsonResult handleDoWapUnifiedOrder(String orderno, HttpServletRequest request); 32 | 33 | /** 34 | * 微信APP支付 35 | * @param orderno 订单号 36 | * @param request 37 | * @return 38 | */ 39 | JsonResult handleDoAPPUnifiedOrder(String orderno, HttpServletRequest request); 40 | 41 | /** 42 | * 统一关闭订单:关闭订单 43 | * @param orderno 用户订单号(统一下单时所用的订单号) 44 | * @return 45 | */ 46 | JsonResult doOrderClose(String orderno); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/servlet/DruidConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.baozi.servlet; 2 | 3 | import com.alibaba.druid.pool.DruidDataSource; 4 | import com.alibaba.druid.support.http.StatViewServlet; 5 | import com.alibaba.druid.support.http.WebStatFilter; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 10 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 11 | import org.springframework.context.annotation.Bean; 12 | import org.springframework.context.annotation.Configuration; 13 | 14 | import javax.sql.DataSource; 15 | import java.sql.SQLException; 16 | 17 | 18 | /** 19 | * Copyright: 张文君 20 | * 阿里连接池servlet配置 21 | * @author: zhangwenjun 22 | * @version: V1.0 23 | * @Date: 2018-08-01 13:38 24 | */ 25 | @Configuration 26 | public class DruidConfiguration { 27 | 28 | private static Logger logger = LoggerFactory.getLogger(DruidConfiguration.class); 29 | 30 | /** 31 | * 注册一个StatViewServlet 32 | * @return 33 | */ 34 | @Bean 35 | public ServletRegistrationBean druidStatViewServle2(){ 36 | //org.springframework.boot.context.embedded.ServletRegistrationBean提供类的进行注册. 37 | ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),"/druid/*"); 38 | 39 | //添加初始化参数:initParams 40 | 41 | //白名单: 42 | servletRegistrationBean.addInitParameter("allow","127.0.0.1"); 43 | //IP黑名单 (存在共同时,deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page. 44 | servletRegistrationBean.addInitParameter("deny",""); 45 | //登录查看信息的账号密码. 46 | servletRegistrationBean.addInitParameter("loginUsername","admin"); 47 | servletRegistrationBean.addInitParameter("loginPassword","admin"); 48 | //是否能够重置数据. 49 | servletRegistrationBean.addInitParameter("resetEnable","false"); 50 | return servletRegistrationBean; 51 | } 52 | 53 | /** 54 | * 注册一个:filterRegistrationBean 55 | * @return 56 | */ 57 | @Bean 58 | public FilterRegistrationBean druidStatFilter2(){ 59 | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); 60 | //添加过滤规则. 61 | filterRegistrationBean.addUrlPatterns("/*"); 62 | //添加不需要忽略的格式信息. 63 | filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); 64 | return filterRegistrationBean; 65 | } 66 | 67 | /** 68 | 69 | * 注册dataSouce,这里作为一个例子,只注入了部分参数信息,其它的参数自行扩散思维。 70 | 71 | * @param driver 72 | 73 | * @param url 74 | 75 | * @param username 76 | 77 | * @param password 78 | 79 | * @param maxActive 80 | 81 | * @return 82 | 83 | */ 84 | 85 | @Bean 86 | public DataSource druidDataSource(@Value("${spring.datasource.driver-class-name}") String driver, 87 | @Value("${spring.datasource.url}") String url, 88 | @Value("${spring.datasource.username}") String username, 89 | @Value("${spring.datasource.password}") String password 90 | ) { 91 | DruidDataSource druidDataSource = new DruidDataSource(); 92 | druidDataSource.setDriverClassName(driver); 93 | druidDataSource.setUrl(url); 94 | druidDataSource.setUsername(username); 95 | druidDataSource.setPassword(password); 96 | druidDataSource.setMaxActive(10); 97 | logger.info("DruidConfiguration.druidDataSource(),url="+url+",username="+username+",password="+password); 98 | try { 99 | druidDataSource.setFilters("stat, wall"); 100 | } catch (SQLException e) { 101 | e.printStackTrace(); 102 | } 103 | return druidDataSource; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/servlet/DruidStatViewServlet.java: -------------------------------------------------------------------------------- 1 | package com.baozi.servlet; 2 | 3 | import com.alibaba.druid.support.http.StatViewServlet; 4 | 5 | import javax.servlet.annotation.WebInitParam; 6 | import javax.servlet.annotation.WebServlet; 7 | 8 | /** 9 | * Copyright: 张文君 10 | * 阿里连接池servlet配置 11 | * @author: zhangwenjun 12 | * @version: V1.0 13 | * @Date: 2018-08-01 13:38 14 | */ 15 | @WebServlet(urlPatterns = "/druid/*", 16 | initParams={ 17 | @WebInitParam(name="allow",value="127.0.0.1"),// IP白名单 (没有配置或者为空,则允许所有访问) 18 | @WebInitParam(name="deny",value=""),// IP黑名单 (存在共同时,deny优先于allow) 19 | @WebInitParam(name="loginUsername",value="admin"),// 用户名 20 | @WebInitParam(name="loginPassword",value="admin"),// 密码 21 | @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能 22 | } 23 | ) 24 | public class DruidStatViewServlet extends StatViewServlet { 25 | private static final long serialVersionUID = 1L; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/task/QqScheduleJob.java: -------------------------------------------------------------------------------- 1 | package com.baozi.task; 2 | 3 | /** 4 | * Copyright: 张文君 5 | * 6 | * @author: zhangwenjun 7 | * @version: V1.0 8 | * @Date: 2018-08-08 9:45 9 | */ 10 | public class QqScheduleJob { 11 | 12 | public void qqPush(){ 13 | System.out.println("QQ定时器推送任务开始执行--->>>"+System.currentTimeMillis()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/task/WeChatScheduleJob.java: -------------------------------------------------------------------------------- 1 | package com.baozi.task; 2 | 3 | /** 4 | * Copyright: 张文君 5 | * 6 | * @author: zhangwenjun 7 | * @version: V1.0 8 | * @Date: 2018-08-01 13:32 9 | */ 10 | public class WeChatScheduleJob { 11 | 12 | public void wechatPush(){ 13 | System.out.println("微信定时器推送任务开始执行--->>>"+System.currentTimeMillis()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/AssertUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import com.baozi.exception.BecatBootException; 4 | import org.apache.commons.collections.CollectionUtils; 5 | import org.apache.commons.lang.StringUtils; 6 | 7 | import java.util.Collection; 8 | 9 | /** 10 | * Copyright: 张文君 11 | * 业务异常工具类,语法类似junit断言语法 12 | * 用法: AssertUtil.notEmpty(usersId, "需重新登陆获取"); 13 | * @author: zhangwenjun 14 | * @version: V1.0 15 | * @Date: 2018-08-01 13:38 16 | */ 17 | public class AssertUtil { 18 | 19 | private AssertUtil() { } 20 | 21 | /** 22 | * 断定目标值为false.为true则抛出业务异常 23 | * @param expression 24 | * @param message 25 | * @throws com.baozi.exception.BecatBootException 26 | */ 27 | public static void isFalse(boolean expression, String message) { 28 | if (expression) { 29 | throw new BecatBootException(message); 30 | } 31 | } 32 | 33 | /** 34 | * 断定目标值为true.为false则抛出业务异常 35 | * @param expression 36 | * @param message 37 | * @throws BecatBootException 38 | */ 39 | public static void isTrue(boolean expression, String message) { 40 | if (!expression) { 41 | throw new BecatBootException(message); 42 | } 43 | } 44 | 45 | /** 46 | * 断定目标值为null.不为null则抛出业务异常 47 | * @param obj 48 | * @param message 49 | * @throws BecatBootException 50 | */ 51 | public static void isNull(Object obj, String message) { 52 | if (obj != null) { 53 | throw new BecatBootException(message); 54 | } 55 | } 56 | 57 | /** 58 | * 断定目标值不为null.为null则抛出业务异常 59 | * @param obj 60 | * @param message 61 | */ 62 | public static void notNull(Object obj, String message) { 63 | if (obj == null) { 64 | throw new BecatBootException(message); 65 | } 66 | } 67 | 68 | /** 69 | * 断定目标list不为空.为空则抛出业务异常 70 | * @param collection 71 | * @param message 72 | */ 73 | public static void notEmpty(Collection collection, String message) { 74 | if (CollectionUtils.isEmpty(collection)) { 75 | throw new BecatBootException(message); 76 | } 77 | } 78 | 79 | /** 80 | * 断定目标list为空.不为空则抛出业务异常 81 | * @param collection 82 | * @param message 83 | */ 84 | public static void isEmpty(Collection collection, String message) { 85 | if (CollectionUtils.isNotEmpty(collection)) { 86 | throw new BecatBootException(message); 87 | } 88 | } 89 | 90 | /** 91 | * 断定目标字符串不为空.为空则抛出业务异常 92 | * @param string 93 | * @param message 94 | */ 95 | public static void notEmpty(String string, String message) { 96 | if (StringUtils.isBlank(string)) { 97 | throw new BecatBootException(message); 98 | } 99 | } 100 | 101 | /** 102 | * 断定目标值为不为null.为null则抛出业务异常 103 | * @param integer 104 | * @param message 105 | * @throws BecatBootException 106 | */ 107 | public static void notNull(Integer integer, String message) { 108 | if (integer == null ) { 109 | throw new BecatBootException(message); 110 | } 111 | } 112 | 113 | /** 114 | * 断定目标值为不为null并且不等与0.为null则抛出业务异常 115 | * @param integer 116 | * @param message 117 | * @throws BecatBootException 118 | */ 119 | public static void notEmpty(Integer integer, String message) { 120 | if (integer == null || integer ==0) { 121 | throw new BecatBootException(message); 122 | } 123 | } 124 | 125 | /** 126 | * 断定目标字符串为空.不为空则抛出业务异常 127 | * @param string 128 | * @param message 129 | */ 130 | public static void empty(String string, String message) { 131 | if (StringUtils.isNotBlank(string)) { 132 | throw new BecatBootException(message); 133 | } 134 | } 135 | 136 | /** 137 | * 根据sql返回结果断定新增,修改,删除执行成功 138 | * @param result 139 | * @param message 140 | */ 141 | public static void executeSuccess(int result, String message) { 142 | if (result <= 0) { 143 | throw new BecatBootException(message); 144 | } 145 | } 146 | 147 | } 148 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/BeanUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * [ java反射工具类 ] 7 | * @author wenjunzhangp 8 | * @since 2018-08-01 9 | */ 10 | public class BeanUtil { 11 | 12 | public static Class classExists(String className){ 13 | try { 14 | ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); 15 | if(null==classLoader){ 16 | classLoader = BeanUtil.class.getClassLoader(); 17 | } 18 | return classLoader.loadClass(className); 19 | } catch (Exception e) { 20 | return null; 21 | } 22 | } 23 | 24 | public static Method methodExists(Class class1,String methodName){ 25 | try { 26 | Method[] methods = class1.getDeclaredMethods(); 27 | for(Method method : methods){ 28 | if(method.getName().equals(methodName)){ 29 | return method; 30 | } 31 | } 32 | return null; 33 | } catch (SecurityException e) { 34 | return null; 35 | } 36 | } 37 | 38 | public static boolean parameterTypesExists(Method method){ 39 | try { 40 | Class[] cc = method.getParameterTypes(); 41 | if(0==cc.length){ 42 | return true; 43 | } 44 | return false; 45 | } catch (SecurityException e) { 46 | return false; 47 | } 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import com.baozi.constants.Constants; 4 | import org.apache.commons.lang.StringUtils; 5 | 6 | import java.text.SimpleDateFormat; 7 | import java.util.Calendar; 8 | import java.util.Date; 9 | 10 | /** 11 | * [ 日期工具类 ] 12 | * @author wenjunzhangp 13 | * @since 2018-08-01 14 | */ 15 | public class DateUtil { 16 | 17 | public static final String FULL_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; 18 | 19 | /** 20 | * 按照yyyy-MM-dd HH:mm:ss的格式,日期转字符串 21 | * 22 | * @param date 23 | * @return yyyy-MM-dd HH:mm:ss 24 | */ 25 | public static String date2Str(Date date) { 26 | return date2Str(date, FULL_TIME_FORMAT); 27 | } 28 | 29 | /** 30 | * 按照参数format的格式,日期转字符串 31 | * 32 | * @param date 33 | * @param format 34 | * @return 35 | */ 36 | public static String date2Str(Date date, String format) { 37 | if (date != null) { 38 | SimpleDateFormat sdf = new SimpleDateFormat(format); 39 | return sdf.format(date); 40 | } else { 41 | return ""; 42 | } 43 | } 44 | 45 | public static Date str2Date(String str) { 46 | return str2Date(str, "yyyy-MM-dd"); 47 | } 48 | 49 | public static Date str2Date(String str, String format) { 50 | if (StringUtils.isNotBlank(str)) { 51 | SimpleDateFormat sdf = new SimpleDateFormat(format); 52 | Date parseDate; 53 | try { 54 | parseDate = sdf.parse(str); 55 | } catch (Exception e) { 56 | parseDate = new Date(); 57 | } 58 | return parseDate; 59 | } 60 | return new Date(); 61 | } 62 | 63 | /** 64 | * 根据用户生日计算年龄 65 | */ 66 | public static int getAgeByBirthday(Date birthday) { 67 | if (birthday == null) { 68 | return 0; 69 | } 70 | Calendar cal = Calendar.getInstance(); 71 | if (cal.before(birthday)) { 72 | return 0; 73 | } 74 | 75 | int yearNow = cal.get(Calendar.YEAR); 76 | int monthNow = cal.get(Calendar.MONTH) + 1; 77 | int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); 78 | cal.setTime(birthday); 79 | int yearBirth = cal.get(Calendar.YEAR); 80 | int monthBirth = cal.get(Calendar.MONTH) + 1; 81 | int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH); 82 | int age = yearNow - yearBirth; 83 | 84 | if (monthNow <= monthBirth) { 85 | if (monthNow == monthBirth) { 86 | if (dayOfMonthNow < dayOfMonthBirth) { 87 | age--; 88 | } 89 | } else { 90 | age--; 91 | } 92 | } 93 | return age; 94 | } 95 | 96 | public static long nowSeconds() { 97 | return (long) (System.currentTimeMillis() / 1000); 98 | } 99 | 100 | /** 101 | * 获得当前日期的前一天 102 | * 103 | * @param date 104 | * @return 105 | */ 106 | public static Date getSpecifiedDayBefore(Date date) { 107 | if (date == null) { 108 | return null; 109 | } 110 | Calendar cal = Calendar.getInstance(); 111 | cal.setTime(date); 112 | int day = cal.get(Calendar.DATE); 113 | cal.set(Calendar.DATE, day - 1); 114 | return cal.getTime(); 115 | } 116 | 117 | /** 118 | * 获取时间年月日时00,30 119 | * 120 | * @return 201609210900,201609210930 121 | */ 122 | public static Long getDateMinute() { 123 | SimpleDateFormat sdf = null; 124 | Calendar c = Calendar.getInstance(); 125 | int minute = c.get(Calendar.MINUTE); 126 | if (minute >= Constants.DATE_HALF) { 127 | sdf = new SimpleDateFormat("yyyyMMddHH30"); 128 | } else { 129 | sdf = new SimpleDateFormat("yyyyMMddHH00"); 130 | } 131 | String ss = sdf.format(c.getTime()); 132 | return Long.valueOf(ss); 133 | } 134 | 135 | /** 136 | * 获取时间年月日时00,30 137 | * 138 | * @param date 139 | * @return 201609210900,201609210930 140 | */ 141 | public static Long getDateMinute(Date date) { 142 | SimpleDateFormat sdf = null; 143 | Calendar c = Calendar.getInstance(); 144 | int minute = c.get(Calendar.MINUTE); 145 | if (minute >= Constants.DATE_HALF) { 146 | sdf = new SimpleDateFormat("yyyyMMddHH30"); 147 | } else { 148 | sdf = new SimpleDateFormat("yyyyMMddHH00"); 149 | } 150 | String ss = sdf.format(date); 151 | return Long.valueOf(ss); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/JsonResult.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Copyright: 张文君 7 | * 封装json结果集 8 | * 9 | * @author: zhangwenjun 10 | * @version: V1.0 11 | * @Date: 2018-10-19 10:42 12 | */ 13 | public class JsonResult implements Serializable { 14 | 15 | private Boolean success = false;// 返回是否成功 16 | private String msg = "";// 返回信息 17 | private Object data = null;// 返回其他对象信息 18 | private String code = "";//提示代码 19 | 20 | public Boolean getSuccess() { 21 | return success; 22 | } 23 | 24 | public JsonResult setSuccess(Boolean success) { 25 | this.success = success; 26 | return this; 27 | } 28 | 29 | public String getMsg() { 30 | return msg; 31 | } 32 | 33 | public JsonResult setMsg(String msg) { 34 | this.msg = msg; 35 | return this; 36 | } 37 | 38 | public Object getObj() { 39 | return data; 40 | } 41 | 42 | public JsonResult setObj(Object obj) { 43 | this.data = obj; 44 | return this; 45 | } 46 | 47 | /** 48 | *

TODO

49 | * 50 | * @return: String 51 | */ 52 | public String getCode() { 53 | return code; 54 | } 55 | 56 | /** 57 | *

TODO

58 | * 59 | * @return: String 60 | */ 61 | public JsonResult setCode(String code) { 62 | this.code = code; 63 | return this; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * @author wenjun.zhang 8 | * @create 2018-02-23 14:05 9 | * @description LOG工具类 10 | **/ 11 | public class LogUtils { 12 | /** 13 | * 错误输入日志 14 | */ 15 | public static final Logger log = LoggerFactory.getLogger(LogUtils.class); 16 | 17 | /** 18 | * 记录一直 info信息 19 | * 20 | * @param message 21 | */ 22 | public static void logInfo(String message) { 23 | StringBuilder s = new StringBuilder(); 24 | s.append((message)); 25 | log.info(s.toString()); 26 | } 27 | 28 | public static void logInfo(String message, Throwable e) { 29 | StringBuilder s = new StringBuilder(); 30 | s.append(("exception : -->>")); 31 | s.append((message)); 32 | log.info(s.toString(), e); 33 | } 34 | 35 | public static void logWarn(String message) { 36 | StringBuilder s = new StringBuilder(); 37 | s.append((message)); 38 | 39 | log.warn(s.toString()); 40 | } 41 | 42 | public static void logWarn(String message, Throwable e) { 43 | StringBuilder s = new StringBuilder(); 44 | s.append(("exception : -->>")); 45 | s.append((message)); 46 | log.warn(s.toString(), e); 47 | } 48 | 49 | public static void logDebug(String message) { 50 | StringBuilder s = new StringBuilder(); 51 | s.append((message)); 52 | log.debug(s.toString()); 53 | } 54 | 55 | public static void logDebug(String message, Throwable e) { 56 | StringBuilder s = new StringBuilder(); 57 | s.append(("exception : -->>")); 58 | s.append((message)); 59 | log.debug(s.toString(), e); 60 | } 61 | 62 | public static void logError(String message) { 63 | StringBuilder s = new StringBuilder(); 64 | s.append(message); 65 | log.error(s.toString()); 66 | } 67 | 68 | /** 69 | * 记录日志错误信息 70 | * 71 | * @param message 72 | * @param e 73 | */ 74 | public static void logError(String message, Throwable e) { 75 | StringBuilder s = new StringBuilder(); 76 | s.append(("exception : -->>")); 77 | s.append((message)); 78 | log.error(s.toString(), e); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/LoggerUtils.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * @author wenjun.zhang 8 | * @create 2018-02-23 14:05 9 | * @description LOG工具类 10 | **/ 11 | public class LoggerUtils { 12 | /** 13 | * 错误输入日志 14 | */ 15 | public static final Logger log = LoggerFactory.getLogger(LoggerUtils.class); 16 | 17 | /** 18 | * 记录一直 info信息 19 | * 20 | * @param message 21 | */ 22 | public static void logInfo(String message) { 23 | StringBuilder s = new StringBuilder(); 24 | s.append((message)); 25 | log.info(s.toString()); 26 | } 27 | 28 | public static void logInfo(String message, Throwable e) { 29 | StringBuilder s = new StringBuilder(); 30 | s.append(("exception : -->>")); 31 | s.append((message)); 32 | log.info(s.toString(), e); 33 | } 34 | 35 | public static void logWarn(String message) { 36 | StringBuilder s = new StringBuilder(); 37 | s.append((message)); 38 | 39 | log.warn(s.toString()); 40 | } 41 | 42 | public static void logWarn(String message, Throwable e) { 43 | StringBuilder s = new StringBuilder(); 44 | s.append(("exception : -->>")); 45 | s.append((message)); 46 | log.warn(s.toString(), e); 47 | } 48 | 49 | public static void logDebug(String message) { 50 | StringBuilder s = new StringBuilder(); 51 | s.append((message)); 52 | log.debug(s.toString()); 53 | } 54 | 55 | public static void logDebug(String message, Throwable e) { 56 | StringBuilder s = new StringBuilder(); 57 | s.append(("exception : -->>")); 58 | s.append((message)); 59 | log.debug(s.toString(), e); 60 | } 61 | 62 | public static void logError(String message) { 63 | StringBuilder s = new StringBuilder(); 64 | s.append(message); 65 | log.error(s.toString()); 66 | } 67 | 68 | /** 69 | * 记录日志错误信息 70 | * 71 | * @param message 72 | * @param e 73 | */ 74 | public static void logError(String message, Throwable e) { 75 | StringBuilder s = new StringBuilder(); 76 | s.append(("exception : -->>")); 77 | s.append((message)); 78 | log.error(s.toString(), e); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/ReflectToStringUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Copyright: 张文君 7 | * tostring工具类 8 | * 用法:return ReflectToStringUtil.toStringUtil(this,false); 9 | * @author: zhangwenjun 10 | * @version: V1.0 11 | * @Date: 2018-08-01 13:38 12 | */ 13 | public class ReflectToStringUtil { 14 | 15 | static StringBuffer sb = new StringBuffer(); 16 | 17 | public static String toStringUtil(Object clazs,boolean isOutputNull) { 18 | getParamAndValue(clazs, clazs.getClass(), isOutputNull); 19 | return sb.toString(); 20 | } 21 | 22 | private static void getParamAndValue(Object clazs, Class clazz,boolean isOutputNull) { 23 | Class sc = clazz.getSuperclass(); 24 | Field[] sfields = sc.getDeclaredFields(); 25 | if (sfields.length > 0) { 26 | getParamAndValue(clazs, sc, isOutputNull); 27 | } 28 | Field[] fields = clazz.getDeclaredFields(); 29 | for (Field f : fields) { 30 | f.setAccessible(true); 31 | try { 32 | if (null != f.get(clazs)||isOutputNull){ 33 | sb.append(f.getName() + "=" + f.get(clazs) + "\n"); 34 | } 35 | } catch (IllegalArgumentException | IllegalAccessException e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/TokenUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import sun.misc.BASE64Encoder; 4 | 5 | import java.security.MessageDigest; 6 | import java.security.NoSuchAlgorithmException; 7 | import java.util.Random; 8 | 9 | /** 10 | * 验证用户真实性token工具类 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | public class TokenUtil { 15 | 16 | /** 17 | * 单例设计模式(保证类的对象在内存中只有一个)1、把类的构造函数私有2、自己创建一个类的对象3、对外提供一个公共的方法,返回类的对象 18 | */ 19 | private TokenUtil() {} 20 | 21 | private static final TokenUtil INSTANCE = new TokenUtil(); 22 | 23 | /** 24 | * 返回类的对象 25 | * @return 26 | */ 27 | public static TokenUtil getInstance() { 28 | return INSTANCE; 29 | } 30 | 31 | /** 32 | * 生成Token Token:Nv6RRuGEVvmGjB+jimI/gw== 33 | * @return 34 | */ 35 | public String makeToken() { 36 | String token = (System.currentTimeMillis() + new Random().nextInt(999999999)) + ""; 37 | // 数据指纹 128位长 16个字节 md5 38 | try { 39 | MessageDigest md = MessageDigest.getInstance("md5"); 40 | byte[] md5 = md.digest(token.getBytes()); 41 | // base64编码--任意二进制编码明文字符 42 | BASE64Encoder encoder = new BASE64Encoder(); 43 | String tokenId = encoder.encode(md5); 44 | return tokenId.replace("+", "H"); 45 | } catch (NoSuchAlgorithmException e) { 46 | throw new RuntimeException(e); 47 | } 48 | } 49 | 50 | public static void main(String[] args) { 51 | String tokenId= TokenUtil.getInstance().makeToken(); 52 | System.out.println(tokenId); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/WebUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.baozi.controller.base.ResponseBase; 5 | import com.baozi.util.json.JsonUtil; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.springframework.web.context.request.RequestContextHolder; 8 | import org.springframework.web.context.request.ServletRequestAttributes; 9 | import org.springframework.web.context.request.ServletWebRequest; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.io.PrintWriter; 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | /** 19 | * 接收参数 组装参数工具类 20 | * @author wenjunzhangp 21 | * @since 2018-08-01 22 | */ 23 | public class WebUtil { 24 | 25 | public static HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); 26 | 27 | public static Page getPage(int defaultSie) { 28 | String size = request.getParameter("limit"); 29 | String index = request.getParameter("page"); 30 | int sizeInt = StringUtils.isNotBlank(size)?Integer.parseInt(size):defaultSie; 31 | int current = StringUtils.isNotBlank(index)?Integer.parseInt(index):1; 32 | return new Page<>(current, sizeInt); 33 | } 34 | 35 | public static void responseWrit(ResponseBase responseBase){ 36 | ServletWebRequest servletWebRequest= new ServletWebRequest(request); 37 | HttpServletResponse response=servletWebRequest.getResponse(); 38 | response.setCharacterEncoding("UTF-8"); 39 | response.setContentType("application/json; charset=utf-8"); 40 | PrintWriter out = null; 41 | try { 42 | out = response.getWriter(); 43 | out.append(JsonUtil.toJsonString(responseBase)); 44 | } catch (IOException e) { 45 | e.printStackTrace(); 46 | } finally { 47 | if (out != null) { 48 | out.close(); 49 | } 50 | } 51 | } 52 | 53 | public static void responseWrit(HttpServletResponse response, ResponseBase responseBase){ 54 | response.setCharacterEncoding("UTF-8"); 55 | response.setContentType("application/json; charset=utf-8"); 56 | PrintWriter out = null; 57 | try { 58 | out = response.getWriter(); 59 | out.append(JsonUtil.toJsonString(responseBase)); 60 | } catch (IOException e) { 61 | e.printStackTrace(); 62 | } finally { 63 | if (out != null) { 64 | out.close(); 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * 获取请求属性封装为Map类型 71 | * @param request 72 | * @return 73 | */ 74 | public static Map genRequestMapSingle(HttpServletRequest request) { 75 | Map conditions = new HashMap<>(256); 76 | Map map = request.getParameterMap(); 77 | for (Object o : map.keySet()) { 78 | String key = (String) o; 79 | conditions.put(key, ((String[]) map.get(key))[0]); 80 | } 81 | return conditions; 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/spring/RequestUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util.spring; 2 | 3 | import org.springframework.web.context.request.RequestAttributes; 4 | import org.springframework.web.context.request.RequestContextHolder; 5 | import org.springframework.web.context.request.ServletRequestAttributes; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpSession; 9 | import java.io.File; 10 | 11 | /** 12 | * Copyright: 张文君 13 | * 从requet中取值 14 | * @author: zhangwenjun 15 | * @version: V1.0 16 | * @Date: 2018-08-01 13:38 17 | */ 18 | public class RequestUtil { 19 | 20 | /** 21 | * SpringMVC下获取 request 22 | */ 23 | public static HttpServletRequest getRequest() { 24 | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); 25 | if (requestAttributes == null) { 26 | return null; 27 | } 28 | return ((ServletRequestAttributes)requestAttributes).getRequest(); 29 | } 30 | 31 | /** 32 | * SpringMVC下获取session 33 | */ 34 | public static HttpSession getSession() { 35 | HttpServletRequest request = getRequest(); 36 | if (request == null) { 37 | return null; 38 | } 39 | return request.getSession(); 40 | } 41 | 42 | /** 43 | * SpringMVC 下获取 Servlet RealPath 路径 44 | */ 45 | public static String getServletRealPath(){ 46 | return getSession().getServletContext().getRealPath(File.separator); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/util/spring/SpringContextUtil.java: -------------------------------------------------------------------------------- 1 | package com.baozi.util.spring; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Copyright: 张文君 10 | * 11 | * @author: zhangwenjun 12 | * @version: V1.0 13 | * @Date: 2018-08-08 12:56 14 | */ 15 | @Component 16 | public class SpringContextUtil implements ApplicationContextAware { 17 | 18 | private static ApplicationContext applicationContext; 19 | 20 | @Override 21 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 22 | if(SpringContextUtil.applicationContext == null) { 23 | SpringContextUtil.applicationContext = applicationContext; 24 | } 25 | System.out.println("---------------com.baozi.util.spring.SpringContextUtil------------------------------------------------------"); 26 | System.out.println("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+SpringContextUtil.applicationContext+"========"); 27 | } 28 | 29 | /** 30 | * 获取applicationContext 31 | * @return 32 | */ 33 | public static ApplicationContext getApplicationContext() { 34 | return applicationContext; 35 | } 36 | 37 | /** 38 | * 通过name获取 Bean. 39 | * @param name 40 | * @return 41 | */ 42 | public static Object getBean(String name){ 43 | return getApplicationContext().getBean(name); 44 | } 45 | 46 | /** 47 | * 通过class获取Bean. 48 | * @param clazz 49 | * @param 50 | * @return 51 | */ 52 | public static T getBean(Class clazz){ 53 | return getApplicationContext().getBean(clazz); 54 | } 55 | 56 | /** 57 | * 通过name,以及Clazz返回指定的Bean 58 | * @param name 59 | * @param clazz 60 | * @param 61 | * @return 62 | */ 63 | public static T getBean(String name,Class clazz){ 64 | return getApplicationContext().getBean(name, clazz); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/vo/QuartzSchedulejobGroupVo.java: -------------------------------------------------------------------------------- 1 | package com.baozi.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | 8 | 9 | /** 10 | * 任务组实体类 11 | * @author wenjunzhangp 12 | * @since 2018-08-01 13 | */ 14 | @Data 15 | public class QuartzSchedulejobGroupVo { 16 | 17 | /** 任务组id */ 18 | private Integer scheduleJobGroupId; 19 | /** 任务组名称 */ 20 | private String scheduleJobGroupName; 21 | /** 任务组描述 */ 22 | private String scheduleJobGroupDescription; 23 | /** 任务组状态 */ 24 | private Integer status; 25 | /** 任务创建时间 */ 26 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 27 | private Date createTime; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/baozi/vo/QuartzSchedulejobVo.java: -------------------------------------------------------------------------------- 1 | package com.baozi.vo; 2 | 3 | import com.baozi.entity.quartz.QuartzSchedulejobGroup; 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | 10 | /** 11 | * 任务实体类 12 | * @author wenjunzhangp 13 | * @since 2018-08-01 14 | */ 15 | @Data 16 | public class QuartzSchedulejobVo { 17 | 18 | /** 任务id */ 19 | private Integer scheduleJobId; 20 | /** 任务名称 */ 21 | private String scheduleJobName; 22 | /** 关联任务组id */ 23 | private Integer scheduleJobGroupId; 24 | /** 任务分组 */ 25 | private QuartzSchedulejobGroup quartzSchedulejobGroup; 26 | /** 任务状态 */ 27 | private Integer status; 28 | /** 任务描述 */ 29 | private String scheduleJobDescription; 30 | /** 任务创建时间 */ 31 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 32 | private Date createTime; 33 | /** 任务运行时间表达式 */ 34 | private String scheduleJobCronExpression; 35 | /** 执行方法 */ 36 | private String scheduleJobMethod; 37 | /** 任务具体的类 全路径 */ 38 | private String scheduleJobClass; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 80 3 | logging: 4 | config: classpath:log4j2.xml 5 | mybatis: 6 | mapper-locations: classpath:/mapper/**/*Mapper.xml 7 | type-aliases-package: com.baozi.entity 8 | spring: 9 | datasource: 10 | type: com.alibaba.druid.pool.DruidDataSource 11 | driver-class-name: com.mysql.jdbc.Driver 12 | url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=UTF-8 13 | username: root 14 | password: root 15 | hikari: 16 | pool-name: HikariPool 17 | minimum-idle: 5 18 | maximum-pool-size: 10 19 | connection-timeout: 30000 20 | idle-timeout: 600000 21 | max-lifetime: 1800000 22 | aop: 23 | proxy-target-class: true 24 | redis: 25 | database: 0 26 | host: 127.0.0.1 27 | port: 6379 28 | password: 29 | jedis: 30 | pool: 31 | #最大连接数 32 | max-active: 8 33 | #最大阻塞等待时间(负数表示没限制) 34 | max-wait: -1 35 | #最大空闲 36 | max-idle: 8 37 | #最小空闲 38 | min-idle: 0 39 | #连接超时时间 40 | timeout: 10000 41 | lettuce: 42 | pool: 43 | max-active: 8 44 | max-idle: 8 45 | max-wait: -1ms 46 | min-idle: 0 47 | shutdown-timeout: 100ms 48 | data: 49 | elasticsearch: 50 | cluster-name: elasticsearch 51 | cluster-nodes: 127.0.0.1:9200 52 | repositories: 53 | enabled: true 54 | elasticsearch: 55 | rest: 56 | uris: 127.0.0.1:9200 57 | resources: 58 | static-locations: classpath:/static/,classpath:/templates/ 59 | thymeleaf: 60 | cache: false 61 | mvc: 62 | favicon: 63 | enabled: true 64 | -------------------------------------------------------------------------------- /src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #********************支付宝配置 start******************** 2 | #应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号 3 | alipay_appid= 4 | #商户私钥 PKCS8格式RSA2私钥 5 | alipay_merchant_private_key= 6 | #支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。 7 | alipay_alipay_public_key= 8 | #签名方式 固定值不要改RSA2 9 | alipay_sign_type=RSA2 10 | #编码固定utf-8 11 | alipay_charset=utf-8 12 | #支付宝网关 13 | alipay_gatewayUrl=https://openapi.alipay.com/gateway.do 14 | #页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 PC端 15 | alipay_pc_return_url=http://www.test.com/alipay/syncCallBackPc.do 16 | #服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 PC端 17 | alipay_pc_notify_url=http://www.test.com/alipay/asynchronousCallBackPc.do 18 | #页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 WAP端 19 | alipay_wap_return_url=http://www.test.com/alipay/syncCallBackWap.do 20 | #服务器异步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 WAP端 21 | alipay_wap_notify_url=http://www.test.com/alipay/asynchronousCallBackWap.do 22 | #********************支付宝配置 end******************** 23 | 24 | #********************微信支付配置 start******************** 25 | #微信服务号、微信支付的appid 26 | wechat_pay_appid= 27 | #微信商家后台商户id 28 | wechat_pay_mchid= 29 | #商户自主生成的32位私钥,线上交易切不可随意更改! 30 | wechat_pay_key= 31 | #证书路径,某些微信接口需要API证书授权 微信支付商户后台可以下载 32 | wechat_pay_cert_path=C:\\Users\\Administrator\\Desktop\\cert\\apiclient_cert.p12 33 | #PKCS8秘钥文件 34 | wechat_pay_pkcs8_path=C:\\Users\\Administrator\\Desktop\\cert\\pkcs8_pubkey.pem 35 | #微信扫码支付异步回调地址 PC端 36 | wechat_pc_pay_do_unifiedorder_notify_url=http://www.test.com/wechat/payResultCallbackPc.do 37 | #微信扫码支付异步回调地址 WAP端 38 | wechat_wap_pay_do_unifiedorder_notify_url=http://www.test.com/wechat/payResultCallbackWap.do 39 | #微信退款异步通知地址 40 | wechat_pay_do_refundorder_notify_url=http://www.test.com/wechat/refundResultCallback.do 41 | #支付方式,此处固定位扫码支付 NATIVE PC端 42 | wechat_pay_trade_type_pc=NATIVE 43 | #支付方式,此处固定位wap支付 MWEB WAP端 44 | wechat_pay_trade_type_wap=MWEB 45 | #********************微信支付配置 end******************** 46 | -------------------------------------------------------------------------------- /src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | dubbo.application.name:becatBootProvider 2 | dubbo.annotation.package=com.baozi.service.dubbo 3 | dubbo.registr.protocol=zookeeper 4 | dubbo.registry.address=zookeeper://127.0.0.1:2181 5 | dubbo.registry.register=true 6 | dubbo.registry.subscribe=true 7 | dubbo.protocol.name=dubbo 8 | dubbo.protocol.port=20890 9 | dubbo.application.logger=slf4j 10 | dubbo.protocol.accessLog=true 11 | dubbo.provider.timeout=3000 12 | dubbo.provider.retries=1 13 | dubbo.provider.delay=-1 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /home/becatBoot/logs 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/mapper/coupon/LpzTaobaoCouponMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | id, goodsname, goodsremark, onlineprice, couponprice, sellcount, update, createdate, linkurl 21 | 22 | 23 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/mapper/quartz/QuartzSchedulejobGroupMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/mapper/quartz/QuartzSchedulejobMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | WHERE 1=1 42 | 43 | 44 | AND schedule_job_group_id = #{scheduleJobGroupId} 45 | 46 | 47 | AND schedule_job_name like 48 | CONCAT('%',#{scheduleJobGroupName},'%') 49 | 50 | 52 | AND schedule_job_description like 53 | CONCAT('%',#{scheduleJobGroupDescription},'%') 54 | 55 | 56 | AND status = #{status} 57 | 58 | 59 | 60 | 64 | 65 | 69 | 70 | 75 | 76 | 79 | 80 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/images/logo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/images/logo-1.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/laydate/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/laydate/icon.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/login/login.css: -------------------------------------------------------------------------------- 1 | .beg-login-bg { 2 | 3 | background-color: #393D49; 4 | } 5 | 6 | .beg-login-box { 7 | width: 450px; 8 | height: 362px; 9 | margin: 10% auto; 10 | background-color: rgba(255, 255, 255, 0.407843); 11 | border-radius: 10px; 12 | color: aliceblue; 13 | } 14 | 15 | .beg-login-box header { 16 | height: 39px; 17 | padding: 10px; 18 | border-bottom: 1px solid aliceblue; 19 | } 20 | 21 | .beg-login-box header h1 { 22 | text-align: center; 23 | font-size: 25px; 24 | line-height: 40px; 25 | } 26 | 27 | .beg-login-box .beg-login-main { 28 | height: 185px; 29 | padding: 30px 90px 0; 30 | } 31 | 32 | .beg-login-main .layui-form-item { 33 | position: relative; 34 | } 35 | 36 | .beg-login-main .layui-form-item .beg-login-icon { 37 | position: absolute; 38 | color: #cccccc; 39 | top: 10px; 40 | left: 10px; 41 | } 42 | 43 | .beg-login-main .layui-form-item input { 44 | padding-left: 34px; 45 | } 46 | 47 | .beg-login-box footer { 48 | height: 35px; 49 | padding: 10px 10px 0 10px; 50 | } 51 | 52 | .beg-login-box footer p { 53 | line-height: 35px; 54 | text-align: center; 55 | } 56 | 57 | .beg-pull-left { 58 | float: left !important; 59 | } 60 | 61 | .beg-pull-right { 62 | float: right !important; 63 | } 64 | 65 | .beg-clear { 66 | clear: both; 67 | } 68 | 69 | .beg-login-remember { 70 | line-height: 38px; 71 | } 72 | 73 | .beg-login-remember .layui-form-switch { 74 | margin-top: 0px; 75 | } 76 | 77 | .beg-login-code-box { 78 | position: relative; 79 | padding: 10px; 80 | } 81 | 82 | .beg-login-code-box input { 83 | position: absolute; 84 | width: 100px; 85 | } 86 | 87 | .beg-login-code-box img { 88 | cursor: pointer; 89 | position: absolute; 90 | left: 115px; 91 | height: 38px; 92 | } -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/main.css: -------------------------------------------------------------------------------- 1 | .admin-main{ 2 | margin: 15px; 3 | } 4 | .admin-main .layui-field-title .layui-field-box{ 5 | padding: 10px 30px; 6 | } 7 | .admin-main .layui-field-title .layui-field-box p{ 8 | padding: 5px 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/quartzGroup.css: -------------------------------------------------------------------------------- 1 | .layui-btn-small { 2 | padding: 0 15px; 3 | } 4 | 5 | .layui-form-checkbox { 6 | margin: 0; 7 | } 8 | 9 | tr td:not(:nth-child(0)), 10 | tr th:not(:nth-child(0)) { 11 | text-align: center; 12 | } 13 | 14 | #dataConsole { 15 | text-align: center; 16 | } 17 | /*分页页容量样式*/ 18 | /*可选*/ 19 | .layui-laypage { 20 | display: block; 21 | } 22 | 23 | /*可选*/ 24 | .layui-laypage > * { 25 | float: left; 26 | } 27 | /*可选*/ 28 | .layui-laypage .laypage-extend-pagesize { 29 | float: right; 30 | } 31 | /*可选*/ 32 | .layui-laypage:after { 33 | content: "."; 34 | display: block; 35 | height: 0; 36 | clear: both; 37 | visibility: hidden; 38 | } 39 | 40 | /*必须*/ 41 | .layui-laypage .laypage-extend-pagesize { 42 | height: 30px; 43 | line-height: 30px; 44 | margin: 0px; 45 | border: none; 46 | font-weight: 400; 47 | } 48 | /*分页页容量样式END*/ 49 | 50 | .hidecustom{ 51 | display: none; 52 | } -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/quartzList.css: -------------------------------------------------------------------------------- 1 | .layui-btn-small { 2 | padding: 0 15px; 3 | } 4 | 5 | .layui-form-checkbox { 6 | margin: 0; 7 | } 8 | 9 | tr td:not(:nth-child(0)), 10 | tr th:not(:nth-child(0)) { 11 | text-align: center; 12 | } 13 | 14 | #dataConsole { 15 | text-align: center; 16 | } 17 | /*分页页容量样式*/ 18 | /*可选*/ 19 | .layui-laypage { 20 | display: block; 21 | } 22 | 23 | /*可选*/ 24 | .layui-laypage > * { 25 | float: left; 26 | } 27 | /*可选*/ 28 | .layui-laypage .laypage-extend-pagesize { 29 | float: right; 30 | } 31 | /*可选*/ 32 | .layui-laypage:after { 33 | content: "."; 34 | display: block; 35 | height: 0; 36 | clear: both; 37 | visibility: hidden; 38 | } 39 | 40 | /*必须*/ 41 | .layui-laypage .laypage-extend-pagesize { 42 | height: 30px; 43 | line-height: 30px; 44 | margin: 0px; 45 | border: none; 46 | font-weight: 400; 47 | } 48 | /*分页页容量样式END*/ 49 | 50 | .hidecustom{ 51 | display: none; 52 | } -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/font/iconfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/font/iconfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/10.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/11.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/12.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/13.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/14.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/15.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/16.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/17.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/18.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/19.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/2.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/20.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/21.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/22.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/23.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/24.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/25.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/26.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/27.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/28.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/29.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/3.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/30.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/31.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/32.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/33.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/34.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/35.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/36.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/37.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/38.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/39.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/4.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/40.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/41.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/42.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/43.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/44.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/45.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/46.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/47.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/48.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/49.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/5.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/50.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/51.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/52.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/53.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/54.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/55.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/56.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/57.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/58.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/59.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/6.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/60.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/61.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/62.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/63.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/64.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/65.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/66.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/67.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/68.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/69.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/7.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/70.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/71.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/8.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenjunzhangp/becatBoot/499a1b20743e35faec4b90c84ccdad144aec468a/src/main/resources/static/layui/images/face/9.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/all-mobile.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:用于打包移动完整版 4 | @Author:贤心 5 | @License:LGPL 6 | 7 | */ 8 | 9 | layui.define(function(exports){ 10 | exports('layui.mobile', layui.v); 11 | }); 12 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/all.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:用于打包PC完整版,即包含layui.js和所有模块的完整合并(该文件不会存在于构建后的目录) 4 | @Author:贤心 5 | @License:LGPL 6 | 7 | */ 8 | 9 | layui.define(function(exports){ 10 | var cache = layui.cache; 11 | layui.config({ 12 | dir: cache.dir.replace(/lay\/dest\/$/, '') 13 | }); 14 | exports('layui.all', layui.v); 15 | }); 16 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/mobile/layer-mobile.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @Name:layer mobile v2.0.0 弹层组件移动版 4 | @Author:贤心 5 | @Site:http://layer.layui.com/mobie/ 6 | @License:MIT 7 | 8 | */ 9 | 10 | layui.define(function(exports){ 11 | 12 | "use strict"; 13 | 14 | var win = window, doc = document, query = 'querySelectorAll', claname = 'getElementsByClassName', S = function(s){ 15 | return doc[query](s); 16 | }; 17 | 18 | //默认配置 19 | var config = { 20 | type: 0 21 | ,shade: true 22 | ,shadeClose: true 23 | ,fixed: true 24 | ,anim: 'scale' //默认动画类型 25 | }; 26 | 27 | var ready = { 28 | extend: function(obj){ 29 | var newobj = JSON.parse(JSON.stringify(config)); 30 | for(var i in obj){ 31 | newobj[i] = obj[i]; 32 | } 33 | return newobj; 34 | }, 35 | timer: {}, end: {} 36 | }; 37 | 38 | //点触事件 39 | ready.touch = function(elem, fn){ 40 | elem.addEventListener('click', function(e){ 41 | fn.call(this, e); 42 | }, false); 43 | }; 44 | 45 | var index = 0, classs = ['layui-m-layer'], Layer = function(options){ 46 | var that = this; 47 | that.config = ready.extend(options); 48 | that.view(); 49 | }; 50 | 51 | Layer.prototype.view = function(){ 52 | var that = this, config = that.config, layerbox = doc.createElement('div'); 53 | 54 | that.id = layerbox.id = classs[0] + index; 55 | layerbox.setAttribute('class', classs[0] + ' ' + classs[0]+(config.type || 0)); 56 | layerbox.setAttribute('index', index); 57 | 58 | //标题区域 59 | var title = (function(){ 60 | var titype = typeof config.title === 'object'; 61 | return config.title 62 | ? '

'+ (titype ? config.title[0] : config.title) +'

' 63 | : ''; 64 | }()); 65 | 66 | //按钮区域 67 | var button = (function(){ 68 | typeof config.btn === 'string' && (config.btn = [config.btn]); 69 | var btns = (config.btn || []).length, btndom; 70 | if(btns === 0 || !config.btn){ 71 | return ''; 72 | } 73 | btndom = ''+ config.btn[0] +'' 74 | if(btns === 2){ 75 | btndom = ''+ config.btn[1] +'' + btndom; 76 | } 77 | return '
'+ btndom + '
'; 78 | }()); 79 | 80 | if(!config.fixed){ 81 | config.top = config.hasOwnProperty('top') ? config.top : 100; 82 | config.style = config.style || ''; 83 | config.style += ' top:'+ ( doc.body.scrollTop + config.top) + 'px'; 84 | } 85 | 86 | if(config.type === 2){ 87 | config.content = '

'+ (config.content||'') +'

'; 88 | } 89 | 90 | if(config.skin) config.anim = 'up'; 91 | if(config.skin === 'msg') config.shade = false; 92 | 93 | layerbox.innerHTML = (config.shade ? '
' : '') 94 | +'
' 95 | +'
' 96 | +'
' 97 | + title 98 | +'
'+ config.content +'
' 99 | + button 100 | +'
' 101 | +'
' 102 | +'
'; 103 | 104 | if(!config.type || config.type === 2){ 105 | var dialogs = doc[claname](classs[0] + config.type), dialen = dialogs.length; 106 | if(dialen >= 1){ 107 | layer.close(dialogs[0].getAttribute('index')) 108 | } 109 | } 110 | 111 | document.body.appendChild(layerbox); 112 | var elem = that.elem = S('#'+that.id)[0]; 113 | config.success && config.success(elem); 114 | 115 | that.index = index++; 116 | that.action(config, elem); 117 | }; 118 | 119 | Layer.prototype.action = function(config, elem){ 120 | var that = this; 121 | 122 | //自动关闭 123 | if(config.time){ 124 | ready.timer[that.index] = setTimeout(function(){ 125 | layer.close(that.index); 126 | }, config.time*1000); 127 | } 128 | 129 | //确认取消 130 | var btn = function(){ 131 | var type = this.getAttribute('type'); 132 | if(type == 0){ 133 | config.no && config.no(); 134 | layer.close(that.index); 135 | } else { 136 | config.yes ? config.yes(that.index) : layer.close(that.index); 137 | } 138 | }; 139 | if(config.btn){ 140 | var btns = elem[claname]('layui-m-layerbtn')[0].children, btnlen = btns.length; 141 | for(var ii = 0; ii < btnlen; ii++){ 142 | ready.touch(btns[ii], btn); 143 | } 144 | } 145 | 146 | //点遮罩关闭 147 | if(config.shade && config.shadeClose){ 148 | var shade = elem[claname]('layui-m-layershade')[0]; 149 | ready.touch(shade, function(){ 150 | layer.close(that.index, config.end); 151 | }); 152 | } 153 | 154 | config.end && (ready.end[that.index] = config.end); 155 | }; 156 | 157 | var layer = { 158 | v: '2.0 m', 159 | index: index, 160 | 161 | //核心方法 162 | open: function(options){ 163 | var o = new Layer(options || {}); 164 | return o.index; 165 | }, 166 | 167 | close: function(index){ 168 | var ibox = S('#'+classs[0]+index)[0]; 169 | if(!ibox) return; 170 | ibox.innerHTML = ''; 171 | doc.body.removeChild(ibox); 172 | clearTimeout(ready.timer[index]); 173 | delete ready.timer[index]; 174 | typeof ready.end[index] === 'function' && ready.end[index](); 175 | delete ready.end[index]; 176 | }, 177 | 178 | //关闭所有layer层 179 | closeAll: function(){ 180 | var boxs = doc[claname](classs[0]); 181 | for(var i = 0, len = boxs.length; i < len; i++){ 182 | layer.close((boxs[0].getAttribute('index')|0)); 183 | } 184 | } 185 | }; 186 | 187 | exports('layer-mobile', layer); 188 | 189 | }); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/mobile/layim-mobile-open.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:layim mobile 开源包 4 | @Author:贤心 5 | @License:MIT 6 | 7 | */ 8 | 9 | layui.define(function(exports){ 10 | exports('layim-mobile', layui.v); 11 | }); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/mobile/upload-mobile.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @Title: layui.upload 单文件上传 - 全浏览器兼容版 4 | @Author: 贤心 5 | @License:MIT 6 | 7 | */ 8 | 9 | layui.define(['layer-mobile', 'zepto'] , function(exports){ 10 | "use strict"; 11 | 12 | var $ = layui.zepto; 13 | var layer = layui['layer-mobile']; 14 | var device = layui.device(); 15 | 16 | var elemDragEnter = 'layui-upload-enter'; 17 | var elemIframe = 'layui-upload-iframe'; 18 | 19 | var msgConf = { 20 | icon: 2 21 | ,shift: 6 22 | }, fileType = { 23 | file: '文件' 24 | ,video: '视频' 25 | ,audio: '音频' 26 | }; 27 | 28 | layer.msg = function(content){ 29 | return layer.open({ 30 | content: content || '' 31 | ,skin: 'msg' 32 | ,time: 2 //2秒后自动关闭 33 | }); 34 | }; 35 | 36 | var Upload = function(options){ 37 | this.options = options; 38 | }; 39 | 40 | //初始化渲染 41 | Upload.prototype.init = function(){ 42 | var that = this, options = that.options; 43 | var body = $('body'), elem = $(options.elem || '.layui-upload-file'); 44 | var iframe = $(''); 45 | 46 | //插入iframe 47 | $('#'+elemIframe)[0] || body.append(iframe); 48 | 49 | return elem.each(function(index, item){ 50 | item = $(item); 51 | var form = '
'; 52 | 53 | var type = item.attr('lay-type') || options.type; //获取文件类型 54 | 55 | //包裹ui元素 56 | if(!options.unwrap){ 57 | form = '
' + form + ''+ ( 58 | item.attr('lay-title') || options.title|| ('上传'+ (fileType[type]||'图片') ) 59 | ) +'
'; 60 | } 61 | 62 | form = $(form); 63 | 64 | //拖拽支持 65 | if(!options.unwrap){ 66 | form.on('dragover', function(e){ 67 | e.preventDefault(); 68 | $(this).addClass(elemDragEnter); 69 | }).on('dragleave', function(){ 70 | $(this).removeClass(elemDragEnter); 71 | }).on('drop', function(){ 72 | $(this).removeClass(elemDragEnter); 73 | }); 74 | } 75 | 76 | //如果已经实例化,则移除包裹元素 77 | if(item.parent('form').attr('target') === elemIframe){ 78 | if(options.unwrap){ 79 | item.unwrap(); 80 | } else { 81 | item.parent().next().remove(); 82 | item.unwrap().unwrap(); 83 | } 84 | }; 85 | 86 | //包裹元素 87 | item.wrap(form); 88 | 89 | //触发上传 90 | item.off('change').on('change', function(){ 91 | that.action(this, type); 92 | }); 93 | }); 94 | }; 95 | 96 | //提交上传 97 | Upload.prototype.action = function(input, type){ 98 | var that = this, options = that.options, val = input.value; 99 | var item = $(input), ext = item.attr('lay-ext') || options.ext || ''; //获取支持上传的文件扩展名; 100 | 101 | if(!val){ 102 | return; 103 | }; 104 | 105 | //校验文件 106 | switch(type){ 107 | case 'file': //一般文件 108 | if(ext && !RegExp('\\w\\.('+ ext +')$', 'i').test(escape(val))){ 109 | layer.msg('不支持该文件格式', msgConf); 110 | return input.value = ''; 111 | } 112 | break; 113 | case 'video': //视频文件 114 | if(!RegExp('\\w\\.('+ (ext||'avi|mp4|wma|rmvb|rm|flash|3gp|flv') +')$', 'i').test(escape(val))){ 115 | layer.msg('不支持该视频格式', msgConf); 116 | return input.value = ''; 117 | } 118 | break; 119 | case 'audio': //音频文件 120 | if(!RegExp('\\w\\.('+ (ext||'mp3|wav|mid') +')$', 'i').test(escape(val))){ 121 | layer.msg('不支持该音频格式', msgConf); 122 | return input.value = ''; 123 | } 124 | break; 125 | default: //图片文件 126 | if(!RegExp('\\w\\.('+ (ext||'jpg|png|gif|bmp|jpeg') +')$', 'i').test(escape(val))){ 127 | layer.msg('不支持该图片格式', msgConf); 128 | return input.value = ''; 129 | } 130 | break; 131 | } 132 | 133 | options.before && options.before(input); 134 | item.parent().submit(); 135 | 136 | var iframe = $('#'+elemIframe), timer = setInterval(function() { 137 | var res; 138 | try { 139 | res = iframe.contents().find('body').text(); 140 | } catch(e) { 141 | layer.msg('上传接口存在跨域', msgConf); 142 | clearInterval(timer); 143 | } 144 | if(res){ 145 | clearInterval(timer); 146 | iframe.contents().find('body').html(''); 147 | try { 148 | res = JSON.parse(res); 149 | } catch(e){ 150 | res = {}; 151 | return layer.msg('请对上传接口返回JSON字符', msgConf); 152 | } 153 | typeof options.success === 'function' && options.success(res, input); 154 | } 155 | }, 30); 156 | 157 | input.value = ''; 158 | }; 159 | 160 | //暴露接口 161 | exports('upload-mobile', function(options){ 162 | var upload = new Upload(options = options || {}); 163 | upload.init(); 164 | }); 165 | }); 166 | 167 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
    '),s=o(["
  • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
  • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
    '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/upload.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
    '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
    ',"
    "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(f)||(e.elemFile.wrap(a),t.elem.next("."+f).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){r.append(e,i)}),i.ajax({url:l.url,type:l.method,data:r,contentType:!1,processData:!1,dataType:"json",success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['
      ',e.bar1?'
    • '+c[0]+"
    • ":"",e.bar2?'
    • '+c[1]+"
    • ":"",'
    • '+c[2]+"
    • ","
    "].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void(n.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(n.modules[f])!function g(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void("string"==typeof n.modules[f]&&n.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":n.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[f]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,t(o)},void(o.onerror=function(e){o.onerror=null,n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(n.href=e=e.replace(/^#\//,""),e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r 2 | 3 | 4 | 5 | 6 | 任务组列表 7 | 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 16 |
    17 |
    18 |
    19 | 20 | 21 | 30 | 31 |
    32 | 33 |
    34 |
    35 | 任务组名称 36 |
    37 | 38 |
    39 |
    40 |
    41 | 42 |
    43 | 44 |
    45 |
    46 |
    47 | 48 |
    49 | 50 |
    启动
    51 | 52 |
    禁止
    53 |
    54 |
    55 |
    56 |
    57 | 58 | 59 |
    60 |
    61 |
    62 |
    63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/resources/templates/quartz/quartzList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 任务列表 7 | 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 16 | 17 |
    18 |
    19 |
    20 | 21 | 22 | 32 | 33 |
    34 | 35 |
    36 |
    37 | 38 |
    39 | 40 |
    41 |
    42 |
    43 | 44 |
    45 | 46 |
    47 |
    48 |
    49 | 50 |
    51 | 52 |
    53 |
    54 |
    55 | 56 |
    57 | 58 |
    59 |
    60 |
    61 | 62 |
    63 | 64 |
    65 |
    66 |
    67 | 68 |
    69 | 70 |
    71 |
    72 |
    73 | 74 |
    75 | 76 |
    启动
    77 | 78 |
    禁止
    79 |
    80 |
    81 |
    82 |
    83 | 84 | 85 |
    86 |
    87 |
    88 |
    89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/test/java/com/baozi/ElasticsearchTest.java: -------------------------------------------------------------------------------- 1 | package com.baozi; 2 | 3 | import com.baozi.configurer.ElasticsearchConfig; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | import org.springframework.test.context.web.WebAppConfiguration; 9 | 10 | /** 11 | * Copyright: 张文君 12 | * 13 | * @author: zhangwenjun 14 | * @version: V1.0 15 | * @Date: 2019-05-14 13:20 16 | */ 17 | @RunWith(SpringRunner.class) 18 | @SpringBootTest 19 | @WebAppConfiguration 20 | public class ElasticsearchTest { 21 | 22 | @Test 23 | public void centralized(){ 24 | //System.out.println(ElasticsearchConfig.deleteIndex("goods_oupon")); 25 | //System.out.println(ElasticsearchConfig.createIndex("goods_oupon","goods_oupon")); 26 | //System.out.println(ElasticsearchConfig.batchImportData("goods_oupon")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/baozi/MpCodeGenerator.java: -------------------------------------------------------------------------------- 1 | package com.baozi; 2 | 3 | import com.baomidou.mybatisplus.generator.AutoGenerator; 4 | import com.baomidou.mybatisplus.generator.InjectionConfig; 5 | import com.baomidou.mybatisplus.generator.config.DataSourceConfig; 6 | import com.baomidou.mybatisplus.generator.config.GlobalConfig; 7 | import com.baomidou.mybatisplus.generator.config.PackageConfig; 8 | import com.baomidou.mybatisplus.generator.config.StrategyConfig; 9 | import com.baomidou.mybatisplus.generator.config.rules.DbType; 10 | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; 11 | import org.junit.Test; 12 | 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | /** 17 | * Copyright: 张文君 18 | * 代码生成器演示 19 | * @author: zhangwenjun 20 | * @version: V1.0 21 | * @Date: 2018-08-01 11:13 22 | */ 23 | public class MpCodeGenerator { 24 | 25 | @Test 26 | public void codeGenerator(){ 27 | AutoGenerator mpg = new AutoGenerator(); 28 | //1.全局配置 29 | GlobalConfig gc = new GlobalConfig(); 30 | gc.setOutputDir("C:\\Users\\Administrator\\Desktop"); 31 | gc.setFileOverride(true); 32 | gc.setActiveRecord(true); 33 | //XML二级缓存 34 | gc.setEnableCache(false); 35 | //XML ResultMap 36 | gc.setBaseResultMap(true); 37 | //XML columList 38 | gc.setBaseColumnList(true); 39 | gc.setAuthor("wenjunzhangp"); 40 | // 自定义文件命名,注意 %s 会自动填充表实体属性! 41 | // gc.setMapperName("%sDao"); 42 | // gc.setXmlName("%sDao"); 43 | // gc.setServiceName("MP%sService"); 44 | // gc.setServiceImplName("%sServiceDiy"); 45 | // gc.setControllerName("%sAction"); 46 | mpg.setGlobalConfig(gc); 47 | //2.数据源配置 48 | DataSourceConfig dsc = new DataSourceConfig(); 49 | dsc.setDbType(DbType.MYSQL); 50 | dsc.setDriverName("com.mysql.jdbc.Driver"); 51 | dsc.setUsername("root"); 52 | dsc.setPassword("Zz971886506"); 53 | dsc.setUrl("jdbc:mysql://123.56.219.123:3306/test?characterEncoding=utf8"); 54 | mpg.setDataSource(dsc); 55 | //3.策略配置 56 | StrategyConfig strategy = new StrategyConfig(); 57 | //此处可以修改为您的表前缀 58 | //strategy.setTablePrefix("beautiful_"); 59 | //表名生成策略 60 | strategy.setNaming(NamingStrategy.underline_to_camel); 61 | //需要生成的表 62 | //strategy.setInclude(new String[] { "admin_operator_log"}); 63 | //排除生成的表 64 | //strategy.setExclude(new String[]{"test"}); 65 | //字段名生成策略 66 | strategy.setFieldNaming(NamingStrategy.underline_to_camel); 67 | // 自定义实体父类 68 | // strategy.setSuperEntityClass("com.baomidou.demo.TestEntity"); 69 | // 自定义实体,公共字段 70 | // strategy.setSuperEntityColumns(new String[] { "test_id", "age" }); 71 | // 自定义 mapper 父类 72 | // strategy.setSuperMapperClass("com.baomidou.demo.TestMapper"); 73 | // 自定义 service 父类 74 | // strategy.setSuperServiceClass("com.baomidou.demo.TestService"); 75 | // 自定义 service 实现类父类 76 | // strategy.setSuperServiceImplClass("com.baomidou.demo.TestServiceImpl"); 77 | // 自定义 controller 父类 78 | // strategy.setSuperControllerClass("com.baomidou.demo.TestController"); 79 | // 【实体】是否生成字段常量(默认 false) 80 | // public static final String ID = "test_id"; 81 | // strategy.setEntityColumnConstant(true); 82 | // 【实体】是否为构建者模型(默认 false) 83 | // public User setName(String name) {this.name = name; return this;} 84 | // strategy.setEntityBuliderModel(true); 85 | mpg.setStrategy(strategy); 86 | //4.包配置 87 | PackageConfig pc = new PackageConfig(); 88 | pc.setParent("com"); 89 | pc.setModuleName("baozi"); 90 | pc.setXml("dao"); 91 | mpg.setPackageInfo(pc); 92 | // 注入自定义配置,可以在 VM 中使用 cfg.abc 设置的值 93 | InjectionConfig cfg = new InjectionConfig() { 94 | @Override 95 | public void initMap() { 96 | Map map = new HashMap(); 97 | map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp"); 98 | this.setMap(map); 99 | } 100 | }; 101 | mpg.setCfg(cfg); 102 | // 自定义模板配置,可以 copy 源码 mybatis-plus/src/main/resources/template 下面内容修改, 103 | // 放置自己项目的 src/main/resources/template 目录下, 默认名称一下可以不配置,也可以自定义模板名称 104 | // TemplateConfig tc = new TemplateConfig(); 105 | // tc.setController("..."); 106 | // tc.setEntity("..."); 107 | // tc.setMapper("..."); 108 | // tc.setXml("..."); 109 | // tc.setService("..."); 110 | // tc.setServiceImpl("..."); 111 | // mpg.setTemplate(tc); 112 | // 执行生成 113 | mpg.execute(); 114 | // 打印注入设置 115 | System.err.println(mpg.getCfg().getMap().get("abc")); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/test/java/com/baozi/RedisTest.java: -------------------------------------------------------------------------------- 1 | package com.baozi; 2 | 3 | import com.baozi.util.RedisUtil; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | import org.springframework.test.context.web.WebAppConfiguration; 9 | 10 | /** 11 | * Copyright: 张文君 12 | * 13 | * @author: zhangwenjun 14 | * @version: V1.0 15 | * @Date: 2018-08-08 12:57 16 | */ 17 | @RunWith(SpringRunner.class) 18 | @SpringBootTest 19 | @WebAppConfiguration 20 | public class RedisTest { 21 | 22 | @Test 23 | public void centralized(){ 24 | RedisUtil.setex("baozi","zhangwnejun",60); 25 | System.out.println(RedisUtil.getStr("baozi")); 26 | } 27 | } 28 | --------------------------------------------------------------------------------