使用技术栈
前端::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));
}
}
欢迎大家来交流学习