我的Spring多數(shù)據(jù)源

Spring 多數(shù)據(jù)源已經(jīng)不是什么稀奇的事了雀摘,在實(shí)際應(yīng)用中主從數(shù)據(jù)庫(kù)就需要用到多數(shù)據(jù)源的配置與動(dòng)態(tài)切換实愚。在搜索引擎中都可以找到很多資料纬傲,各也有各的做法襟衰,本文也就不做過(guò)多的闡述其原理贴铜,只是介紹下目前我在項(xiàng)目中對(duì)于多數(shù)據(jù)源的使用情況,歡迎大家前來(lái)拍磚瀑晒。

先特別感謝好友 Tony

首先绍坝,繼承spring-jdbc 的 AbstractRoutingDataSource

public class DynamicDataSource extends AbstractRoutingDataSource {    
    protected Object determineCurrentLookupKey() {        
        return DataSourceHolder.getDataSources();    
    }
}

創(chuàng)建自己的DataSourceHolder

public class DataSourceHolder {    
    
    private static ThreadLocal<String> dataSources = new ThreadLocal<String>();    

    public static String getDataSources() {        
        String source = dataSources.get();        
        if (source == null) source = DataSourceType.MASTER;        
        return source;    
    }    
    public static void setDataSources(String source) {       
        dataSources.set(source);    
    }
}

當(dāng)然還有DataSourceType

public class DataSourceType {    
    public static final String MASTER = "master";    
    public static final String SLAVE = "slaver";
}

到此為止,和所有搜索引擎中找到的資料一致苔悦,除了命名可能有些區(qū)別 _
那么接下來(lái)介紹一下不同的地方轩褐,網(wǎng)上也有很多資料是通過(guò)AOP來(lái)實(shí)現(xiàn)動(dòng)態(tài)切換,比如:Spring 配置多數(shù)據(jù)源實(shí)現(xiàn)數(shù)據(jù)庫(kù)讀寫(xiě)分離 這篇文章中的介紹玖详,就很完美的使用AOP實(shí)現(xiàn)了主從數(shù)據(jù)庫(kù)的切換把介,而我的做法有一些大同小異,我使用了Java動(dòng)態(tài)代理蟋座,先上代碼拗踢。

先創(chuàng)建自己的Annotation:

從庫(kù)注解

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Read {}

主庫(kù)注解

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Write {}

為了以防萬(wàn)一,增加了OtherSource
而這個(gè)也只是為了防止在一個(gè)項(xiàng)目中有多個(gè)數(shù)據(jù)庫(kù)的連接需求向臀,比如:將用戶(hù)信息獨(dú)立成庫(kù)巢墅,商品信息獨(dú)立成庫(kù)等

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface OtherSource {    
    String value();
}

以下則為真正重點(diǎn)——?jiǎng)討B(tài)代理
繼承MapperFactoryBean,實(shí)現(xiàn)InvocationHandler飒硅,在invoke之前砂缩,根據(jù)注解來(lái)實(shí)現(xiàn)動(dòng)態(tài)數(shù)據(jù)源的切換

public class MapperFactoryBeanInvocation<T> extends MapperFactoryBean<T> implements InvocationHandler {    
    private T t;    
    public MapperFactoryBeanInvocation() {    }    
    public T getObject() throws Exception {        
        T t = super.getObject();        
        return this.getProxyObject(t);    
    }    
    private T getProxyObject(T t) {        
        this.t = t;        
        return (T) Proxy.newProxyInstance(t.getClass().getClassLoader(), t.getClass().getInterfaces(), this);    
    }    
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {        
        boolean isRead = true;        
        StringBuffer typeBuffer = new StringBuffer("");
        //獲取是否有其他數(shù)據(jù)源
        OtherSource ortherSourceAnn = method.getAnnotation(OtherSource.class);        
        if (ortherSourceAnn != null) {            
            typeBuffer.append(ortherSourceAnn.value()).append("_");        
        }   
        //獲取主從狀態(tài)    
        Annotation ann_method = method.getAnnotation(Read.class);        
        if (ann_method == null) isRead = false;  
        if (isRead) typeBuffer.append(DataSourceType.SLAVE);        
        else typeBuffer.append(DataSourceType.MASTER);   
        //切換數(shù)據(jù)源    
        DataSourceHolder.setDataSources(typeBuffer.toString());        
        return method.invoke(this.t, args);    
    }
}

