0


毕设基于SSM+Vue3实现设备维修管理系统四:后台框架及基础增删改查功能实现

  本章介绍后端基础框架及基础的增删改查功能实现,创建基础的dao、service即controller层相关的基类,并实现基础的增删改查相关功能。

源码下载:点击下载
讲解视频:

SMM+VUE3实现设备维修管理系统毕设:后端框架搭建及表外键添加

在这里插入图片描述

一、基础框架搭建

1.1 DAO层

  使用mybatisplus提供的BaseMapper,实现基础的数据库增删改查功能。

packagecom.junjunjun.device.dao;importcom.baomidou.mybatisplus.core.mapper.BaseMapper;importcom.junjunjun.device.entity.BaseEntity;/**
 * 数据层处理的基础类
 */publicinterfaceBaseDao<TextendsBaseEntity>extendsBaseMapper<T>{}

1.2 SERVICE层

  service层实现业务逻辑,包括数据填充、数据缓存、事务、关联数据处理等基础逻辑。

packagecom.junjunjun.device.service;importcom.junjunjun.device.entity.BaseEntity;/**
 * 业务逻辑基础
 * @param <T>
 */publicinterfaceIBaseService<TextendsBaseEntity>{}

  实现数据删除基础服务,为需要删除数据的实体提供对应的数据删除业务逻辑。

packagecom.junjunjun.device.service;importcom.junjunjun.device.entity.BaseDataEntity;/**
 * 删除数据
 * @param <T>
 */publicinterfaceIBaseDeleteService<TextendsBaseDataEntity>extendsIBaseService<T>{/**
     * 删除数据
     * @param id
     */voiddelete(Long id);}

  数据保存基础处理逻辑。

packagecom.junjunjun.device.service;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 数据保存
 * 
 * @param <T>
 */publicinterfaceIBaseSaveService<VextendsBaseDataVo,TextendsBaseDataEntity>extendsIBaseService<T>{/**
     * 保存数据
     * 
     * @param data
     */Vsave(V data);}

  数据更新基础处理逻辑。

packagecom.junjunjun.device.service;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 更新数据
 * 
 * @param <T>
 */publicinterfaceIBaseUpdateService<VextendsBaseDataVo,TextendsBaseDataEntity>extendsIBaseService<T>{/**
     * 更新数据
     * 
     * @param data
     */Vupdate(V data);}

  数据查询相关基础处理逻辑,包括详情、分页等查询功能。

packagecom.junjunjun.device.service;importcom.baomidou.mybatisplus.extension.plugins.pagination.Page;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 查詢數據
 * 
 * @param <T>
 */publicinterfaceIBaseViewService<VextendsBaseDataVo,TextendsBaseDataEntity>extendsIBaseService<T>{/**
     * 获取详情
     * 
     * @param id
     * @return
     */Vget(Long id);/**
     * 分页
     * 
     * @param size
     * @param pageNo
     * @param dict
     * @return
     */Page<V>page(Page<V> page,V data);}

  service服务实现基类。

packagecom.junjunjun.device.service.impl;importorg.springframework.security.core.GrantedAuthority;importcom.junjunjun.device.entity.BaseEntity;importcom.junjunjun.device.entity.system.User;importcom.junjunjun.device.service.IBaseService;importlombok.extern.slf4j.Slf4j;/**
 * 业务逻辑基础类
 * 
 * @param <T>
 */@Slf4jpublicabstractclassBaseServiceImpl<TextendsBaseEntity>implementsIBaseService<T>{/**
     * 判断当前登录用户是否是管理员
     * 
     * @param user
     * @return
     */protectedbooleancurrentUserIsAdmin(User user){if(user ==null){returnfalse;}for(GrantedAuthority item : user.getAuthorities()){if("ROLE_ADMIN".equals(item.getAuthority())){returntrue;}}returnfalse;}/**
     * 判断当前登录用户是否是部門管理员
     * 
     * @param user
     * @return
     */protectedbooleancurrentUserIsDepartmentAdmin(User user){if(user ==null){returnfalse;}for(GrantedAuthority item : user.getAuthorities()){if("ROLE_DEPARTMENT_ADMIN".equals(item.getAuthority())){returntrue;}}returnfalse;}/**
     * 判断当前登录用户是否具有审核权限
     * 
     * @param user
     * @return
     */protectedbooleancurrentUserIsExamineAdmin(User user){if(user ==null){returnfalse;}for(GrantedAuthority item : user.getAuthorities()){if("ROLE_EXAMINE_ADMIN".equals(item.getAuthority())){returntrue;}}returnfalse;}/**
     * 判断当前登录用户是否具有审核权限
     * 
     * @param user
     * @return
     */protectedbooleancurrentUserIsCheckAdmin(User user){if(user ==null){returnfalse;}for(GrantedAuthority item : user.getAuthorities()){if("ROLE_CHECK_ADMIN".equals(item.getAuthority())){returntrue;}}returnfalse;}}

  数据删除基础服务。

packagecom.junjunjun.device.service.impl;importorg.springframework.cache.annotation.CacheEvict;importorg.springframework.transaction.annotation.Transactional;importcom.junjunjun.device.CacheRemove;importcom.junjunjun.device.SaveLog;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.service.IBaseDeleteService;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 刪除功能
 * 
 * @param <T>
 */publicabstractclassBaseDeleteServiceImpl<VextendsBaseDataVo,TextendsBaseDataEntity>extendsBaseUpdateServiceImpl<V,T>implementsIBaseDeleteService<T>{@Override@SaveLog(operDesc ="刪除数据信息", operType ="刪除")@CacheEvict(cacheNames ="systemcache", key ="#root.targetClass+'_get_'+#id")@CacheRemove(value ={"#root.targetClass+'_page_'"},cache ="systemcache")@Transactional(rollbackFor =Exception.class)publicvoiddelete(Long id){getDao().deleteById(id);afterDelete(id);}protectedvoidafterDelete(Long id){}}

  数据保存基础服务。

packagecom.junjunjun.device.service.impl;importorg.springframework.cache.annotation.CachePut;importorg.springframework.transaction.annotation.Transactional;importcom.junjunjun.device.CacheRemove;importcom.junjunjun.device.SaveLog;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.service.IBaseSaveService;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 保存數據
 */publicabstractclassBaseSaveServiceImpl<VextendsBaseDataVo,TextendsBaseDataEntity>extendsBaseViewServiceImpl<V,T>implementsIBaseSaveService<V,T>{@Override@SaveLog(operDesc ="添加数据信息", operType ="添加")@CachePut(cacheNames ="systemcache", key ="#root.targetClass+'_get_'+#result.id")@CacheRemove(value ={"#root.targetClass+'_page_'"},cache ="systemcache")@Transactional(rollbackFor =Exception.class)publicVsave(V data){/**
         * 1.默认数据的填充
         * 
         * 2.记录操作日志
         * 
         * 3.缓存数据的更新
         */T e =getDto().voToEntity(data);getDao().insert(e);V result =getDto().entityToVo(e);afterSave(result,data);return result;}protectedvoidafterSave(V result,V data){}}

  数据更新基础服务。

packagecom.junjunjun.device.service.impl;importorg.springframework.cache.annotation.CacheEvict;importorg.springframework.cache.annotation.CachePut;importorg.springframework.transaction.annotation.Transactional;importcom.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;importcom.junjunjun.device.CacheRemove;importcom.junjunjun.device.SaveLog;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.service.IBaseUpdateService;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 添加/更新/查看功能
 * 
 * @param <T>
 */publicabstractclassBaseUpdateServiceImpl<VextendsBaseDataVo,TextendsBaseDataEntity>extendsBaseSaveServiceImpl<V,T>implementsIBaseUpdateService<V,T>{/**
     * 填充要更新的字段
     * 
     * @param data
     * @param updateWrapper
     */protectedabstractvoidinitUpdateWrapper(V data,UpdateWrapper<T> updateWrapper);@Override@SaveLog(operDesc ="更新数据信息", operType ="更新")@CacheRemove(value ={"#root.targetClass+'_page_'"},cache ="systemcache")@CachePut(cacheNames ="systemcache", key ="#root.targetClass+'_get_'+#result.id")@Transactional(rollbackFor =Exception.class)publicVupdate(V data){UpdateWrapper<T> updateWrapper =newUpdateWrapper<T>();initUpdateWrapper(data, updateWrapper);
        updateWrapper.eq("id", data.getId());getDao().update(updateWrapper);afterUpdate(data);returnget(data.getId());}protectedvoidafterUpdate(V data){}}

  数据查询相关业务基础服务。

packagecom.junjunjun.device.service.impl;importjava.util.List;importorg.springframework.cache.annotation.Cacheable;importcom.baomidou.mybatisplus.core.conditions.query.QueryWrapper;importcom.baomidou.mybatisplus.extension.plugins.pagination.Page;importcom.google.common.collect.Lists;importcom.junjunjun.device.dao.BaseDao;importcom.junjunjun.device.dto.BaseDto;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.service.IBaseViewService;importcom.junjunjun.device.vo.BaseDataVo;/**
 * 查看功能接口
 * 
 * @param <T>
 */publicabstractclassBaseViewServiceImpl<VextendsBaseDataVo,TextendsBaseDataEntity>extendsBaseServiceImpl<T>implementsIBaseViewService<V,T>{/**
     * 获取具体的dao
     * 
     * @return
     */protectedabstractBaseDao<T>getDao();/**
     * 获取具体的dao
     * 
     * @return
     */protectedabstractBaseDto<V,T>getDto();/**
     * 填充搜索条件
     * 
     * @param dict
     * @param queryWrapper
     */protectedabstractvoidinitQueryWrapper(V data,QueryWrapper<T> queryWrapper);@Override@Cacheable(value ="systemcache", key="#root.targetClass+'_'+#root.method.name+'_'+#id")publicVget(Long id){T t =getDao().selectById(id);if(t==null){returnnull;}V v =getDto().entityToVo(t);returnafterGet(v);}/**
     * 注入关联数据
     * 
     * @param v
     * @return
     */protectedVafterGet(V v){return v;};@Override//    @Cacheable(value = "systemcache", key="#root.targetClass+'_'+#root.method.name+'_'+#page.orders+'_'+#page.current+'_'+#page.size+'_'+#data")@Cacheable(value ="systemcache", keyGenerator ="cachekKeyGenerator")publicPage<V>page(Page<V> page,V data){Page<T> tpage =newPage<>(page.getCurrent(), page.getSize());QueryWrapper<T> queryWrapper =newQueryWrapper<T>();initQueryWrapper(data, queryWrapper);
        queryWrapper.orderByDesc("create_date");
        tpage =getDao().selectPage(tpage, queryWrapper);

        page.setCountId(tpage.countId());
        page.setCurrent(tpage.getCurrent()).setMaxLimit(tpage.maxLimit());
        page.setOptimizeCountSql(tpage.optimizeCountSql());
        page.setOptimizeJoinOfCountSql(tpage.optimizeJoinOfCountSql());
        page.setOrders(tpage.orders());
        page.setPages(tpage.getPages());
        page.setSize(tpage.getSize());List<V> vs =Lists.newArrayList();
        tpage.getRecords().forEach(item ->{V v =getDto().entityToVo(item);afterGet(v);
            vs.add(v);});
        page.setRecords(vs);
        page.setSize(tpage.getSize()).setTotal(tpage.getTotal());
        page.setSearchCount(tpage.searchCount());return page;}}

1.3 CONTROLLER层

  controller基础类,所有的controller都继承此类。

packagecom.junjunjun.device.api;importlombok.extern.slf4j.Slf4j;/**
 * 接口的抽象类
 */@Slf4jpublicabstractclassBaseController{}

  数据删除接口基础类。

packagecom.junjunjun.device.api;importorg.springframework.security.access.prepost.PreAuthorize;importorg.springframework.validation.annotation.Validated;importorg.springframework.web.bind.annotation.PathVariable;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.ResponseBody;importcom.junjunjun.device.service.IBaseDeleteService;importcom.junjunjun.device.vo.BaseDataVo;importcom.junjunjun.device.vo.ResultVo;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;importjakarta.validation.constraints.NotNull;importlombok.extern.slf4j.Slf4j;@Slf4jpublicabstractclassBaseDeleteController<TextendsBaseDataVo>extendsBaseSaveController<T>{@PostMapping("/delete/{id}")@ResponseBody@PreAuthorize("hasAuthority(#this.this.class.name+':delete')")publicResultVo<T>delete(@Validated@NotNull(message ="ID不能为空")@PathVariableLong id,HttpServletRequest request,HttpServletResponse response){// TODO 参数及权限校验try{((IBaseDeleteService<?>)getService()).delete(id);returnResultVo.success(null);}catch(Exception e){
            e.printStackTrace();
            log.error("更新异常", e);returnResultVo.error(e.getMessage());}};}

  数据保存接口基础类。

