Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
7445f488
Commit
7445f488
authored
Jun 24, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
c292c703
84dd2b2a
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
579 additions
and
102 deletions
+579
-102
pom.xml
xx-im/xx-im-server/pom.xml
+15
-50
ImApplication.java
...ver/src/main/java/com/xxfc/platform/im/ImApplication.java
+2
-0
ImCommentBiz.java
.../src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
+18
-0
ImPraiseBiz.java
...r/src/main/java/com/xxfc/platform/im/biz/ImPraiseBiz.java
+18
-0
ImQuestionBiz.java
...src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
+39
-0
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+56
-34
ImComment.java
.../src/main/java/com/xxfc/platform/im/entity/ImComment.java
+86
-0
ImPraise.java
...r/src/main/java/com/xxfc/platform/im/entity/ImPraise.java
+73
-0
ImQuestion.java
...src/main/java/com/xxfc/platform/im/entity/ImQuestion.java
+99
-0
ImCommentMapper.java
...ain/java/com/xxfc/platform/im/mapper/ImCommentMapper.java
+15
-0
ImPraiseMapper.java
...main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
+15
-0
ImQuestionMapper.java
...in/java/com/xxfc/platform/im/mapper/ImQuestionMapper.java
+20
-0
Msg.java
...-server/src/main/java/com/xxfc/platform/im/model/Msg.java
+9
-16
ImCommentController.java
...n/java/com/xxfc/platform/im/rest/ImCommentController.java
+14
-0
ImPraiseController.java
...in/java/com/xxfc/platform/im/rest/ImPraiseController.java
+14
-0
ImQuestionController.java
.../java/com/xxfc/platform/im/rest/ImQuestionController.java
+25
-0
MsgController.java
...rc/main/java/com/xxfc/platform/im/rest/MsgController.java
+1
-2
ImCommentMapper.xml
...x-im-server/src/main/resources/mapper/ImCommentMapper.xml
+19
-0
ImPraiseMapper.xml
...xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
+17
-0
ImQuestionMapper.xml
...-im-server/src/main/resources/mapper/ImQuestionMapper.xml
+24
-0
No files found.
xx-im/xx-im-server/pom.xml
View file @
7445f488
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<parent>
<artifactId>
xx-common-platform
</artifactId>
<artifactId>
xx-common-platform
-web
</artifactId>
<groupId>
com.xxfc.common
</groupId>
<groupId>
com.xxfc.common
</groupId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
</parent>
</parent>
...
@@ -33,44 +33,6 @@
...
@@ -33,44 +33,6 @@
</properties>
</properties>
<dependencies>
<dependencies>
<!-- spring -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter
</artifactId>
</dependency>
<!-- 缓存 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<!--nacos相关配置-->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-alibaba-dependencies
</artifactId>
<version>
0.2.1.RELEASE
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-nacos-config
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-nacos-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<version>
1.9.3
</version>
</dependency>
<!--引入开源后台项目的公共包-->
<!--引入开源后台项目的公共包-->
<dependency>
<dependency>
...
@@ -78,36 +40,39 @@
...
@@ -78,36 +40,39 @@
<artifactId>
ace-auth-client
</artifactId>
<artifactId>
ace-auth-client
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
</dependency>
</dependency>
<!-- 引用缓存开源项目 -->
<dependency>
<groupId>
com.github.wxiaoqi
</groupId>
<artifactId>
ace-cache
</artifactId>
<version>
0.0.2
</version>
</dependency>
<!--
其他
-->
<!--
自己项目
-->
<dependency>
<dependency>
<groupId>
log4j
</groupId>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
log4j
</artifactId>
<artifactId>
xx-im-api
</artifactId>
<version>
1.2.17
</version>
<version>
2.0-SNAPSHOT
</version>
</dependency>
</dependency>
<!--mongodb-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.mongodb.morphia
</groupId>
<groupId>
org.mongodb.morphia
</groupId>
<artifactId>
morphia
</artifactId>
<artifactId>
morphia
</artifactId>
<version>
1.3.2
</version>
<version>
1.3.2
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.lucene
</groupId>
<groupId>
org.apache.lucene
</groupId>
<artifactId>
lucene-core
</artifactId>
<artifactId>
lucene-core
</artifactId>
<version>
7.1.0
</version>
<version>
7.1.0
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/ImApplication.java
View file @
7445f488
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.im;
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.im;
import
com.ace.cache.EnableAceCache
;
import
com.ace.cache.EnableAceCache
;
import
com.github.wxiaoqi.security.auth.client.EnableAceAuthClient
;
import
com.github.wxiaoqi.security.auth.client.EnableAceAuthClient
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
...
@@ -20,6 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -20,6 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableFeignClients
({
"com.github.wxiaoqi.security.auth.client.feign"
,
"com.xxfc.platform"
})
@EnableFeignClients
({
"com.github.wxiaoqi.security.auth.client.feign"
,
"com.xxfc.platform"
})
@EnableAceCache
@EnableAceCache
@EnableCaching
@EnableCaching
@tk
.
mybatis
.
spring
.
annotation
.
MapperScan
(
basePackages
=
"com.xxfc.platform.im.mapper"
)
public
class
ImApplication
{
public
class
ImApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
biz
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.im.entity.ImComment
;
import
com.xxfc.platform.im.mapper.ImCommentMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
/**
* 评论表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
@Service
public
class
ImCommentBiz
extends
BaseBiz
<
ImCommentMapper
,
ImComment
>
{
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImPraiseBiz.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
biz
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.im.entity.ImPraise
;
import
com.xxfc.platform.im.mapper.ImPraiseMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
/**
* 点赞表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
@Service
public
class
ImPraiseBiz
extends
BaseBiz
<
ImPraiseMapper
,
ImPraise
>
{
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
biz
;
import
com.xxfc.platform.im.mapper.ImQuestionMapper
;
import
com.xxfc.platform.im.model.Msg
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 10:45:05
*/
@Service
public
class
ImQuestionBiz
extends
BaseBiz
<
ImQuestionMapper
,
ImQuestion
>
{
@Autowired
private
ImQuestionMapper
imQuestionMapper
;
@Autowired
private
MongoTemplate
mongoTemplate
;
public
Object
getQuestionList
(
Map
<
String
,
Object
>
map
){
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
List
<
Msg
>
list
=
mongoTemplate
.
findAll
(
Msg
.
class
,
"s_msg"
);
returnMap
.
put
(
"msg"
,
list
);
returnMap
.
put
(
"question"
,
imQuestionMapper
.
getQuestionList
(
map
));
return
returnMap
;
}
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
7445f488
...
@@ -5,11 +5,18 @@ package com.xxfc.platform.im.biz;
...
@@ -5,11 +5,18 @@ package com.xxfc.platform.im.biz;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.mongodb.DBCollection
;
import
com.mongodb.DBCollection
;
import
com.mongodb.DBCursor
;
import
com.mongodb.DBCursor
;
import
com.mongodb.DBObject
;
import
com.mongodb.DBObject
;
import
com.xxfc.platform.im.model.Comment
;
import
com.xxfc.platform.im.model.Comment
;
import
com.xxfc.platform.im.model.Msg
;
import
com.xxfc.platform.im.model.Praise
;
import
com.xxfc.platform.im.model.Praise
;
import
org.bson.types.ObjectId
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
@@ -25,7 +32,6 @@ public class MsgBiz {
...
@@ -25,7 +32,6 @@ public class MsgBiz {
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
DBCollection
collection
;
/**
/**
* 获取消息列表
* 获取消息列表
...
@@ -33,43 +39,59 @@ public class MsgBiz {
...
@@ -33,43 +39,59 @@ public class MsgBiz {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
Object
getMsgList
(
Map
<
String
,
Object
>
map
)
throws
Exception
{
public
ObjectRestResponse
getMsgList
(
Map
<
String
,
Object
>
map
)
throws
Exception
{
/* PageHelper.startPage(Integer.parseInt(map.get("page").toString()),Integer.parseInt(map.get("limit").toString()));
//获取所有朋友圈
PageInfo<Msg> goodPageInfo = new PageInfo<>(mongoTemplate.findAll(Msg.class));
String
userId
=
map
.
get
(
"userId"
).
toString
();
Query query = new Query(Criteria.where("userId").is(10000012));
PageHelper
.
startPage
(
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
()));
List<Msg> msg= mongoTemplate.findAll(Msg.class, "s_msg");*/
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
findAll
(
Msg
.
class
,
"s_msg"
),
userId
);
if
(
null
==
collection
)
PageInfo
<
Msg
>
goodPageInfo
=
new
PageInfo
<>(
msgList
);
collection
=
MGDBCollection
.
getDB
().
getCollection
(
"s_msg"
);
return
new
ObjectRestResponse
().
status
(
RestCode
.
SUCCESS
.
getStatus
()).
msg
(
RestCode
.
SUCCESS
.
getMsg
()).
data
(
goodPageInfo
);
DBCursor
cursor
=
collection
.
find
();
}
//collection.find()
//return PageDataVO.pageInfo(goodPageInfo);
JSONArray
array
=
new
JSONArray
();
/**
DBObject
dbObject
=
null
;
* 添加评论和点赞
while
(
cursor
.
hasNext
()){
* @param list
dbObject
=
cursor
.
next
();
* @param userId
JSONObject
json
=
fetchAndAttach
(
JSONObject
.
parseObject
(
dbObject
.
toString
()));
* @return
array
.
add
(
json
);
*/
private
List
<
Msg
>
fetchAndAttach
(
List
<
Msg
>
list
,
String
userId
)
{
for
(
Msg
msg:
list
)
{
//添加评论
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msg
.
getMsgId
()));
List
<
Comment
>
comments
=
mongoTemplate
.
find
(
query
,
Comment
.
class
,
"s_comment"
);
msg
.
setComments
(
comments
);
//添加点赞
List
<
Praise
>
praise
=
mongoTemplate
.
find
(
query
,
Praise
.
class
,
"s_praise"
);
msg
.
setPraises
(
praise
);
msg
.
setIsPraise
(
this
.
exists
(
Integer
.
parseInt
(
userId
),
msg
.
getMsgId
())
?
1
:
0
);
msg
.
setIsCollect
(
this
.
existsCollect
(
Integer
.
parseInt
(
userId
),
msg
.
getMsgId
())?
1
:
0
);
}
}
return
array
;
return
list
;
}
}
private
JSONObject
fetchAndAttach
(
JSONObject
json
)
{
/**
//查询评论
* 判断是否点赞
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
json
.
getString
(
"_id"
)));
* @param userId
List
<
Comment
>
msgComment
=
mongoTemplate
.
findAll
(
Comment
.
class
);
* @param msgId
json
.
put
(
"comments"
,
msgComment
);
* @return
*/
//查询点赞
public
boolean
exists
(
int
userId
,
ObjectId
msgId
)
{
Query
query1
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
json
.
getString
(
"_id"
)));
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Praise
>
msgPraise
=
mongoTemplate
.
findAll
(
Praise
.
class
);
List
<
Praise
>
praise
=
mongoTemplate
.
find
(
query
,
Praise
.
class
,
"s_praise"
);
json
.
put
(
"praises"
,
msgPraise
);
return
0
!=
praise
.
size
();
/* msg.setComments(getComments(msg.getMsgId().toString()));
}
msg.setPraises(getPraises(msg.getMsgId().toString()));
msg.setGifts(SKBeanUtils.getMsgGiftRepository().find(msg.getMsgId(), null, 0, 10));
msg.setIsPraise(SKBeanUtils.getMsgPraiseRepository().exists(ReqUtil.getUserId(), msg.getMsgId()) ? 1 : 0);
msg.setIsCollect(SKBeanUtils.getMsgPraiseRepository().existsCollect(ReqUtil.getUserId(), msg.getMsgId()) ? 1 : 0);*/
return
json
;
/**
* 判断是否评论
* @param userId
* @param msgId
* @return
*/
public
boolean
existsCollect
(
int
userId
,
ObjectId
msgId
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Comment
>
comments
=
mongoTemplate
.
find
(
query
,
Comment
.
class
,
"s_comment"
);
return
0
!=
comments
.
size
();
}
}
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImComment.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 评论表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
@Data
@Table
(
name
=
"im_comment"
)
public
class
ImComment
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
""
)
private
Long
id
;
/**
* 问题Id
*/
@Column
(
name
=
"question_id"
)
@ApiModelProperty
(
value
=
"问题Id"
)
private
Long
questionId
;
/**
* 评论类容
*/
@Column
(
name
=
"content"
)
@ApiModelProperty
(
value
=
"评论类容"
)
private
String
content
;
/**
*
*/
@Column
(
name
=
"time"
)
@ApiModelProperty
(
value
=
""
)
private
Long
time
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Long
userId
;
/**
* 是否显示
*/
@Column
(
name
=
"visible"
)
@ApiModelProperty
(
value
=
"是否显示"
)
private
String
visible
;
/**
* 是否只有自己可见(评论审核时仅自己可见)
*/
@Column
(
name
=
"visible_own"
)
@ApiModelProperty
(
value
=
"是否只有自己可见(评论审核时仅自己可见)"
)
private
String
visibleOwn
;
/**
* 状态
*/
@Column
(
name
=
"state"
)
@ApiModelProperty
(
value
=
"状态"
)
private
String
state
;
/**
* 是否删除0-正常,1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除"
)
private
String
isDel
;
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImPraise.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 点赞表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
@Data
@Table
(
name
=
"im_praise"
)
public
class
ImPraise
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
""
)
private
Long
id
;
/**
* 问题id
*/
@Column
(
name
=
"question_id"
)
@ApiModelProperty
(
value
=
"问题id"
)
private
Long
questionId
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Long
userId
;
/**
* 时间
*/
@Column
(
name
=
"time"
)
@ApiModelProperty
(
value
=
"时间"
)
private
Long
time
;
/**
* 状态
*/
@Column
(
name
=
"state"
)
@ApiModelProperty
(
value
=
"状态"
)
private
String
state
;
/**
* 是否显示
*/
@Column
(
name
=
"visible"
)
@ApiModelProperty
(
value
=
"是否显示"
)
private
String
visible
;
/**
* 是否删除0-正常,1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除"
)
private
String
isDel
;
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImQuestion.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 10:45:05
*/
@Data
@Table
(
name
=
"im_question"
)
public
class
ImQuestion
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
""
)
private
Long
id
;
/**
* 标题
*/
@Column
(
name
=
"title"
)
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
/**
* 内容
*/
@Column
(
name
=
"content"
)
@ApiModelProperty
(
value
=
"内容"
)
private
String
content
;
/**
* 纬度
*/
@Column
(
name
=
"latitude"
)
@ApiModelProperty
(
value
=
"纬度"
)
private
String
latitude
;
/**
* 经度
*/
@Column
(
name
=
"longitude"
)
@ApiModelProperty
(
value
=
"经度"
)
private
String
longitude
;
/**
* 手机型号
*/
@Column
(
name
=
"model"
)
@ApiModelProperty
(
value
=
"手机型号"
)
private
String
model
;
/**
* 添加时间
*/
@Column
(
name
=
"time"
)
@ApiModelProperty
(
value
=
"添加时间"
)
private
Long
time
;
/**
*
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
""
)
private
Long
userId
;
/**
* 是否显示
*/
@Column
(
name
=
"visible"
)
@ApiModelProperty
(
value
=
"是否显示"
)
private
String
visible
;
/**
* 状态
*/
@Column
(
name
=
"state"
)
@ApiModelProperty
(
value
=
"状态"
)
private
String
state
;
/**
* 是否删除0-正常,1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除"
)
private
String
isDel
;
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImCommentMapper.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImComment
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 评论表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
public
interface
ImCommentMapper
extends
Mapper
<
ImComment
>
{
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImPraise
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 点赞表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 19:14:43
*/
public
interface
ImPraiseMapper
extends
Mapper
<
ImPraise
>
{
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImQuestionMapper.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.Map
;
/**
* 旅游商品表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
public
interface
ImQuestionMapper
extends
Mapper
<
ImQuestion
>
{
List
<
ImQuestion
>
getQuestionList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
map
);
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/model/Msg.java
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
model
;
package
com
.
xxfc
.
platform
.
im
.
model
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.aliyun.oss.ServiceException
;
import
com.aliyun.oss.ServiceException
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.xxfc.platform.im.utils.DateUtil
;
import
com.xxfc.platform.im.utils.DateUtil
;
import
com.xxfc.platform.im.utils.StringUtil
;
import
com.xxfc.platform.im.utils.StringUtil
;
import
org.bson.types.ObjectId
;
import
org.bson.types.ObjectId
;
import
org.mongodb.morphia.annotations.Entity
;
import
org.mongodb.morphia.annotations.*
;
import
org.mongodb.morphia.annotations.Id
;
import
org.mongodb.morphia.annotations.Index
;
import
org.mongodb.morphia.annotations.Indexes
;
import
org.mongodb.morphia.annotations.NotSaved
;
import
org.mongodb.morphia.annotations.Reference
;
import
org.mongodb.morphia.annotations.Transient
;
import
com.alibaba.fastjson.JSON
;
import
java.util.List
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
/**
* 朋友圈消息
* 朋友圈消息
...
@@ -36,7 +29,7 @@ public class Msg {
...
@@ -36,7 +29,7 @@ public class Msg {
private
String
location
;
private
String
location
;
private
Double
longitude
;
// 经度
private
Double
longitude
;
// 经度
private
String
model
;
// 发送消息手机型号(如:iPhone 5)
private
String
model
;
// 发送消息手机型号(如:iPhone 5)
private
@Id
ObjectId
msgI
d
;
// 消息Id
private
@Id
ObjectId
i
d
;
// 消息Id
private
String
nickname
;
// 昵称
private
String
nickname
;
// 昵称
private
Long
time
;
// 发朋友圈消息时间
private
Long
time
;
// 发朋友圈消息时间
private
Integer
userId
;
// 发消息用户Id
private
Integer
userId
;
// 发消息用户Id
...
@@ -105,7 +98,7 @@ public class Msg {
...
@@ -105,7 +98,7 @@ public class Msg {
}
}
public
ObjectId
getMsgId
()
{
public
ObjectId
getMsgId
()
{
return
msgI
d
;
return
i
d
;
}
}
public
String
getNickname
()
{
public
String
getNickname
()
{
...
@@ -161,7 +154,7 @@ public class Msg {
...
@@ -161,7 +154,7 @@ public class Msg {
}
}
public
void
setMsgId
(
ObjectId
msgId
)
{
public
void
setMsgId
(
ObjectId
msgId
)
{
this
.
msgI
d
=
msgId
;
this
.
i
d
=
msgId
;
}
}
public
void
setNickname
(
String
nickname
)
{
public
void
setNickname
(
String
nickname
)
{
...
@@ -572,7 +565,7 @@ public class Msg {
...
@@ -572,7 +565,7 @@ public class Msg {
count
.
total
=
0
;
// 参考数
count
.
total
=
0
;
// 参考数
Msg
entity
=
new
Msg
();
Msg
entity
=
new
Msg
();
entity
.
msgI
d
=
ObjectId
.
get
();
entity
.
i
d
=
ObjectId
.
get
();
entity
.
userId
=
user
.
getUserId
();
entity
.
userId
=
user
.
getUserId
();
if
(
10000
==
user
.
getUserId
())
if
(
10000
==
user
.
getUserId
())
entity
.
nickname
=
"客服公众号"
;
entity
.
nickname
=
"客服公众号"
;
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/ImCommentController.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
rest
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.im.biz.ImCommentBiz
;
import
com.xxfc.platform.im.entity.ImComment
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"imComment"
)
public
class
ImCommentController
extends
BaseController
<
ImCommentBiz
,
ImComment
>
{
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/ImPraiseController.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
rest
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.im.biz.ImPraiseBiz
;
import
com.xxfc.platform.im.entity.ImPraise
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"imPraise"
)
public
class
ImPraiseController
extends
BaseController
<
ImPraiseBiz
,
ImPraise
>
{
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/ImQuestionController.java
0 → 100644
View file @
7445f488
package
com
.
xxfc
.
platform
.
im
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.im.biz.ImQuestionBiz
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"imQuestion"
)
public
class
ImQuestionController
extends
BaseController
<
ImQuestionBiz
,
ImQuestion
>
{
@Autowired
private
ImQuestionBiz
questionBiz
;
@RequestMapping
(
value
=
"/app/unauth/getQuestionList"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
getQuestionList
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
return
questionBiz
.
getQuestionList
(
map
);
}
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/MsgController.java
View file @
7445f488
...
@@ -20,8 +20,7 @@ public class MsgController {
...
@@ -20,8 +20,7 @@ public class MsgController {
@RequestMapping
(
value
=
"/app/unauth/list"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/app/unauth/list"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Object
getMsgList
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
public
ObjectRestResponse
getMsgList
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
//@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit", required = true) Integer limit
return
msgBiz
.
getMsgList
(
map
);
return
msgBiz
.
getMsgList
(
map
);
}
}
}
}
xx-im/xx-im-server/src/main/resources/mapper/ImCommentMapper.xml
0 → 100644
View file @
7445f488
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImCommentMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.im.entity.ImComment"
id=
"imCommentMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"questionId"
column=
"question_id"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"time"
column=
"time"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"visible"
column=
"visible"
/>
<result
property=
"visibleOwn"
column=
"visible_own"
/>
<result
property=
"state"
column=
"state"
/>
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
0 → 100644
View file @
7445f488
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImPraiseMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.im.entity.ImPraise"
id=
"imPraiseMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"questionId"
column=
"question_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"time"
column=
"time"
/>
<result
property=
"state"
column=
"state"
/>
<result
property=
"visible"
column=
"visible"
/>
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImQuestionMapper.xml
0 → 100644
View file @
7445f488
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImQuestionMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.im.entity.ImQuestion"
id=
"imQuestionMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"latitude"
column=
"latitude"
/>
<result
property=
"longitude"
column=
"longitude"
/>
<result
property=
"model"
column=
"model"
/>
<result
property=
"time"
column=
"time"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"visible"
column=
"visible"
/>
<result
property=
"state"
column=
"state"
/>
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
<select
id=
"getQuestionList"
resultMap=
"imQuestionMap"
parameterType=
"java.util.Map"
>
select * from im_question
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment