mybatis plus like 模糊檢索時(shí)支持%_作為普通參數(shù)使用。

mybatis plus like 模糊檢索時(shí)支持%_作為普通參數(shù)使用。

[TOC]

總結(jié):

實(shí)現(xiàn)方式有多種:

1、通過mybatis plus 攔截器(com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor)實(shí)現(xiàn),只能不能處理第二步SQL執(zhí)行。
2、通過mybatis 原生攔截器(org.apache.ibatis.plugin.Interceptor)實(shí)現(xiàn),不能解決QueryWrapper的問題。
3、使用工具類SqlUtils.convertToSQLSafeValue 處理所有的like 傳參。缺點(diǎn)是侵入代碼。
4、spring 過濾器攔截特殊字符,通過自定義異常返回。此處不寫。

都可以實(shí)現(xiàn),根據(jù)各自的攔截器實(shí)現(xiàn)原理,在分頁處理上兩者會(huì)有明顯不同。

mybatis plus分頁處理,會(huì)執(zhí)行兩遍SQL查詢:第一次執(zhí)行SQL獲取總數(shù)量, 第二次執(zhí)行根據(jù)總數(shù)量進(jìn)行分頁查詢。在只有第一步總數(shù)量有效的情況下會(huì)執(zhí)行第二次查詢。攔截器只作用在第二步上,關(guān)鍵代碼如下:

com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor 代碼 :

// com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
// 所有攔截器
for (InnerInterceptor query : interceptors) {
    // 執(zhí)行查詢,確認(rèn)有無結(jié)果
    if (!query.willDoQuery(executor, ms, parameter, rowBounds, resultHandler, boundSql)) {
        // 無結(jié)果不再執(zhí)行query(mybatis plus 攔截器)
        return Collections.emptyList();
    }
    // 只有成功獲取數(shù)量后,才會(huì)調(diào)用mybatis plus 攔截器。
    query.beforeQuery(executor, ms, parameter, rowBounds, resultHandler, boundSql);
}
CacheKey cacheKey = executor.createCacheKey(ms, parameter, rowBounds, boundSql);
// 執(zhí)行SQL
return executor.query(ms, parameter, rowBounds, resultHandler, cacheKey, boundSql);

mybatis 同時(shí)可以作用在所有的SQL查詢上,也就是上面myabtis plus 的分頁兩步執(zhí)行,mybatis 攔截器都可以攔截。但是此種方式只能處理掉“?”占位符所使用的參數(shù),并不能處理 QueryWrapper.like()相關(guān)接口傳參,如果使用QueryWrapper傳參需要使用mybatis的sql 使用方式。

先放兩種實(shí)現(xiàn)方式的共用代碼:

1、Mybatis 工具類

package com.commons.mybatis.utils;

import com.commons.utils.SqlUtils;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Slf4j
@NoArgsConstructor
public class MyBatisUtil {

    /**
     * 檢查sql中,是否含有l(wèi)ike查詢
     */
    public static final Pattern LIKE_PARAM_PATTERN = Pattern.compile("like\\s(concat)?[\\w'\"\\(\\)\\%,\\s\\n\\t]*\\?", Pattern.CASE_INSENSITIVE);

    public static void escapeParameterIfContainingLike(BoundSql boundSql) {
        if (boundSql == null) {
            return;
        }
        String prepareSql = boundSql.getSql();
        List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();

        // 找到 like 后面的參數(shù)
        List<Integer> position = findLikeParam(prepareSql);
        if (position.isEmpty()) {
            return;
        }

        List<ParameterMapping> likeParameterMappings = new ArrayList<>(parameterMappings.size());

        // 復(fù)制
        MetaObject metaObject = SystemMetaObject.forObject(boundSql.getParameterObject());
        for (ParameterMapping m : parameterMappings) {
            if (!metaObject.hasGetter(m.getProperty())) {
                continue;
            }
            boundSql.setAdditionalParameter(m.getProperty(), metaObject.getValue(m.getProperty()));
        }

        for (int i = 0; i < position.size(); i++) {
            ParameterMapping parameterMapping = parameterMappings.get(position.get(i));
            likeParameterMappings.add(parameterMapping);
        }
        // 覆蓋 轉(zhuǎn)義字符
        delegateMetaParameterForEscape(boundSql, likeParameterMappings);
    }

