Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
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
李伟
cust-api
Commits
30e590b6
Commit
30e590b6
authored
Jan 25, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增了发表留言和分页查询留言
parent
f3d301ae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
4 deletions
+124
-4
AppMemInfoController.java
...isoft/app/appMemInfo/controller/AppMemInfoController.java
+32
-3
MemInfoRepository.java
...a/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
+10
-0
MemInfo.java
...ain/java/org/rcisoft/business/memInfo/entity/MemInfo.java
+19
-0
UserLeaveMessageDTO.java
.../rcisoft/business/memInfo/entity/UserLeaveMessageDTO.java
+0
-1
MemInfoService.java
.../org/rcisoft/business/memInfo/service/MemInfoService.java
+12
-0
MemInfoServiceImpl.java
...oft/business/memInfo/service/impl/MemInfoServiceImpl.java
+27
-0
MemInfoMapper.xml
...esources/mapper/business/memInfo/mapper/MemInfoMapper.xml
+24
-0
No files found.
src/main/java/org/rcisoft/app/appMemInfo/controller/AppMemInfoController.java
View file @
30e590b6
...
...
@@ -11,9 +11,7 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Parameters
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.rcisoft.business.memInfo.entity.MemFollowDTO
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.business.memInfo.entity.MemLikeDTO
;
import
org.rcisoft.business.memInfo.entity.*
;
import
org.rcisoft.business.memInfo.service.MemInfoService
;
import
org.rcisoft.core.anno.CyEncryptSm4Anno
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
...
...
@@ -22,6 +20,7 @@ import org.rcisoft.core.constant.CyMessCons;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
...
...
@@ -30,6 +29,7 @@ import org.rcisoft.core.service.CyFileStorageService;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -345,4 +345,33 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
}
return
getGridModelResponse
();
}
/**
* 用户详情/我的-留言
*/
@PreAuthorize
(
"@cyPerm.hasPerm('mem:leaveMessage:add')"
)
@CyOpeLogAnno
(
title
=
"system-会员表管理-留言"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"留言"
,
description
=
"留言"
)
@PostMapping
(
value
=
"/memInfo/leaveMessage"
)
// @CyEncryptSm4Anno
public
CyResult
leaveMessage
(
@Valid
@RequestBody
UserLeaveMessageDTO
dto
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
memInfoServiceImpl
.
leaveMessage
(
dto
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
dto
);
}
/**
* 分页查询留言列表
*/
@CyOpeLogAnno
(
title
=
"system-会员表管理-查询留言表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"分页查询留言列表"
,
description
=
"分页查询留言列表"
)
@GetMapping
(
value
=
"/memInfo/leaveMessageList"
)
// @CyEncryptSm4Anno
public
CyGridModel
leaveMessageByPagination
(
UserLeaveMessageDTO
dto
)
{
IPage
<
MemInfo
>
userLeaveMessage
=
memInfoServiceImpl
.
leaveMessageByPagination
(
getPaginationUtility
(),
dto
);
return
getGridModelResponse
();
}
}
src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
View file @
30e590b6
...
...
@@ -162,5 +162,15 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* 查询我喜欢的 喜欢我的 互相喜欢的数量
*/
MemInfo
selectUserFollowCount
(
Integer
userId
);
/**
* 留言
*/
int
leaveMessage
(
UserLeaveMessageDTO
dto
);
/**
* 分页查询留言
*/
IPage
<
MemInfo
>
leaveMessageByPagination
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
UserLeaveMessageDTO
dto
);
}
src/main/java/org/rcisoft/business/memInfo/entity/MemInfo.java
View file @
30e590b6
...
...
@@ -567,5 +567,24 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
*/
@TableField
(
exist
=
false
)
private
String
queryType
;
/**
* 目标id
*/
@TableField
(
exist
=
false
)
private
Integer
targetId
;
/**
* 留言内容
*/
@TableField
(
exist
=
false
)
private
String
leaveMessageContent
;
/**
* 留言删除状态
* 0未删除,1本人已删除,2对方已删除,3双方都删除了
*/
@TableField
(
exist
=
false
)
private
String
delStatus
;
}
src/main/java/org/rcisoft/business/memInfo/entity/UserLeaveMessageDTO.java
View file @
30e590b6
...
...
@@ -13,5 +13,4 @@ public class UserLeaveMessageDTO {
private
String
content
;
//删除类型 0未删除,1本人已删除,2对方已删除,3双方都删除了
private
String
delStatus
;
}
src/main/java/org/rcisoft/business/memInfo/service/MemInfoService.java
View file @
30e590b6
...
...
@@ -100,4 +100,16 @@ public interface MemInfoService {
CyPersistModel
addLike
(
MemLikeDTO
likeDTO
);
IPage
<
MemInfo
>
findRankByPagination
(
CyPageInfo
<
MemInfo
>
paginationUtility
,
MemInfo
memInfo
);
/**
* 留言
* @param dto
* @return
*/
CyPersistModel
leaveMessage
(
UserLeaveMessageDTO
dto
);
/**
* 分页查询留言列表
*/
IPage
<
MemInfo
>
leaveMessageByPagination
(
CyPageInfo
<
MemInfo
>
paginationUtility
,
UserLeaveMessageDTO
dto
);
}
src/main/java/org/rcisoft/business/memInfo/service/impl/MemInfoServiceImpl.java
View file @
30e590b6
...
...
@@ -675,4 +675,31 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
}
log
.
info
(
"用户点赞数据定时任务执行中..."
);
}
/**
* 留言
* @param dto
* @return
*/
@Override
public
CyPersistModel
leaveMessage
(
UserLeaveMessageDTO
dto
)
{
dto
.
setDelStatus
(
"0"
);
dto
.
setUserId
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()));
int
line
=
memInfoRepository
.
leaveMessage
(
dto
);
return
new
CyPersistModel
(
line
);
}
/**
* 分页查询留言列表
*
* @param paginationUtility
* @param dto
*/
@Override
public
IPage
<
MemInfo
>
leaveMessageByPagination
(
CyPageInfo
<
MemInfo
>
paginationUtility
,
UserLeaveMessageDTO
dto
)
{
dto
.
setUserId
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()));
IPage
<
MemInfo
>
userLeaveMessageIPage
=
memInfoRepository
.
leaveMessageByPagination
(
paginationUtility
,
dto
);
return
userLeaveMessageIPage
;
}
}
src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
View file @
30e590b6
...
...
@@ -611,4 +611,28 @@
where 1=1
and user_id = #{entity.targetId}
</insert>
<insert
id=
"leaveMessage"
>
insert into opm_user_leave_message (target_id,create_by,create_date,update_by,update_date,content,del_status)
values(#{targetId},#{userId},NOW(),#{userId},NOW(),#{content},#{delStatus})
</insert>
<select
id=
"leaveMessageByPagination"
resultType=
"org.rcisoft.business.memInfo.entity.MemInfo"
>
SELECT
oulm.business_id,
oulm.content as leaveMessageContent,
oulm.del_status,
oulm.create_date,
oulm.create_by as userId,
oulm.target_id,
mi.avatar,
mi.mem_nick_name
FROM opm_user_leave_message oulm
LEFT JOIN mem_info mi ON mi.user_id = oulm.create_by
WHERE oulm.create_by = #{entity.userId}
AND oulm.create_date = (
SELECT MAX(oulm2.create_date)
FROM opm_user_leave_message oulm2
WHERE oulm2.target_id = oulm.target_id
AND oulm2.create_by = #{entity.userId}
)
</select>
</mapper>
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