1 Star 0 Fork 1

zgdkik / framework

forked from 前山顶 / framework 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

基础框架


##目录

framework-mybatis

framework-mybatis主要实现打印sql语句(包含参数值)和sql执行阀值超过多少后打印错误日志。在项目中使用分两步
第一、引入依赖

        <dependency>
            <groupId>com.qianshanding.framework</groupId>
            <artifactId>framework-mybatis</artifactId>
            <version>1.0.0</version>
        </dependency>

第二、在mybaits加入plugin

    <plugins>
        <plugin interceptor="com.qianshanding.framework.mybatis.monitor.SqlMonitorPlugin">
            <!--是否监控-->
            <property name="sql_monitor" value="true"/>
            <!--是否打印SQL语句,默认为false -->
            <property name="sql_show" value="true"/>
            <!--sql时延的阈值,超过会打印error日志数据   -->
            <property name="overtime_print_error" value="300"/>
        </plugin>
    </plugins>

framework-redis

framework-redis组件是Redis的客户端,在项目中使用分三步
第一、引入依赖

        <dependency>
            <groupId>com.qianshanding.framework</groupId>
            <artifactId>framework-redis</artifactId>
            <version>1.0.0</version>
        </dependency>

第二、spring初始化framework-redis

    <bean id="propertyPlaceholderConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreResourceNotFound" value="true"/>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
        <property name="locations">
            <list>
                <value>classpath*:cache.properties</value>
            </list>
        </property>
    </bean>

    <import resource="classpath*:framework-redis.xml"/>

cached.properties:

    #redis
    jedis.ip=127.0.0.1
    jedis.port=6379
    jedis.pool.maxActive=60
    jedis.pool.maxIdle=10
    jedis.pool.maxWait=10000
    jedis.pool.testOnBorrow=false

第三、项目当中使用

    @Resource
    RedisClient redisClient;

    public void testGet() {
        redisClient.set("fish", "value");
        System.out.println(redisClient.get("fish"));
        redisClient.del("fish");
    }

framework-third

framework-third是一些第三方扩展。
第一、引入依赖

        <dependency>
            <groupId>com.qianshanding.framework</groupId>
            <artifactId>framework-third</artifactId>
            <version>1.0.0</version>
        </dependency>

第二、在mybaits加入plugin

    <bean id="configPropertyPlaceholderConfigurer"
          class="com.qianshanding.framework.spring.ConfigPropertyPlaceholderConfigurer">
        <property name="ignoreResourceNotFound" value="true"/>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
        <property name="locations">
            <list>
                <value>classpath*:cache.properties</value>
            </list>
        </property>
    </bean>

功能:可以通过System.getProperty(key)获取cache.properties中的配置信息。

The MIT License (MIT) Copyright (c) 2017 前山顶 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基础架构组件。包含framework-mybatis、framework-redis、framework-commons、framework-utils等等公共组件。 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/zgdkik/framework.git
git@gitee.com:zgdkik/framework.git
zgdkik
framework
framework
master

搜索帮助