    /**
     * @param boundSql 原 boundSql
     * @param likeParameterMappings 需要轉(zhuǎn)義的參數(shù)
     * @return 支持轉(zhuǎn)義的 boundSql
     */
    public static void delegateMetaParameterForEscape(
            BoundSql boundSql,
            List<ParameterMapping> likeParameterMappings) {

        log.debug("like String Escape parsing ...");

        MetaObject metaObject = SystemMetaObject.forObject(boundSql.getParameterObject());

        for (ParameterMapping mapping : likeParameterMappings) {

            String property = mapping.getProperty();

            if (!metaObject.hasGetter(property)) {
                continue;
            }

            Object value = metaObject.getValue(property);
            if (value instanceof String) {
                boundSql.setAdditionalParameter(property, convertToSQLSafeValue((String) value));
            }
        }
    }

    /**
     * 匹配like 位置, 如
     * like concat('%',?,'%')
     * like CONCAT('%',?,'%')
     * LIKE CONCAT('%', ?,'%')
     * lIKE conCAT('%', ?,'%')
     * like ?
     * @param prepareSql
     * @return
     */
    public static List<Integer> findLikeParam(String prepareSql) {

        if (StringUtils.isEmpty(prepareSql)) {
            return Collections.emptyList();
        }
        Matcher matcher = LIKE_PARAM_PATTERN.matcher(prepareSql);

        if (!matcher.find()) {
            return Collections.emptyList();
        }

        matcher.reset();
        int pos = 0;
        List<Integer> indexes = new ArrayList<>();
        while (matcher.find(pos)) {
            int start = matcher.start();
            int index = StringUtils.countMatches(prepareSql.substring(0, start), "?");
            indexes.add(index);
            pos = matcher.end();
        }
        return indexes;
    }


    /**
     * MySQL需要轉(zhuǎn)義的字段:\ % _
     */
    public static final Pattern PATTERN_MYSQL_ESCAPE_CHARS = Pattern.compile("(['_%\\\\]{1})");

    /**
     * 在SQL進(jìn)行l(wèi)ike時(shí)使用 ,mysql like時(shí),參數(shù)使用傳值 SqlUtils.convertToSQLSafeValue(String); 禁止與escape 同時(shí)使用。
     *
     * 轉(zhuǎn)義mysql的特殊字符 包括 '\', '%', '_', ''',
     * @param str
     * @return 返回可能為null eg:
     *  1'2_3%4\ 5 ?\ 轉(zhuǎn)義后  1\'2\_3\%4\\\\ 5 ?\\\\
     *  null >> null
     *  """ >> ""
     *  "%" >> "\%"
     *  "\" >> "\\\\\"
     *  "_" >> "\_"
     *  "_%" >> "\_\%"
     */
    public static String convertToSQLSafeValue(String str) {
        return SqlUtils.convertToSQLSafeValue(str);
    }
}

2、SqlUtils 工具類

package com.commons.utils.SqlUtils

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * SQL相關(guān)工具類
 * @creator DZ
 * @create 2021-08-25 17:25:52
 */
public class SqlUtils {

    private SqlUtils() {
    }

    private static final Logger logger = LoggerFactory.getLogger(SqlUtils.class);

    /**
     * MySQL需要轉(zhuǎn)義的字段:\ % _
     */
    public static final Pattern PATTERN_MYSQL_ESCAPE_CHARS = Pattern.compile("(['_%\\\\]{1})");

    /**
     * 在SQL進(jìn)行l(wèi)ike時(shí)使用 ,mysql like時(shí),參數(shù)使用傳值 SqlUtils.convertToSQLSafeValue(String); 禁止與escape 同時(shí)使用。
     *
     * 轉(zhuǎn)義mysql的特殊字符 包括 '\', '%', '_', ''',
     * @param str
     * @return 返回可能為null eg:
     *  1'2_3%4\ 5 ?\ 轉(zhuǎn)義后  1\'2\_3\%4\\\\ 5 ?\\\\
     *  null >> null
     *  """ >> ""
     *  "%" >> "\%"
     *  "\" >> "\\\\\"
     *  "_" >> "\_"
     *  "_%" >> "\_\%"
     */
    public static String convertToSQLSafeValue(String str) {
        if (str == null) {
            return null;
        }
        Matcher matcher = PATTERN_MYSQL_ESCAPE_CHARS.matcher(str);
        int charSplitStart = 0;
        if (!matcher.find()) {
            return str;
        }
        StringBuilder sb = new StringBuilder();
        matcher.reset();
        while (matcher.find()) {
            String ch = str.substring(matcher.start(), matcher.end());
            sb.append(str, charSplitStart, matcher.start())
                    .append('\\').append("\\".equals(ch) ? "\\\\\\" : ch);
            charSplitStart = matcher.end();
        }
        if (sb.length() == 0) return str;
        String result = sb.toString();
        logger.debug("對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:{} => {} ", str, result);
        return result;
    }

}