至此,Spring多數(shù)據(jù)源主從動(dòng)態(tài)切換已經(jīng)實(shí)現(xiàn)三娩。
在實(shí)際使用過(guò)程中庵芭,對(duì)應(yīng)的管理好多數(shù)據(jù)源配置,即可實(shí)現(xiàn)動(dòng)態(tài)切換的目的

db.properties 配置

#jdbc driver
jdbc.driverClassName=com.mysql.jdbc.Driver
#master
design.master.jdbc.url=jdbc:mysql://192.168.1.101:3306/design_shop?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true
design.master.jdbc.username=root
design.master.jdbc.password=111111
#slaver
design.slaver.jdbc.url=jdbc:mysql://192.168.1.102:3306/design_shop?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true
design.slaver.jdbc.username=root
design.slaver.jdbc.password=111111
#master
shop.master.jdbc.url=jdbc:mysql://192.168.1.103:3306/shop_mall?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true
shop.master.jdbc.username=root
shop.master.jdbc.password=a12345678
#slaver
shop.slaver.jdbc.url=jdbc:mysql://192.168.1.104:3306/shop_mall?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true
shop.slaver.jdbc.username=root
shop.slaver.jdbc.password=a12345678
#c3p0 config
c3p0.initialPoolSize=8
c3p0.minPoolSize=5
c3p0.maxPoolSize=10
c3p0.acquireIncrement=10
c3p0.maxIdleTime=60
c3p0.idleConnectionTestPeriod=120
c3p0.maxStatements=100
c3p0.autoCommitOnClose=false
c3p0.testConnectionOnCheckout=false
c3p0.testConnectionOnCheckin=false
c3p0.preferredTestQuery=select now()

spring 配置

...
<bean id="parentDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">    
    <property name="driverClass" value="${jdbc.driverClassName}"/>    
    <property name="initialPoolSize" value="${c3p0.initialPoolSize}"/>    
    <property name="minPoolSize" value="${c3p0.minPoolSize}"/>    
    <property name="maxPoolSize" value="${c3p0.maxPoolSize}"/>    
    <property name="acquireIncrement" value="${c3p0.acquireIncrement}"/>    
    <property name="maxIdleTime" value="${c3p0.maxIdleTime}"/>    
    <property name="idleConnectionTestPeriod" value="${c3p0.idleConnectionTestPeriod}"/>    
    <property name="maxStatements" value="${c3p0.maxStatements}"/>    
    <property name="autoCommitOnClose" value="${c3p0.autoCommitOnClose}"/>   
    <property name="testConnectionOnCheckout" value="${c3p0.testConnectionOnCheckout}"/>    
    <property name="testConnectionOnCheckin" value="${c3p0.testConnectionOnCheckin}"/>    
    <property name="preferredTestQuery" value="${c3p0.preferredTestQuery}"/>
</bean>
<import resource="dataSource.xml"/>
<import resource="data_mapping.xml"/>
...

dataSource.xml 配置

...
<!-- 配置主庫(kù)數(shù)據(jù)源 -->    
<bean id="designMasterDataSource" parent="parentDataSource">        
    <property name="jdbcUrl" value="${design.master.jdbc.url}"/>        
    <property name="user" value="${design.master.jdbc.username}"/>        
    <property name="password" value="${design.master.jdbc.password}"/>    
</bean>    
<!-- 配置從庫(kù)數(shù)據(jù)源 -->    
<bean id="designSlaverDataSource" parent="parentDataSource">        
    <property name="jdbcUrl" value="${design.slaver.jdbc.url}"/>        
    <property name="user" value="${design.slaver.jdbc.username}"/>        
    <property name="password" value="${design.slaver.jdbc.password}"/>    
