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