mybatis plus 攔截器實(shí)現(xiàn)方式

1、添加like 轉(zhuǎn)義攔截器

// mybatis plus config 
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 添加like 轉(zhuǎn)義攔截器
interceptor.addInnerInterceptor(new LikeStringEscapeInterceptor()); 

2、mybatis plus 轉(zhuǎn)義攔截器 : LikeStringEscapeInterceptor.java

需要實(shí)現(xiàn)com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor 接口

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import com.commons.mybatis.utils.MyBatisUtil;
import lombok.NoArgsConstructor;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.mapping.StatementType;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;

/**
 * Like 轉(zhuǎn)義 插件:<br/>
 * 在mybatis plus 配置此插件使用;mybatis plus 插件使用機(jī)制,優(yōu)先使用原始參數(shù)進(jìn)行條件查詢。<br/>
 * 1、如果 count 記錄為0 時(shí),name將不再執(zhí)行任何before query 調(diào)用; <br/>
 * 2、如果 count 結(jié)果非0 時(shí),執(zhí)行插件業(yè)務(wù)邏輯。 <br/>
 *
 * @create dz
 * @date 2021-08-26 16:34:59
 * @see MybatisPlusInterceptor#intercept(org.apache.ibatis.plugin.Invocation)
 * for (InnerInterceptor query : interceptors) {
 * if (!query.willDoQuery(executor, ms, parameter, rowBounds, resultHandler, boundSql)) {
 * return Collections.emptyList();
 * }
 * query.beforeQuery(executor, ms, parameter, rowBounds, resultHandler, boundSql);
 * }
 * <p>
 * 使用方法:
 * <ol>
 * <li> 添加插件 到mybatis plus </li>
 * </ol>
 * </p>
 */
@NoArgsConstructor
public class LikeStringEscapeInterceptor implements InnerInterceptor {
    private static final Logger logger = LoggerFactory.getLogger(LikeStringEscapeInterceptor.class);

    @Override
    public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
        // 到此,說明mybatis plus 預(yù)執(zhí)行有結(jié)果。
        logger.debug("LikeStringEscapeInterceptor beforeQuery");
        SqlCommandType sqlCommandType = ms.getSqlCommandType();
        StatementType statementType = ms.getStatementType();
        // 只處理 有參數(shù)的查詢語句
        if (sqlCommandType == SqlCommandType.SELECT && statementType == StatementType.PREPARED) {
            MyBatisUtil.escapeParameterIfContainingLike(boundSql);
        }
    }
}


3、結(jié)果

3.1. 數(shù)據(jù)庫(kù)中有【默認(rèn)】開始的數(shù)據(jù)。設(shè)定參數(shù)【默認(rèn)%】分頁兩步驟SQL,只有第二步執(zhí)行了轉(zhuǎn)義。

stPage_mpCount : ==>  Preparing: SELECT COUNT(1) FROM (SELECT r
stPage_mpCount : ==> Parameters: 默認(rèn)%(String)
stPage_mpCount : <==      Total: 1
peInterceptor  : LikeStringEscapeInterceptor beforeQuery
peInterceptor  : like String Escape parsing ...
ils.SqlUtils   : 對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:默認(rèn)% => 默認(rèn)\% 
peInterceptor  : boundSql AdditionalParameter property: param.n
ListPage       : ==>  Preparing: SELECT role.id, role.name, rol
ListPage       : ==> Parameters: 默認(rèn)\%(String), 10(Long)

3.2. 數(shù)據(jù)庫(kù)無【九月天】開頭的數(shù)據(jù),不再執(zhí)行插件邏輯。設(shè)定參數(shù)【九月天】,只有第一步計(jì)數(shù)SQL ,無轉(zhuǎn)義后SQL

Param_mpCount    : ==>  Preparing: SELECT COUNT(1) FROM 
Param_mpCount    : ==> Parameters: 九月天%(String)
Param_mpCount    : <==      Total: 1 

mybatis 原生攔截器實(shí)現(xiàn)

1、LikeStringEscapeInterceptorForMybatis.java

實(shí)現(xiàn)com.commons.mybatis.interceptor.LikeStringEscapeInterceptorForMybatis代碼

package com.commons.mybatis.interceptor;

import com.commons.mybatis.utils.MyBatisUtil;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.mapping.StatementType;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Like 轉(zhuǎn)義
 * <p>
 * 使用方法:
 * <ol>
 * <li> 添加插件 </li>
 * </ol>
 * </p>
 */
@Component
@Intercepts(
        {
                @Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
                        Object.class, RowBounds.class, ResultHandler.class}),
                @Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
                        Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}),
        }
)
public class LikeStringEscapeInterceptorForMybatis implements Interceptor {