</bean>    
<!-- 配置主庫(kù)數(shù)據(jù)源 -->    
<bean id="shopMasterDataSource" parent="parentDataSource">        
    <property name="jdbcUrl" value="${shop.master.jdbc.url}"/>        
    <property name="user" value="${shop.master.jdbc.username}"/>        
    <property name="password" value="${shop.master.jdbc.password}"/>    
</bean>    
<!-- 配置從庫(kù)數(shù)據(jù)源 -->    
<bean id="shopSlaverDataSource" parent="parentDataSource">        
    <property name="jdbcUrl" value="${shop.slaver.jdbc.url}"/>        
    <property name="user" value="${shop.slaver.jdbc.username}"/>        
    <property name="password" value="${shop.slaver.jdbc.password}"/>    
</bean>    
<!-- 配置動(dòng)態(tài)數(shù)據(jù)源 -->    
<bean id="designDataSource" class="com.design.datasource.DynamicDataSource">        
    <property name="targetDataSources">            
    <map key-type="java.lang.String">                
        <entry key="slaver" value-ref="designSlaverDataSource"/>                
        <entry key="master" value-ref="designMasterDataSource"/>                
        <entry key="shop_slaver" value-ref="shopSlaverDataSource"/>                
        <entry key="shop_master" value-ref="shopMasterDataSource"/>            
    </map>        
    </property>        
    <!-- 默認(rèn)叢庫(kù) -->        
    <property name="defaultTargetDataSource" ref="designSlaverDataSource"/>    
</bean>    
<!-- session factory -->    
<bean id="designSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">        
    <property name="dataSource" ref="designDataSource"/>        
    <property name="configLocation" value="classpath:mybatis-config.xml"/>    
</bean>
...

data_mapping.xml 配置
需要注意的是雀监,此處class指向的是自己創(chuàng)建的MapperFactoryBeanInvocation動(dòng)態(tài)代理

<bean id="accountLogMapper" class="com.design.datasource.factory.MapperFactoryBeanInvocation">
    <property name="mapperInterface" value="com.design.shop.dao.AccountLogMapper"/>    
    <property name="sqlSessionFactory" ref="designSessionFactory"/>
</bean>
<bean id="imageMapper" class="com.design.datasource.factory.MapperFactoryBeanInvocation">    
    <property name="mapperInterface" value="com.design.shop.dao.MallWechatImageTextTempMapper"/>       
    <property name="sqlSessionFactory" ref="designSessionFactory"/>
</bean>

Mybatis Mapper

public interface AccountLogMapper {
...
   @SelectProvider(type=AccountLogSqlProvider.class, method="selectByExample")
   @Results({    
       @Result(column="log_id", property="logId", jdbcType=JdbcType.INTEGER, id=true), 
       @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
       @Result(column="user_money", property="userMoney", jdbcType=JdbcType.DECIMAL),
       @Result(column="frozen_money", property="frozenMoney", jdbcType=JdbcType.DECIMAL), 
       @Result(column="rank_points", property="rankPoints", jdbcType=JdbcType.INTEGER), 
       @Result(column="pay_points", property="payPoints", jdbcType=JdbcType.INTEGER), 
       @Result(column="change_time", property="changeTime", jdbcType=JdbcType.INTEGER), 
       @Result(column="change_desc", property="changeDesc", jdbcType=JdbcType.VARCHAR), 
       @Result(column="change_type", property="changeType", jdbcType=JdbcType.TINYINT)
  })
   //因?yàn)槟J(rèn)為一庫(kù)主從双吆,因此這個(gè)Mapper沒(méi)有使用@OtherSource注解眨唬,而@Read則指向從庫(kù),對(duì)應(yīng)dataSource.xml 中的 salver
   @Read
   List<AccountLog> selectByExample(AccountLogExample example);
...
}
public interface MallWechatImageTextTempMapper {
...
    @SelectProvider(type=MallWechatImageTextTempSqlProvider.class, method="countByExample")
    //此處@OtherSource("shop")指向了shop_mall數(shù)據(jù)庫(kù)  @Read 指向從庫(kù)  所以對(duì)應(yīng) dataSource.xml 中的 shop_slaver
    @Read
    @OtherSource("shop")
    long countByExample(MallWechatImageTextTempExample example);
...
}

