Commit f995cb2413a766971f72d7a5e1de179df14606df
1 parent
4be15f54be
Exists in
master
聊天记录
Showing 5 changed files with 172 additions and 0 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsMessage.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsMessageMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsMessageService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsMessageServiceImpl.java
- talkonlineweb/src/main/resources/mapper/LymsMessageMapper.xml
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsMessage.java
View file @
f995cb2
1 | +package com.lyms.talkonlineweb.domain; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.annotation.IdType; | |
4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
7 | +import java.io.Serializable; | |
8 | +import java.util.Date; | |
9 | +import lombok.Data; | |
10 | + | |
11 | +/** | |
12 | + * | |
13 | + * @TableName lyms_message | |
14 | + */ | |
15 | +@TableName(value ="lyms_message") | |
16 | +@Data | |
17 | +public class LymsMessage implements Serializable { | |
18 | + /** | |
19 | + * | |
20 | + */ | |
21 | + @TableId(value = "id", type = IdType.AUTO) | |
22 | + private Integer id; | |
23 | + | |
24 | + /** | |
25 | + * 发送人员 | |
26 | + */ | |
27 | + @TableField(value = "fromid") | |
28 | + private String fromid; | |
29 | + | |
30 | + /** | |
31 | + * 接受人员 | |
32 | + */ | |
33 | + @TableField(value = "targetid") | |
34 | + private String targetid; | |
35 | + | |
36 | + /** | |
37 | + * 消息类型 | |
38 | + */ | |
39 | + @TableField(value = "mtype") | |
40 | + private String mtype; | |
41 | + | |
42 | + /** | |
43 | + * 消息内容 | |
44 | + */ | |
45 | + @TableField(value = "content") | |
46 | + private String content; | |
47 | + | |
48 | + /** | |
49 | + * 发送时间 | |
50 | + */ | |
51 | + @TableField(value = "sendtime") | |
52 | + private Date sendtime; | |
53 | + | |
54 | + @TableField(exist = false) | |
55 | + private static final long serialVersionUID = 1L; | |
56 | + | |
57 | + @Override | |
58 | + public boolean equals(Object that) { | |
59 | + if (this == that) { | |
60 | + return true; | |
61 | + } | |
62 | + if (that == null) { | |
63 | + return false; | |
64 | + } | |
65 | + if (getClass() != that.getClass()) { | |
66 | + return false; | |
67 | + } | |
68 | + LymsMessage other = (LymsMessage) that; | |
69 | + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) | |
70 | + && (this.getFromid() == null ? other.getFromid() == null : this.getFromid().equals(other.getFromid())) | |
71 | + && (this.getTargetid() == null ? other.getTargetid() == null : this.getTargetid().equals(other.getTargetid())) | |
72 | + && (this.getMtype() == null ? other.getMtype() == null : this.getMtype().equals(other.getMtype())) | |
73 | + && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) | |
74 | + && (this.getSendtime() == null ? other.getSendtime() == null : this.getSendtime().equals(other.getSendtime())); | |
75 | + } | |
76 | + | |
77 | + @Override | |
78 | + public int hashCode() { | |
79 | + final int prime = 31; | |
80 | + int result = 1; | |
81 | + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); | |
82 | + result = prime * result + ((getFromid() == null) ? 0 : getFromid().hashCode()); | |
83 | + result = prime * result + ((getTargetid() == null) ? 0 : getTargetid().hashCode()); | |
84 | + result = prime * result + ((getMtype() == null) ? 0 : getMtype().hashCode()); | |
85 | + result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); | |
86 | + result = prime * result + ((getSendtime() == null) ? 0 : getSendtime().hashCode()); | |
87 | + return result; | |
88 | + } | |
89 | + | |
90 | + @Override | |
91 | + public String toString() { | |
92 | + StringBuilder sb = new StringBuilder(); | |
93 | + sb.append(getClass().getSimpleName()); | |
94 | + sb.append(" ["); | |
95 | + sb.append("Hash = ").append(hashCode()); | |
96 | + sb.append(", id=").append(id); | |
97 | + sb.append(", fromid=").append(fromid); | |
98 | + sb.append(", targetid=").append(targetid); | |
99 | + sb.append(", mtype=").append(mtype); | |
100 | + sb.append(", content=").append(content); | |
101 | + sb.append(", sendtime=").append(sendtime); | |
102 | + sb.append(", serialVersionUID=").append(serialVersionUID); | |
103 | + sb.append("]"); | |
104 | + return sb.toString(); | |
105 | + } | |
106 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsMessageMapper.java
View file @
f995cb2
1 | +package com.lyms.talkonlineweb.mapper; | |
2 | + | |
3 | +import com.lyms.talkonlineweb.domain.LymsMessage; | |
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
5 | + | |
6 | +/** | |
7 | + * @Entity com.lyms.talkonlineweb.domain.LymsMessage | |
8 | + */ | |
9 | +public interface LymsMessageMapper extends BaseMapper<LymsMessage> { | |
10 | + | |
11 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsMessageService.java
View file @
f995cb2
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsMessageServiceImpl.java
View file @
f995cb2
1 | +package com.lyms.talkonlineweb.service.impl; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
4 | +import com.lyms.talkonlineweb.domain.LymsMessage; | |
5 | +import com.lyms.talkonlineweb.service.LymsMessageService; | |
6 | +import com.lyms.talkonlineweb.mapper.LymsMessageMapper; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +/** | |
10 | + * | |
11 | + */ | |
12 | +@Service | |
13 | +public class LymsMessageServiceImpl extends ServiceImpl<LymsMessageMapper, LymsMessage> | |
14 | + implements LymsMessageService{ | |
15 | + | |
16 | +} |
talkonlineweb/src/main/resources/mapper/LymsMessageMapper.xml
View file @
f995cb2
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper | |
3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
5 | +<mapper namespace="com.lyms.talkonlineweb.mapper.LymsMessageMapper"> | |
6 | + | |
7 | + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsMessage"> | |
8 | + <id property="id" column="id" jdbcType="INTEGER"/> | |
9 | + <result property="fromid" column="fromid" jdbcType="VARCHAR"/> | |
10 | + <result property="targetid" column="targetid" jdbcType="VARCHAR"/> | |
11 | + <result property="mtype" column="mtype" jdbcType="VARCHAR"/> | |
12 | + <result property="content" column="content" jdbcType="VARCHAR"/> | |
13 | + <result property="sendtime" column="sendtime" jdbcType="TIMESTAMP"/> | |
14 | + </resultMap> | |
15 | + | |
16 | + <sql id="Base_Column_List"> | |
17 | + id,fromid,targetid, | |
18 | + mtype,content,sendtime | |
19 | + </sql> | |
20 | +</mapper> |