mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 03:16:48 +08:00
调整消息的接口
This commit is contained in:
@@ -139,7 +139,7 @@ public class MessageApi extends ApiBaseController {
|
||||
}
|
||||
|
||||
try {
|
||||
service.cleanByAcceptId(aid);
|
||||
service.setReadByAcceptId(aid);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("设置已读失败",e);
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface IMessageService {
|
||||
* @param aid
|
||||
* @return
|
||||
*/
|
||||
Integer setReadByAcceptId(String aid);
|
||||
void setReadByAcceptId(String aid);
|
||||
|
||||
/**
|
||||
* 清空所有的消息,按接收人
|
||||
|
||||
@@ -110,14 +110,13 @@ public class MessageServiceImpl implements IMessageService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer setReadByAcceptId(String aid) {
|
||||
int n=dao.deleteByField("acceptId", aid);
|
||||
return n;
|
||||
public void setReadByAcceptId(String aid) {
|
||||
dao.update("Update "+Message.class.getSimpleName()+" set isRead=?1 where acceptId=?2 and isRead=?3", true,aid,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanByAcceptId(String aid) {
|
||||
dao.update("Update "+Message.class.getSimpleName()+" set isRead=?1 where acceptId=?2 and isRead=?3", true,aid,false);
|
||||
dao.deleteByField("acceptId", aid);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user