Spring Test
測(cè)試代碼使用kotlin編寫(xiě)好乐,基本和Java區(qū)別不是很大匾竿,函數(shù)式寫(xiě)起來(lái)更方便 _

@RunWith(SpringJUnit4ClassRunner::class)
@ContextConfiguration("classpath:appServer.xml")
class Test {    

    @Autowired    
    var mapper: AccountLogMapper? = null    
    @Autowired    
    var imageMapper: MallWechatImageTextTempMapper? = null  
  
    @Test    
    fun test() {        
        println("*********************************** test shop_mall mall_wechat_image_temp countByExample ***********************************************")        
        val count = imageMapper?.countByExample(MallWechatImageTextTempExample().apply {
            createCriteria().andTempSetCodeEqualTo("wechat_temp_1")            
            resultColumn = "tempid"            
            offset = 0            
            limit = 100}) ?: 0L        
        println(count)        
        assert(true)    
    }
   
    @Test    
    fun testMyselfDB() {        
        println("*********************************** test myself  design_shop account_log countByExample ***********************************************")        
        val list = mapper?.selectByExample(AccountLogExample()) ?: arrayListOf<AccountLog>()        
        if (list.size > 0) {            
            assert(true)        
        } else {            
            assert(false)        
        }    
    }
}

好了,所有和動(dòng)態(tài)數(shù)據(jù)源相關(guān)的代碼與示例已經(jīng)完成了蔚万,我們現(xiàn)在來(lái)看下實(shí)際運(yùn)行效果:

*********************************** test shop_mall  mall_wechat_image_temp countByExample ***********************************************
02:31:56 [main] INFO  com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 10, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge1619lmh41qu1kjm50|366ac49b, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge1619lmh41qu1kjm50|366ac49b, idleConnectionTestPeriod -> 120, initialPoolSize -> 8, jdbcUrl -> jdbc:mysql://139.224.40.142:3306/mall?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 100, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> select now(), privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
02:31:56 [main] DEBUG com.design.shop.dao.MallWechatImageTextTempMapper.countByExample - ==>  Preparing: SELECT count(tempid) FROM comp_mall_wechat_imagetext_temp WHERE ((temp_set_code = ?)) LIMIT 0,100 
02:31:56 [main] DEBUG com.design.shop.dao.MallWechatImageTextTempMapper.countByExample - ==> Parameters: wechat_temp_1(String)
02:31:56 [main] DEBUG com.design.shop.dao.MallWechatImageTextTempMapper.countByExample - <==      Total: 1
4
*********************************** test myself  design_shop account_log countByExample ***********************************************
02:31:56 [main] INFO  com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 10, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge1619lmh41qu1kjm50|5f0e9815, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge1619lmh41qu1kjm50|5f0e9815, idleConnectionTestPeriod -> 120, initialPoolSize -> 8, jdbcUrl -> jdbc:mysql://127.0.0.1:3306/design_shop?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useSSL=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 100, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> select now(), privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
02:31:56 [main] DEBUG com.design.shop.dao.AccountLogMapper.selectByExample - ==>  Preparing: SELECT log_id, user_id, user_money, frozen_money, rank_points, pay_points, change_time, change_desc, change_type FROM des_account_log 
02:31:56 [main] DEBUG com.design.shop.dao.AccountLogMapper.selectByExample - ==> Parameters: 
02:31:56 [main] DEBUG com.design.shop.dao.AccountLogMapper.selectByExample - <==      Total: 35

2個(gè)不同的從庫(kù)實(shí)現(xiàn)了動(dòng)態(tài)切換岭妖,是不是有點(diǎn)暗爽?當(dāng)然 Mybatis Mapper 是由 MybatisGenerator生成的反璃,原版生成可不會(huì)帶@Read @Write @OtherSource 等注解 也沒(méi)有 offset昵慌、limit 分頁(yè)屬性,以上內(nèi)容可以通過(guò)對(duì)MybatisGenerator做一些小改造淮蜈,提供插件即可全部實(shí)現(xiàn)斋攀。在后續(xù)文章中會(huì)提及MybatisGenerator的插件制作,盡請(qǐng)期待 _

