From a4e65eb0b1e3b828b13a7f22313c648b82ce3226 Mon Sep 17 00:00:00 2001 From: maxxie Date: Tue, 17 Dec 2024 21:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student/controller/StudentController.java | 104 ------------------ .../com/ruoyi/student/domain/Student.java | 100 ----------------- .../ruoyi/student/mapper/StudentMapper.java | 61 ---------- .../student/service/IStudentService.java | 61 ---------- .../service/impl/StudentServiceImpl.java | 96 ---------------- .../mapper/student/StudentMapper.xml | 88 --------------- 6 files changed, 510 deletions(-) delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/student/controller/StudentController.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/student/domain/Student.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/student/mapper/StudentMapper.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/student/service/IStudentService.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/student/service/impl/StudentServiceImpl.java delete mode 100644 ruoyi-admin/src/main/resources/mapper/student/StudentMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/student/controller/StudentController.java b/ruoyi-admin/src/main/java/com/ruoyi/student/controller/StudentController.java deleted file mode 100644 index 3f3b9c9c..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/student/controller/StudentController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.ruoyi.student.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.student.domain.Student; -import com.ruoyi.student.service.IStudentService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 学生管理Controller - * - * @author Maxxie - * @date 2024-12-04 - */ -@RestController -@RequestMapping("/student/student") -public class StudentController extends BaseController -{ - @Autowired - private IStudentService studentService; - - /** - * 查询学生管理列表 - */ - @PreAuthorize("@ss.hasPermi('student:student:list')") - @GetMapping("/list") - public TableDataInfo list(Student student) - { - startPage(); - List list = studentService.selectStudentList(student); - return getDataTable(list); - } - - /** - * 导出学生管理列表 - */ - @PreAuthorize("@ss.hasPermi('student:student:export')") - @Log(title = "学生管理", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Student student) - { - List list = studentService.selectStudentList(student); - ExcelUtil util = new ExcelUtil(Student.class); - util.exportExcel(response, list, "学生管理数据"); - } - - /** - * 获取学生管理详细信息 - */ - @PreAuthorize("@ss.hasPermi('student:student:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(studentService.selectStudentById(id)); - } - - /** - * 新增学生管理 - */ - @PreAuthorize("@ss.hasPermi('student:student:add')") - @Log(title = "学生管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody Student student) - { - return toAjax(studentService.insertStudent(student)); - } - - /** - * 修改学生管理 - */ - @PreAuthorize("@ss.hasPermi('student:student:edit')") - @Log(title = "学生管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody Student student) - { - return toAjax(studentService.updateStudent(student)); - } - - /** - * 删除学生管理 - */ - @PreAuthorize("@ss.hasPermi('student:student:remove')") - @Log(title = "学生管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(studentService.deleteStudentByIds(ids)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/student/domain/Student.java b/ruoyi-admin/src/main/java/com/ruoyi/student/domain/Student.java deleted file mode 100644 index 4688def3..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/student/domain/Student.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.ruoyi.student.domain; - -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 学生管理对象 tb_student - * - * @author Maxxie - * @date 2024-12-04 - */ -public class Student extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 学号 */ - private String id; - - /** 姓名 */ - @Excel(name = "姓名") - private String name; - - /** 性别 */ - @Excel(name = "性别") - private Long gender; - - /** 出生日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date birthday; - - /** 头像 */ - @Excel(name = "头像") - private String image; - - public void setId(String id) - { - this.id = id; - } - - public String getId() - { - return id; - } - public void setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - public void setGender(Long gender) - { - this.gender = gender; - } - - public Long getGender() - { - return gender; - } - public void setBirthday(Date birthday) - { - this.birthday = birthday; - } - - public Date getBirthday() - { - return birthday; - } - public void setImage(String image) - { - this.image = image; - } - - public String getImage() - { - return image; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("gender", getGender()) - .append("birthday", getBirthday()) - .append("image", getImage()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/student/mapper/StudentMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/student/mapper/StudentMapper.java deleted file mode 100644 index 5191b89c..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/student/mapper/StudentMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.student.mapper; - -import java.util.List; -import com.ruoyi.student.domain.Student; - -/** - * 学生管理Mapper接口 - * - * @author Maxxie - * @date 2024-12-04 - */ -public interface StudentMapper -{ - /** - * 查询学生管理 - * - * @param id 学生管理主键 - * @return 学生管理 - */ - public Student selectStudentById(String id); - - /** - * 查询学生管理列表 - * - * @param student 学生管理 - * @return 学生管理集合 - */ - public List selectStudentList(Student student); - - /** - * 新增学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - public int insertStudent(Student student); - - /** - * 修改学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - public int updateStudent(Student student); - - /** - * 删除学生管理 - * - * @param id 学生管理主键 - * @return 结果 - */ - public int deleteStudentById(String id); - - /** - * 批量删除学生管理 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteStudentByIds(String[] ids); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/student/service/IStudentService.java b/ruoyi-admin/src/main/java/com/ruoyi/student/service/IStudentService.java deleted file mode 100644 index 16af2715..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/student/service/IStudentService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.student.service; - -import java.util.List; -import com.ruoyi.student.domain.Student; - -/** - * 学生管理Service接口 - * - * @author Maxxie - * @date 2024-12-04 - */ -public interface IStudentService -{ - /** - * 查询学生管理 - * - * @param id 学生管理主键 - * @return 学生管理 - */ - public Student selectStudentById(String id); - - /** - * 查询学生管理列表 - * - * @param student 学生管理 - * @return 学生管理集合 - */ - public List selectStudentList(Student student); - - /** - * 新增学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - public int insertStudent(Student student); - - /** - * 修改学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - public int updateStudent(Student student); - - /** - * 批量删除学生管理 - * - * @param ids 需要删除的学生管理主键集合 - * @return 结果 - */ - public int deleteStudentByIds(String[] ids); - - /** - * 删除学生管理信息 - * - * @param id 学生管理主键 - * @return 结果 - */ - public int deleteStudentById(String id); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/student/service/impl/StudentServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/student/service/impl/StudentServiceImpl.java deleted file mode 100644 index 14487d4a..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/student/service/impl/StudentServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.ruoyi.student.service.impl; - -import java.util.List; -import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.student.mapper.StudentMapper; -import com.ruoyi.student.domain.Student; -import com.ruoyi.student.service.IStudentService; - -/** - * 学生管理Service业务层处理 - * - * @author Maxxie - * @date 2024-12-04 - */ -@Service -public class StudentServiceImpl implements IStudentService -{ - @Autowired - private StudentMapper studentMapper; - - /** - * 查询学生管理 - * - * @param id 学生管理主键 - * @return 学生管理 - */ - @Override - public Student selectStudentById(String id) - { - return studentMapper.selectStudentById(id); - } - - /** - * 查询学生管理列表 - * - * @param student 学生管理 - * @return 学生管理 - */ - @Override - public List selectStudentList(Student student) - { - return studentMapper.selectStudentList(student); - } - - /** - * 新增学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - @Override - public int insertStudent(Student student) - { - student.setCreateTime(DateUtils.getNowDate()); - return studentMapper.insertStudent(student); - } - - /** - * 修改学生管理 - * - * @param student 学生管理 - * @return 结果 - */ - @Override - public int updateStudent(Student student) - { - student.setUpdateTime(DateUtils.getNowDate()); - return studentMapper.updateStudent(student); - } - - /** - * 批量删除学生管理 - * - * @param ids 需要删除的学生管理主键 - * @return 结果 - */ - @Override - public int deleteStudentByIds(String[] ids) - { - return studentMapper.deleteStudentByIds(ids); - } - - /** - * 删除学生管理信息 - * - * @param id 学生管理主键 - * @return 结果 - */ - @Override - public int deleteStudentById(String id) - { - return studentMapper.deleteStudentById(id); - } -} diff --git a/ruoyi-admin/src/main/resources/mapper/student/StudentMapper.xml b/ruoyi-admin/src/main/resources/mapper/student/StudentMapper.xml deleted file mode 100644 index 54f87771..00000000 --- a/ruoyi-admin/src/main/resources/mapper/student/StudentMapper.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - select id, name, gender, birthday, image, create_by, create_time, update_by, update_time from tb_student - - - - - - - - insert into tb_student - - id, - name, - gender, - birthday, - image, - create_by, - create_time, - update_by, - update_time, - - - #{id}, - #{name}, - #{gender}, - #{birthday}, - #{image}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update tb_student - - name = #{name}, - gender = #{gender}, - birthday = #{birthday}, - image = #{image}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from tb_student where id = #{id} - - - - delete from tb_student where id in - - #{id} - - - \ No newline at end of file