123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package com.ruoyi.web.controller.register;
- import java.util.List;
- import javax.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.system.domain.RegisterParentsStudent;
- import com.ruoyi.system.service.IRegisterParentsStudentService;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.ruoyi.common.core.page.TableDataInfo;
- /**
- * 注册-家长-学生Controller
- *
- * @author ruoyi
- * @date 2023-05-25
- */
- @RestController
- @RequestMapping("/register/student")
- public class RegisterParentsStudentController extends BaseController
- {
- @Autowired
- private IRegisterParentsStudentService registerParentsStudentService;
- /**
- * 查询注册-家长-学生列表
- */
- @PreAuthorize("@ss.hasPermi('register:student:list')")
- @GetMapping("/list")
- public TableDataInfo list(RegisterParentsStudent registerParentsStudent)
- {
- startPage();
- List<RegisterParentsStudent> list = registerParentsStudentService.selectRegisterParentsStudentList(registerParentsStudent);
- return getDataTable(list);
- }
- /**
- * 导出注册-家长-学生列表
- */
- @PreAuthorize("@ss.hasPermi('register:student:export')")
- @Log(title = "注册-家长-学生", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, RegisterParentsStudent registerParentsStudent)
- {
- List<RegisterParentsStudent> list = registerParentsStudentService.selectRegisterParentsStudentList(registerParentsStudent);
- ExcelUtil<RegisterParentsStudent> util = new ExcelUtil<RegisterParentsStudent>(RegisterParentsStudent.class);
- util.exportExcel(response, list, "注册-家长-学生数据");
- }
- /**
- * 获取注册-家长-学生详细信息
- */
- @PreAuthorize("@ss.hasPermi('register:student:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
- return success(registerParentsStudentService.selectRegisterParentsStudentById(id));
- }
- /**
- * 新增注册-家长-学生
- */
- @PreAuthorize("@ss.hasPermi('register:student:add')")
- @Log(title = "注册-家长-学生", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody RegisterParentsStudent registerParentsStudent)
- {
- return toAjax(registerParentsStudentService.insertRegisterParentsStudent(registerParentsStudent));
- }
- /**
- * 修改注册-家长-学生
- */
- @PreAuthorize("@ss.hasPermi('register:student:edit')")
- @Log(title = "注册-家长-学生", businessType = BusinessType.UPDATE)
- @PostMapping("/put")
- public AjaxResult edit(@RequestBody RegisterParentsStudent registerParentsStudent)
- {
- return toAjax(registerParentsStudentService.updateRegisterParentsStudent(registerParentsStudent));
- }
- /**
- * 删除注册-家长-学生
- */
- @PreAuthorize("@ss.hasPermi('register:student:remove')")
- @Log(title = "注册-家长-学生", businessType = BusinessType.DELETE)
- @GetMapping("/delete/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(registerParentsStudentService.deleteRegisterParentsStudentByIds(ids));
- }
- }
|