MapStructs

MapStruct
使用MapStruct
1.MapStruct是用来做什么的?
2.使用MapStruct解决上述问题
3.添加默认方法

  1. 可以使用abstract class来代替接口
    5.可以使用多个参数
    5.直接使用参数作为属性值
    6.更新对象属性
    7.没有getter/setter也能赋值
    8.使用Spring依赖注入
    9.自定义类型转换
    使用MapStruct
    首先来了解一下DTO,DTO简单的理解就是做数据传输对象的,类似于VO,但是VO用于传输到前端。(~~)

1.MapStruct是用来做什么的?
现在有这么个场景,从数据库查询出来了一个user对象(包含id,用户名,密码,手机号,邮箱,角色这些字段)和一个对应的角色对象role(包含id,角色名,角色描述这些字段),现在在controller需要用到user对象的id,用户名,和角色对象的角色名三个属性。一种方式是直接把两个对象传递到controller层,但是这样会多出很多没用的属性。更通用的方式是需要用到的属性封装成一个类(DTO),通过传输这个类的实例来完成数据传输。
User.java

@AllArgsConstructor
@Data
public class User {
private Long id;
private String username;
private String password;
private String phoneNum;
private String email;
private Role role;
}
1
2
3
4
5
6
7
8
9
10
Role.java

@AllArgsConstructor
@Data
public class Role {
private Long id;
private String roleName;
private String description;
}

1
2
3
4
5
6
7
8
UserRoleDto.java,这个类就是封装的类

@Data
public class UserRoleDto {
/**
* 用户id
/
private Long userId;
/
*
* 用户名
/
private String name;
/
*
* 角色名
*/
private String roleName;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
测试类,模拟将user对象转换成UserRoleDto对象

public class MainTest {
User user = null;

/**
 * 模拟从数据库中查出user对象
 */
@Before
public void before() {
   Role role  = new Role(2L, "administrator", "超级管理员");
   user  = new User(1L, "zhangsan", "12345", "17677778888", "123@qq.com", role);
}

/**
 * 模拟把user对象转换成UserRoleDto对象
 */
@Test
public void test1() {
    UserRoleDto userRoleDto = new UserRoleDto();
    userRoleDto.setUserId(user.getId());
    userRoleDto.setName(user.getUsername());
    userRoleDto.setRoleName(user.getRole().getRoleName());
    System.out.println(userRoleDto);
}

}

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
从上面代码可以看出,通过getter、setter的方式把一个对象属性值复制到另一个对象中去还是很麻烦的,尤其是当属性过多的时候。而MapStruct就是用于解决这种问题的。

2.使用MapStruct解决上述问题
这里我们沿用User.java、Role.java、UserRoleDto.java。
新建一个UserRoleMapper.java,这个来用来定义User.java、Role.java和UserRoleDto.java之间属性对应规则:
UserRoleMapper.java

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**

