基于Javaweb实现的教务管理系统

使用技术栈

前端::vue
后端::springboot +mysql8.0+mybatisplus+redis6.0

具体实现

目前所使用的技术都是在当今企业,主流的技术栈,SpringBoot框架没有过多的繁杂的配置,能够实现快速开发,
通过Mysql8.0优化之后,优化了数据的存储,对于经常性不变的数据,通过使用redis作为缓存…

交流

如果大家感兴趣,可以联系我哦!

package com.stum.web.controller.stum;

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.stum.common.annotation.Log;
import com.stum.common.core.controller.BaseController;
import com.stum.common.core.domain.AjaxResult;
import com.stum.common.enums.BusinessType;
import com.stum.web.domain.TbAdmin;
import com.stum.web.service.ITbAdminService;
import com.stum.common.utils.poi.ExcelUtil;
import com.stum.common.core.page.TableDataInfo;

/**
 * 管理员Controller
 *
 * @author stum
 * @date 2021-11-14
 */
@RestController
@RequestMapping("/system/admin")
public class TbAdminController extends BaseController
{
    @Autowired
    private ITbAdminService tbAdminService;

    /**
     * 查询管理员列表
     */
    @PreAuthorize("@ss.hasPermi('system:admin:list')")
    @GetMapping("/list")
    public TableDataInfo list(TbAdmin tbAdmin)
    {
        startPage();
        List<TbAdmin> list = tbAdminService.selectTbAdminList(tbAdmin);
        return getDataTable(list);
    }

    /**
     * 导出管理员列表
     */
    @PreAuthorize("@ss.hasPermi('system:admin:export')")
    @Log(title = "管理员", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TbAdmin tbAdmin)
    {
        List<TbAdmin> list = tbAdminService.selectTbAdminList(tbAdmin);
        ExcelUtil<TbAdmin> util = new ExcelUtil<TbAdmin>(TbAdmin.class);
        util.exportExcel(response, list, "管理员数据");
    }

    /**
     * 获取管理员详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:admin:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tbAdminService.selectTbAdminById(id));
    }

    /**
     * 新增管理员
     */
    @PreAuthorize("@ss.hasPermi('system:admin:add')")
    @Log(title = "管理员", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TbAdmin tbAdmin)
    {
        return toAjax(tbAdminService.insertTbAdmin(tbAdmin));
    }

    /**
     * 修改管理员
     */
    @PreAuthorize("@ss.hasPermi('system:admin:edit')")
    @Log(title = "管理员", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TbAdmin tbAdmin)
    {
        return toAjax(tbAdminService.updateTbAdmin(tbAdmin));
    }

    /**
     * 删除管理员
     */
    @PreAuthorize("@ss.hasPermi('system:admin:remove')")
    @Log(title = "管理员", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tbAdminService.deleteTbAdminByIds(ids));
    }
}

欢迎大家来交流学习
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值