packagecom.junjunjun.device.api;importorg.springframework.security.access.prepost.PreAuthorize;importorg.springframework.validation.annotation.Validated;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.RequestBody;importorg.springframework.web.bind.annotation.ResponseBody;importcom.junjunjun.device.Save;importcom.junjunjun.device.service.IBaseSaveService;importcom.junjunjun.device.vo.BaseDataVo;importcom.junjunjun.device.vo.ResultVo;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;importlombok.extern.slf4j.Slf4j;@Slf4jpublicabstractclassBaseSaveController<TextendsBaseDataVo>extendsBaseUpdateController<T>{@PostMapping("/save")@ResponseBody@PreAuthorize("hasAuthority(#this.this.class.name+':save')")publicResultVo<T>save(@Validated(value =Save.class)@RequestBodyT t,HttpServletRequest request,HttpServletResponse response){// TODO 参数及权限校验try{
            t =((IBaseSaveService<T,?>)getService()).save(t);returnResultVo.success(t);}catch(Exception e){
            e.printStackTrace();
            log.error("更新异常", e);returnResultVo.error(e.getMessage());}};}

  数据更新接口基础类。

packagecom.junjunjun.device.api;importorg.springframework.security.access.prepost.PreAuthorize;importorg.springframework.validation.annotation.Validated;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.RequestBody;importorg.springframework.web.bind.annotation.ResponseBody;importcom.junjunjun.device.Update;importcom.junjunjun.device.service.IBaseUpdateService;importcom.junjunjun.device.vo.BaseDataVo;importcom.junjunjun.device.vo.ResultVo;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;importlombok.extern.slf4j.Slf4j;@Slf4jpublicabstractclassBaseUpdateController<TextendsBaseDataVo>extendsBaseViewController<T>{@PostMapping("/update")@ResponseBody@PreAuthorize("hasAuthority(#this.this.class.name+':update')")publicResultVo<T>update(@Validated(value =Update.class)@RequestBodyT t,HttpServletRequest request,HttpServletResponse response){// TODO 参数及权限校验try{((IBaseUpdateService<T,?>)getService()).update(t);returnResultVo.success(t);}catch(Exception e){
            e.printStackTrace();
            log.error("更新异常", e);returnResultVo.error(e.getMessage());}};}

  数据查询接口基础类。

packagecom.junjunjun.device.api;importorg.springframework.security.access.prepost.PreAuthorize;importorg.springframework.validation.annotation.Validated;importorg.springframework.web.bind.annotation.GetMapping;importorg.springframework.web.bind.annotation.PathVariable;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.RequestBody;importorg.springframework.web.bind.annotation.RequestMapping;importorg.springframework.web.bind.annotation.ResponseBody;importcom.baomidou.mybatisplus.extension.plugins.pagination.Page;importcom.junjunjun.device.entity.BaseDataEntity;importcom.junjunjun.device.service.IBaseService;importcom.junjunjun.device.service.IBaseViewService;importcom.junjunjun.device.vo.BaseDataVo;importcom.junjunjun.device.vo.PageVo;importcom.junjunjun.device.vo.ResultVo;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;importjakarta.validation.constraints.NotNull;@RequestMapping(path ="/")publicabstractclassBaseViewController<TextendsBaseDataVo>extendsBaseDataController<T>{/**
     * 获取具体的service服务
     * 
     * @return
     */protectedabstract<EextendsBaseDataEntity>IBaseService<E>getService();@GetMapping("/get/{id}")@ResponseBody@PreAuthorize("hasAuthority(#this.this.class.name+':get')")publicResultVo<T>get(@Validated@NotNull(message ="ID不能为空")@PathVariableLong id,HttpServletRequest request,HttpServletResponse response){if(id ==null){returnResultVo.error("参数为空");}// TODO 权限的检测T t =((IBaseViewService<T,?>)getService()).get(id);returnResultVo.success(t);};@PostMapping("/page")@ResponseBody@PreAuthorize("hasAuthority(#this.this.class.name+':page')")publicResultVo<T>page(@RequestBodyPageVo<T> page,HttpServletRequest request,HttpServletResponse response){if(page ==null){
            page =newPageVo<>();}if(page.getPage()==null){
            page.setPage(newPage<>(1,10));}Page<T> result =((IBaseViewService<T,?>)getService()).page(page.getPage(), page.getEntity());returnResultVo.success(result);};}