  • @Mapper 定义这是一个MapStruct对象属性转换接口,在这个类里面规定转换规则
  •      在项目构建时,会自动生成改接口的实现类,这个实现类将实现对象属性值复制
    

*/
@Mapper
public interface UserRoleMapper {

/**
 * 获取该类自动生成的实现类的实例
 * 接口中的属性都是 public static final 的 方法都是public abstract的
 */
UserRoleMapper INSTANCES = Mappers.getMapper(UserRoleMapper.class);

/**
 * 这个方法就是用于实现对象属性复制的方法
 *
 * @Mapping 用来定义属性复制规则 source 指定源对象属性 target指定目标对象属性
 *
 * @param user 这个参数就是源对象,也就是需要被复制的对象
 * @return 返回的是目标对象,就是最终的结果对象
 */
@Mappings({
        @Mapping(source = "id", target = "userId"),
        @Mapping(source = "username", target = "name"),
        @Mapping(source = "role.roleName", target = "roleName")
})
UserRoleDto toUserRoleDto(User user);

}

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
在测试类中测试:

public class MainTest {
User user = null;

/**
 * 模拟从数据库中查出user对象
 */
@Before
public void before() {
   Role role  = new Role(2L, "administrator", "超级管理员");
   user  = new User(1L, "zhangsan", "12345", "17677778888", "123@qq.com", role);
}

/**
 * 模拟通过MapStruct把user对象转换成UserRoleDto对象
 */
@Test
public void test2() {
    UserRoleDto userRoleDto = UserRoleMapper.INSTANCES.toUserRoleDto(user);
    System.out.println(userRoleDto);
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
通过上面的例子可以看出,使用MapStruct方便许多。

3.添加默认方法
添加默认方法是为了这个类(接口)不只是为了做数据转换用的,也可以做一些其他的事。

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**

  • @Mapper 定义这是一个MapStruct对象属性转换接口,在这个类里面规定转换规则
  •      在项目构建时,会自动生成改接口的实现类,这个实现类将实现对象属性值复制
    

*/
@Mapper
public interface UserRoleMapper {

/**
 * 获取该类自动生成的实现类的实例
 * 接口中的属性都是 public static final 的 方法都是public abstract的
 */
UserRoleMapper INSTANCES = Mappers.getMapper(UserRoleMapper.class);

/**
 * 这个方法就是用于实现对象属性复制的方法
 *
 * @Mapping 用来定义属性复制规则 source 指定源对象属性 target指定目标对象属性
 *
 * @param user 这个参数就是源对象,也就是需要被复制的对象
 * @return 返回的是目标对象,就是最终的结果对象
 */
@Mappings({
        @Mapping(source = "id", target = "userId"),
        @Mapping(source = "username", target = "name"),
        @Mapping(source = "role.roleName", target = "roleName")
})
UserRoleDto toUserRoleDto(User user);

/**
 * 提供默认方法,方法自己定义,这个方法是我随便写的,不是要按照这个格式来的
 * @return
 */
default UserRoleDto defaultConvert() {
    UserRoleDto userRoleDto = new UserRoleDto();
    userRoleDto.setUserId(0L);
    userRoleDto.setName("None");
    userRoleDto.setRoleName("None");
    return userRoleDto;
}

}

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
42
43
44
45
46
47
测试代码:

@Test
public void test3() {
UserRoleMapper userRoleMapperInstances = UserRoleMapper.INSTANCES;
UserRoleDto userRoleDto = userRoleMapperInstances.defaultConvert();
System.out.println(userRoleDto);
}
1
2
3
4
5
6

  1. 可以使用abstract class来代替接口
    mapper可以用接口来实现,也可以完全由抽象来完全代替

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**

  • @Mapper 定义这是一个MapStruct对象属性转换接口,在这个类里面规定转换规则
  •      在项目构建时,会自动生成改接口的实现类,这个实现类将实现对象属性值复制
    

*/
@Mapper
public abstract class UserRoleMapper {

/**
 * 获取该类自动生成的实现类的实例
 * 接口中的属性都是 public static final 的 方法都是public abstract的
 */
public static final UserRoleMapper INSTANCES = Mappers.getMapper(UserRoleMapper.class);

/**
 * 这个方法就是用于实现对象属性复制的方法
 *
 * @Mapping 用来定义属性复制规则 source 指定源对象属性 target指定目标对象属性
 *
 * @param user 这个参数就是源对象,也就是需要被复制的对象
 * @return 返回的是目标对象,就是最终的结果对象
 */
@Mappings({
        @Mapping(source = "id", target = "userId"),
        @Mapping(source = "username", target = "name"),
        @Mapping(source = "role.roleName", target = "roleName")
})
public abstract UserRoleDto toUserRoleDto(User user);

/**
 * 提供默认方法,方法自己定义,这个方法是我随便写的,不是要按照这个格式来的
 * @return
 */
UserRoleDto defaultConvert() {
    UserRoleDto userRoleDto = new UserRoleDto();
    userRoleDto.setUserId(0L);
    userRoleDto.setName("None");
    userRoleDto.setRoleName("None");
    return userRoleDto;
}

}
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
42
43
44
45
46
5.可以使用多个参数
可以绑定多个对象的属性值到目标对象中:

package com.mapstruct.demo;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**

  • @Mapper 定义这是一个MapStruct对象属性转换接口,在这个类里面规定转换规则
  •      在项目构建时,会自动生成改接口的实现类,这个实现类将实现对象属性值复制
    

*/
@Mapper
public interface UserRoleMapper {

/**
 * 获取该类自动生成的实现类的实例
 * 接口中的属性都是 public static final 的 方法都是public abstract的
 */
UserRoleMapper INSTANCES = Mappers.getMapper(UserRoleMapper.class);

/**
 * 这个方法就是用于实现对象属性复制的方法
 *
 * @Mapping 用来定义属性复制规则 source 指定源对象属性 target指定目标对象属性
 *
 * @param user 这个参数就是源对象,也就是需要被复制的对象
 * @return 返回的是目标对象,就是最终的结果对象
 */
@Mappings({
        @Mapping(source = "id", target = "userId"),
        @Mapping(source = "username", target = "name"),
        @Mapping(source = "role.roleName", target = "roleName")
})
UserRoleDto toUserRoleDto(User user);

/**
 * 多个参数中的值绑定 
 * @param user 源1
 * @param role 源2
 * @return 从源1、2中提取出的结果
 */
@Mappings({
        @Mapping(source = "user.id", target = "userId"), // 把user中的id绑定到目标对象的userId属性中
        @Mapping(source = "user.username", target = "name"), // 把user中的username绑定到目标对象的name属性中
        @Mapping(source = "role.roleName", target = "roleName") // 把role对象的roleName属性值绑定到目标对象的roleName中
})
UserRoleDto toUserRoleDto(User user, Role role);

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
42
43
44
45
46
47
对比两个方法~

5.直接使用参数作为属性值
package com.mapstruct.demo;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**

  • @Mapper 定义这是一个MapStruct对象属性转换接口,在这个类里面规定转换规则
  •      在项目构建时,会自动生成改接口的实现类,这个实现类将实现对象属性值复制
    

*/
@Mapper
public interface UserRoleMapper {

/**
 * 获取该类自动生成的实现类的实例
 * 接口中的属性都是 public static final 的 方法都是public abstract的
 */
UserRoleMapper INSTANCES = Mappers.getMapper(UserRoleMapper.class);

/**
 * 直接使用参数作为值
 * @param user
 * @param myRoleName
 * @return
 */
@Mappings({
        @Mapping(source = "user.id", target = "userId"), // 把user中的id绑定到目标对象的userId属性中
        @Mapping(source = "user.username", target = "name"), // 把user中的username绑定到目标对象的name属性中
        @Mapping(source = "myRoleName", target = "roleName") // 把role对象的roleName属性值绑定到目标对象的roleName中
})
UserRoleDto useParameter(User user, String myRoleName);

}

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
测试类:

public class Test1 {
Role role = null;
User user = null;

@Before
public void before() {
    role = new Role(2L, "administrator", "超级管理员");
    user = new User(1L, "zhangsan", "12345", "17677778888", "123@qq.com", role);
}
@Test
public void test1() {
    UserRoleMapper instances = UserRoleMapper.INSTANCES;
    UserRoleDto userRoleDto = instances.useParameter(user, "myUserRole");
    System.out.println(userRoleDto);
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
6.更新对象属性
在之前的例子中UserRoleDto useParameter(User user, String myRoleName);都是通过类似上面的方法来生成一个对象。而MapStruct提供了另外一种方式来更新一个对象中的属性。@MappingTarget

public interface UserRoleMapper1 {

UserRoleMapper1 INSTANCES = Mappers.getMapper(UserRoleMapper1.class);

@Mappings({
        @Mapping(source = "userId", target = "id"),
        @Mapping(source = "name", target = "username"),
        @Mapping(source = "roleName", target = "role.roleName")
})
void updateDto(UserRoleDto userRoleDto, @MappingTarget User user);


@Mappings({
        @Mapping(source = "id", target = "userId"),
        @Mapping(source = "username", target = "name"),
        @Mapping(source = "role.roleName", target = "roleName")
})
void update(User user, @MappingTarget UserRoleDto userRoleDto);

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
通过@MappingTarget来指定目标类是谁(谁的属性需要被更新)。@Mapping还是用来定义属性对应规则。
以此为例说明:

@Mappings({
@Mapping(source = "id", target = "userId"),
@Mapping(source = "username", target = "name"),
@Mapping(source = "role.roleName", target = "roleName")
})
void update(User user, @MappingTarget UserRoleDto userRoleDto);
1
2
3
4
5
6
@MappingTarget标注的类UserRoleDto 为目标类,user类为源类,调用此方法,会把源类中的属性更新到目标类中。更新规则还是由@Mapping指定。

7.没有getter/setter也能赋值
对于没有getter/setter的属性也能实现赋值操作

public class Customer {

private Long id;
private String name;

//getters and setter omitted for brevity

}

public class CustomerDto {

public Long id;
public String customerName;

}

@Mapper
public interface CustomerMapper {

CustomerMapper INSTANCE = Mappers.getMapper( CustomerMapper.class );

@Mapping(source = "customerName", target = "name")
Customer toCustomer(CustomerDto customerDto);

@InheritInverseConfiguration
CustomerDto fromCustomer(Customer customer);

}
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
@Mapping(source = “customerName”, target = “name”)不是用来指定属性映射的,如果两个对象的属性名相同是可以省略@Mapping的。
MapStruct生成的实现类:

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-02-14T15:41:21+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
)
public class CustomerMapperImpl implements CustomerMapper {

@Override
public Customer toCustomer(CustomerDto customerDto) {
    if ( customerDto == null ) {
        return null;
    }

    Customer customer = new Customer();

    customer.setName( customerDto.customerName );
    customer.setId( customerDto.id );

    return customer;
}

@Override
public CustomerDto toCustomerDto(Customer customer) {
    if ( customer == null ) {
        return null;
    }

    CustomerDto customerDto = new CustomerDto();

    customerDto.customerName = customer.getName();
    customerDto.id = customer.getId();

    return customerDto;
}

}

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
@InheritInverseConfiguration在这里的作用就是实现customerDto.customerName = customer.getName();功能的。如果没有这个注解,toCustomerDto这个方法则不会有customerName 和name两个属性的对应关系的。

8.使用Spring依赖注入
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Customer {
private Long id;
private String name;
}

@Data
public class CustomerDto {
private Long id;
private String customerName;
}

// 这里主要是这个componentModel 属性,它的值就是当前要使用的依赖注入的环境
@Mapper(componentModel = "spring")
public interface CustomerMapper {

@Mapping(source = "name", target = "customerName")
CustomerDto toCustomerDto(Customer customer);

}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@Mapper(componentModel = “spring”),表示把当前Mapper类纳入spring容器。可以在其它类中直接注入了:

@SpringBootApplication
@RestController
public class DemoMapstructApplication {

// 注入Mapper
@Autowired
private CustomerMapper mapper;

public static void main(String[] args) {
    SpringApplication.run(DemoMapstructApplication.class, args);
}

@GetMapping("/test")
public String test() {
    Customer customer = new Customer(1L, "zhangsan");
    CustomerDto customerDto = mapper.toCustomerDto(customer);
    return customerDto.toString();
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
看一下由mapstruct自动生成的类文件,会发现标记了@Component注解。

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-02-14T15:54:17+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
)
@Component
public class CustomerMapperImpl implements CustomerMapper {

@Override
public CustomerDto toCustomerDto(Customer customer) {
    if ( customer == null ) {
        return null;
    }

    CustomerDto customerDto = new CustomerDto();

    customerDto.setCustomerName( customer.getName() );
    customerDto.setId( customer.getId() );

    return customerDto;
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
9.自定义类型转换
有时候,在对象转换的时候可能会出现这样一个问题,就是源对象中的类型是Boolean类型,而目标对象类型是String类型,这种情况可以通过@Mapper的uses属性来实现:

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Customer {
private Long id;
private String name;
private Boolean isDisable;
}

@Data
public class CustomerDto {
private Long id;
private String customerName;
private String disable;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
定义转换规则的类:

public class BooleanStrFormat {
public String toStr(Boolean isDisable) {
if (isDisable) {
return "Y";
} else {
return "N";
}
}
public Boolean toBoolean(String str) {
if (str.equals("Y")) {
return true;
} else {
return false;
}
}
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
定义Mapper,@Mapper( uses = { BooleanStrFormat.class}),注意,这里的users属性用于引用之前定义的转换规则的类:

@Mapper( uses = { BooleanStrFormat.class})
public interface CustomerMapper {

CustomerMapper INSTANCES = Mappers.getMapper(CustomerMapper.class);

@Mappings({
        @Mapping(source = "name", target = "customerName"),
        @Mapping(source = "isDisable", target = "disable")
})
CustomerDto toCustomerDto(Customer customer);

}
1
2
3
4
5
6
7
8
9
10
11
这样子,Customer类中的isDisable属性的true就会转变成CustomerDto中的disable属性的yes。
MapStruct自动生成的类中的代码:

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-02-14T16:49:18+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
)
public class CustomerMapperImpl implements CustomerMapper {

// 引用 uses 中指定的类
private final BooleanStrFormat booleanStrFormat = new BooleanStrFormat();

@Override
public CustomerDto toCustomerDto(Customer customer) {
    if ( customer == null ) {
        return null;
    }

    CustomerDto customerDto = new CustomerDto();
    // 转换方式的使用
    customerDto.setDisable( booleanStrFormat.toStr( customer.getIsDisable() ) );
    customerDto.setCustomerName( customer.getName() );
    customerDto.setId( customer.getId() );

    return customerDto;
}

}

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
要注意的是,如果使用了例如像spring这样的环境,Mapper引入uses类实例的方式将是自动注入,那么这个类也应该纳入Spring容器:
CustomerMapper.java指定使用spring

@Mapper(componentModel = "spring", uses = { BooleanStrFormat.class})
public interface CustomerMapper {

CustomerMapper INSTANCES = Mappers.getMapper(CustomerMapper.class);

@Mappings({
        @Mapping(source = "name", target = "customerName"),
        @Mapping(source = "isDisable", target = "disable")
})
CustomerDto toCustomerDto(Customer customer);

}

1
2
3
4
5
6
7
8
9
10
11
12
转换类要加入Spring容器:

@Component
public class BooleanStrFormat {
public String toStr(Boolean isDisable) {
if (isDisable) {
return "Y";
} else {
return "N";
}
}
public Boolean toBoolean(String str) {
if (str.equals("Y")) {
return true;
} else {
return false;
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
MapStruct自动生成的类:

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-02-14T16:55:35+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
)
@Component
public class CustomerMapperImpl implements CustomerMapper {

// 使用自动注入的方式引入
@Autowired
private BooleanStrFormat booleanStrFormat;

@Override
public CustomerDto toCustomerDto(Customer customer) {
    if ( customer == null ) {
        return null;
    }

    CustomerDto customerDto = new CustomerDto();

    customerDto.setDisable( booleanStrFormat.toStr( customer.getIsDisable() ) );
    customerDto.setCustomerName( customer.getName() );
    customerDto.setId( customer.getId() );

    return customerDto;
}

}

————————————————
版权声明:本文为CSDN博主「飞飞不 会飞」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq122516902/article/details/87259752

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 220,295评论 6 512
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,928评论 3 396
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 166,682评论 0 357
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 59,209评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,237评论 6 397
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,965评论 1 308
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,586评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,487评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 46,016评论 1 319
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,136评论 3 340
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,271评论 1 352
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,948评论 5 347
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,619评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,139评论 0 23
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,252评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,598评论 3 375
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,267评论 2 358

推荐阅读更多精彩内容