    private static final Logger logger = LoggerFactory.getLogger(LikeStringEscapeInterceptorForMybatis.class);

    @Override
    public Object plugin(Object target) {
        return Plugin.wrap(target, this);
    }

    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        Object[] args = invocation.getArgs();
        MappedStatement ms = (MappedStatement) args[0];
        Object parameter = args[1];
        RowBounds rowBounds = (RowBounds) args[2];
        ResultHandler resultHandler = (ResultHandler) args[3];
        Executor executor = (Executor) invocation.getTarget();
        CacheKey cacheKey;
        BoundSql boundSql;
        //由于邏輯關(guān)系,只會(huì)進(jìn)入一次
        if (args.length == 4) {
            //4 個(gè)參數(shù)時(shí)
            boundSql = ms.getBoundSql(parameter);
            cacheKey = executor.createCacheKey(ms, parameter, rowBounds, boundSql);
        } else {
            //6 個(gè)參數(shù)時(shí)
            cacheKey = (CacheKey) args[4];
            boundSql = (BoundSql) args[5];
        }

        SqlCommandType sqlCommandType = ms.getSqlCommandType();
        StatementType statementType = ms.getStatementType();
        // 只處理 有參數(shù)的查詢語句
        if (sqlCommandType == SqlCommandType.SELECT
                && statementType == StatementType.PREPARED) {
            MyBatisUtil.escapeParameterIfContainingLike(boundSql);
            return executor.query(ms, parameter, rowBounds, resultHandler, cacheKey, boundSql);
        }
        return invocation.proceed();
    }

}

2、結(jié)果:

2.1. 查詢條件:【九月天%】,數(shù)據(jù)無【九月天】開始的數(shù)據(jù)。mybatis plus 只查詢了一次,執(zhí)行了轉(zhuǎn)義。OK

MyBatisUtil  : like String Escape parsing ...
s.SqlUtils   : 對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:九月天% => 九月天\% 
Dept_mpCount : ==>  Preparing: SELECT COUNT(1) FROM (SELECT DIST
Dept_mpCount : ==> Parameters: 001002031(String), 九月天\%(String)
Dept_mpCount : <==      Total: 1

2.2. 查詢條件:【g%h】 ,數(shù)據(jù)中有含有“g%h”的文本數(shù)據(jù)。mybatisplus執(zhí)行了分頁處理:兩步都執(zhí)行了轉(zhuǎn)義操作。OK

ils.MyBatisUtil  : like String Escape parsing ...
utils.SqlUtils   : 對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:g%h => g\% 
geInDept_mpCount : ==>  Preparing: SELECT COUNT(1) FROM (SELECT D
geInDept_mpCount : ==> Parameters: 001002031(String), g\%(String)
geInDept_mpCount : <==      Total: 1
ils.MyBatisUtil  : like String Escape parsing ...
utils.SqlUtils   : 對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:g%h => g\% 
ageInDept        : ==>  Preparing: select u.id, u.username, u.rea
ageInDept        : ==> Parameters: 001002031(String), g\%(String)
ageInDept        : <==      Total: 1

2.3 使用注意

qw.like(SysUserEntity::getUsername, "%"); 

// 日志如下傳入
// .SqlUtils : 對(duì)SQL參數(shù)進(jìn)行轉(zhuǎn)義:%%% => %%%
// lectList : ==> Preparing: SELECT id,username
// lectList : ==> Parameters: %%%(String)

queryWrapper.apply("`" + column_name + "` LIKE concat('%',{0})", value);

此方式OK

參考:
Mybatis 攔截器實(shí)現(xiàn) Like 通配符轉(zhuǎn)義

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,316評(píng)論 6 531
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 98,481評(píng)論 3 415
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 176,241評(píng)論 0 374
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我,道長(zhǎng),這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 62,939評(píng)論 1 309
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 71,697評(píng)論 6 409
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 55,182評(píng)論 1 324
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,247評(píng)論 3 441
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 42,406評(píng)論 0 288
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 48,933評(píng)論 1 334
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 40,772評(píng)論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 42,973評(píng)論 1 369
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,516評(píng)論 5 359
  • 正文 年R本政府宣布,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 44,209評(píng)論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,638評(píng)論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,866評(píng)論 1 285
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 51,644評(píng)論 3 391
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 47,953評(píng)論 2 373

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