修复留言板Bug

This commit is contained in:
wen 2022-01-20 22:52:42 +08:00
parent 3ff14d7135
commit e106f2ee3f
3 changed files with 11 additions and 6 deletions

View File

@ -49,6 +49,9 @@ public class XhpcMessageBoardController {
@PostMapping("/platform/message")
public AjaxResult platformSendMessageToUser(@RequestBody PlatformSendMessageToUserRequest platformRequest) {
if (platformRequest.getMessageContent() == null || "".equals(platformRequest.getMessageContent())) {
return AjaxResult.error("必须传入有效的信息内容");
}
xhpcMessageBoardService.platformSendMessageToUser(platformRequest);
return AjaxResult.success();
@ -77,7 +80,7 @@ public class XhpcMessageBoardController {
* @date 2022/1/15 18:47
* @since version-1.0
*/
@PatchMapping("/user/message")
@GetMapping("/user/message")
public AjaxResult platformQueryMessage(UserQueryCondition userQueryCondition) {
QueryUserMassageResponse queryUserMassageResponse = xhpcMessageBoardService.platformQueryMessage(userQueryCondition);

View File

@ -16,6 +16,8 @@ import com.xhpc.common.util.DateUtil;
import com.xhpc.common.util.MyPagingUtil;
import com.xhpc.system.api.domain.SysUser;
import com.xhpc.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -41,7 +43,7 @@ public class XhpcMessageBoardServiceImpl implements XhpcMessageBoardService {
@Resource
UserTypeService userTypeService;
private static final Logger logger = LoggerFactory.getLogger(XhpcMessageBoardServiceImpl.class);
/**
* 将用户发送的信息保存到数据库中
*

View File

@ -118,10 +118,10 @@
AND tenant_type = #{tenantType}
AND del_flag IS NULL
AND have_new_info = 0
<if test="userType!=null">
<if test="userType!=null and userType!=''">
AND sender_type = #{userType}
</if>
<if test="senderAccount">
<if test="senderAccount!=null and senderAccount!=''">
AND sender_account = #{senderAccount}
</if>
LIMIT #{currentPage},#{items}
@ -133,10 +133,10 @@
AND tenant_type = #{tenantType}
AND del_flag IS NULL
AND have_new_info = 0
<if test="userType!=null">
<if test="userType!=null and userType!=''">
AND sender_type = #{userType}
</if>
<if test="senderAccount">
<if test="senderAccount!=null and senderAccount!=''">
AND sender_account = #{senderAccount}
</if>
</select>