第一次發(fā)文梧田,文筆還有沒(méi)有介紹清楚的地方淳蔼,還請(qǐng)海涵。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末裁眯,一起剝皮案震驚了整個(gè)濱河市鹉梨,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌未状,老刑警劉巖俯画,帶你破解...
    沈念sama閱讀 221,331評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異司草,居然都是意外死亡艰垂,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,372評(píng)論 3 398
  • 文/潘曉璐 我一進(jìn)店門(mén)埋虹,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)猜憎,“玉大人壕吹,你說(shuō)我怎么就攤上這事本缠。” “怎么了肮疗?”我有些...
    開(kāi)封第一講書(shū)人閱讀 167,755評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵爬泥,是天一觀的道長(zhǎng)柬讨。 經(jīng)常有香客問(wèn)我,道長(zhǎng)袍啡,這世上最難降的妖魔是什么踩官? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 59,528評(píng)論 1 296
  • 正文 為了忘掉前任,我火速辦了婚禮境输,結(jié)果婚禮上蔗牡,老公的妹妹穿的比我還像新娘颖系。我一直安慰自己,他們只是感情好辩越,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,526評(píng)論 6 397
  • 文/花漫 我一把揭開(kāi)白布嘁扼。 她就那樣靜靜地躺著,像睡著了一般黔攒。 火紅的嫁衣襯著肌膚如雪趁啸。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 52,166評(píng)論 1 308
  • 那天亏钩,我揣著相機(jī)與錄音莲绰,去河邊找鬼。 笑死姑丑,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的辞友。 我是一名探鬼主播栅哀,決...
    沈念sama閱讀 40,768評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼称龙!你這毒婦竟也來(lái)了留拾?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 39,664評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤鲫尊,失蹤者是張志新(化名)和其女友劉穎痴柔,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體疫向,經(jīng)...
    沈念sama閱讀 46,205評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡咳蔚,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,290評(píng)論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了搔驼。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片谈火。...
    茶點(diǎn)故事閱讀 40,435評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖舌涨,靈堂內(nèi)的尸體忽然破棺而出糯耍,到底是詐尸還是另有隱情,我是刑警寧澤囊嘉,帶...
    沈念sama閱讀 36,126評(píng)論 5 349
  • 正文 年R本政府宣布温技,位于F島的核電站,受9級(jí)特大地震影響扭粱,放射性物質(zhì)發(fā)生泄漏舵鳞。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,804評(píng)論 3 333
  • 文/蒙蒙 一焊刹、第九天 我趴在偏房一處隱蔽的房頂上張望系任。 院中可真熱鬧恳蹲,春花似錦、人聲如沸俩滥。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,276評(píng)論 0 23
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)霜旧。三九已至错忱,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間挂据,已是汗流浹背以清。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,393評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留崎逃,地道東北人掷倔。 一個(gè)月前我還...
    沈念sama閱讀 48,818評(píng)論 3 376
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像个绍,于是被迫代替她去往敵國(guó)和親勒葱。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,442評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理巴柿,服務(wù)發(fā)現(xiàn)凛虽,斷路器,智...
    卡卡羅2017閱讀 134,695評(píng)論 18 139
  • Spring Boot 參考指南 介紹 轉(zhuǎn)載自:https://www.gitbook.com/book/qbgb...
    毛宇鵬閱讀 46,844評(píng)論 6 342
  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,271評(píng)論 25 707
  • 1. 輪播的實(shí)現(xiàn)原理是怎樣的广恢?如果讓你來(lái)實(shí)現(xiàn)凯旋,你會(huì)抽象出哪些函數(shù)(or接口)供使用?(比如 play()) CSS...
    謹(jǐn)言_慎行閱讀 211評(píng)論 1 0
  • 六月的最后一天,我終于承受不住長(zhǎng)久以來(lái)的指責(zé)和非議篷牌,在房間里大聲哭了出來(lái)…壓抑了很久痛到不行的心情以及夜里輾轉(zhuǎn)難眠...
    雞蛋說(shuō)閱讀 341評(píng)論 0 0