二、增删改查实现

#mermaid-svg-7oeqMGPCwI4s3kHZ {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .error-icon{fill:#552222;}#mermaid-svg-7oeqMGPCwI4s3kHZ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-7oeqMGPCwI4s3kHZ .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-7oeqMGPCwI4s3kHZ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-7oeqMGPCwI4s3kHZ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-7oeqMGPCwI4s3kHZ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-7oeqMGPCwI4s3kHZ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-7oeqMGPCwI4s3kHZ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .marker.cross{stroke:#333333;}#mermaid-svg-7oeqMGPCwI4s3kHZ svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-7oeqMGPCwI4s3kHZ .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-7oeqMGPCwI4s3kHZ text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-7oeqMGPCwI4s3kHZ .actor-line{stroke:grey;}#mermaid-svg-7oeqMGPCwI4s3kHZ .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .sequenceNumber{fill:white;}#mermaid-svg-7oeqMGPCwI4s3kHZ #sequencenumber{fill:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .messageText{fill:#333;stroke:#333;}#mermaid-svg-7oeqMGPCwI4s3kHZ .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-7oeqMGPCwI4s3kHZ .labelText,#mermaid-svg-7oeqMGPCwI4s3kHZ .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-7oeqMGPCwI4s3kHZ .loopText,#mermaid-svg-7oeqMGPCwI4s3kHZ .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-7oeqMGPCwI4s3kHZ .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-7oeqMGPCwI4s3kHZ .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-7oeqMGPCwI4s3kHZ .noteText,#mermaid-svg-7oeqMGPCwI4s3kHZ .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-7oeqMGPCwI4s3kHZ .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-7oeqMGPCwI4s3kHZ .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-7oeqMGPCwI4s3kHZ .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-7oeqMGPCwI4s3kHZ .actorPopupMenu{position:absolute;}#mermaid-svg-7oeqMGPCwI4s3kHZ .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-7oeqMGPCwI4s3kHZ .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-7oeqMGPCwI4s3kHZ .actor-man circle,#mermaid-svg-7oeqMGPCwI4s3kHZ line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-7oeqMGPCwI4s3kHZ :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}
用户

   controller 
 
   service 
 
   dao 
 
   数据库 
 
调用接口,进行参数、权限检测。 

调用对应service方法,进行相关业务逻辑处理。 

调用dao数据操作。 

进行数据库操作。 

  用户 

  controller 

  service 

  dao 

  数据库 

2.1 数据添加

  controller接口层通过save方法进行请求,请求后进行参数合法性及权限检测,调用service中的save方法进行数据保存,service层保存数据时自动填充默认数据及相关业务逻辑处理。service处理完毕后调用dao层进行数据库操作,数据库操作完毕后清除相关缓存。

2.2 数据删除

  controller接口层通过delete方法进行请求,请求后进行参数合法性及权限检测,调用service中的delete方法进行数据删除,service层删除数据时自动处理相关业务逻辑。service处理完毕后调用dao层进行数据库操作,数据库操作完毕后清除相关缓存。

2.3 数据修改

  controller接口层通过update方法进行请求,请求后进行参数合法性及权限检测,调用service中的update方法进行数据更新,service层更新数据时自动填充默认数据及相关业务逻辑处理。service处理完毕后调用dao层进行数据库操作。

2.4 分页查询

  controller接口层通过page方法进行请求,请求后进行参数合法性及权限检测,调用service中的page方法进行数据查询,service层调用dao层进行数据库查询数据时自动填充关联数据并进行缓存处理。

2.5 详情查询

  controller接口层通过get方法进行请求,请求后进行参数合法性及权限检测,调用service中的get方法进行数据查询,service层调用dao层进行数据库查询数据时自动填充关联数据并进行缓存处理。

  某些实体只能进行查询,不能进行删除、更新等操作,可以通过只继承Update或VIew相关的基类实现对应功能的控制。


本文转载自: https://blog.csdn.net/m0_37631110/article/details/139587294
版权归原作者 军军君01 所有, 如有侵权,请联系我们删除。

“毕设基于SSM+Vue3实现设备维修管理系统四:后台框架及基础增删改查功能实现”的评论:

还没有评论