结组作业,第二次冲刺(1)
今天为第二阶段冲刺的第一天,经历了一阶段的冲刺,我们发现我们的项目功能过少,且内容比较简单,这一阶段我们将对其进行增加新的功能。我们明确了分工,我负责,新添加功能的后端代码的编写,以及数据库表的创建,数据库的连接,我的组员进行前端代码的编写。今天总结了很多,所以只编写了一点代码,以下为今日代码:
package com.work.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.work.common.utils.BaseUtil; import com.work.common.utils.JsonUtil; import com.work.pojo.Mailbox; import com.work.service.MailboxService; @Controller @RequestMapping("/server/mailbox") public class MailboxController extends BaseUtil{ @Autowired private MailboxService mailboxService; //去信箱列表 @RequestMapping("/goMailboxList") public ModelAndView goMailboxList(ModelAndView mv){ mv.setViewName("server/mailboxManage/mailboxList"); return mv; } //获取信箱列表 @RequestMapping("/getMailboxList") public void getMailboxList(HttpServletResponse response,Mailbox mailbox,Integer page,Integer limit){ if(page == null){ page = 1; } if(limit == null){ limit = 10; } int totalCount = mailboxService.getMailboxListCount(mailbox); List<Mailbox> list = mailboxService.getMailboxList(mailbox,(page-1) * limit, limit); output(response,JsonUtil.buildJsonByTotalCount(list, totalCount)); } //去查看信件 @RequestMapping("/goUpdateMailbox") public ModelAndView goUpdateMailbox(ModelAndView mv,Integer id){ Mailbox mailbox = mailboxService.getMailboxById(id); mv.addObject("mailbox", mailbox); mv.setViewName("server/mailboxManage/updateMailbox"); return mv; } //编辑信件 @RequestMapping("/updateMailbox") public void updateMailbox(HttpServletResponse response,Mailbox mailbox){ mailboxService.updateMailbox(mailbox); output(response,JsonUtil.buildFalseJson(0, "编辑成功!")); } //删除信件 @RequestMapping("/deleteMailbox") public void deleteMailbox(HttpServletResponse response,Integer id){ mailboxService.deleteMailboxById(id); output(response,JsonUtil.buildFalseJson(0, "删除成功!")); } }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 【杂谈】分布式事务——高大上的无用知识?