新增备注列表

This commit is contained in:
2025-08-26 15:35:26 +08:00
parent 0828111404
commit 0cc4e97526
6 changed files with 395 additions and 120 deletions
@@ -0,0 +1,62 @@
package lingtao.net.service;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lingtao.net.bean.Information;
import lingtao.net.bean.Msg;
import lingtao.net.bean.SysUser;
import lingtao.net.dao.InformationMapper;
@Service
public class InformationService {
@Autowired
private InformationMapper informationMapper;
public List<Information> getInformations(Information information) {
return informationMapper.getInformations(information);
}
public Msg addInformation(Information information, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
information.setCreateBy(user.getRealname());
try {
informationMapper.addInformation(information);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg updateInformationById(Information information, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
information.setUpdateBy(user.getRealname());
try {
informationMapper.updateInformationById(information);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg deleteInformationById(Integer id) {
try {
informationMapper.deleteInformationById(id);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public List<Information> getShortAnswers() {
return informationMapper.getShortAnswers();
}
}