当前位置: 首页 > news >正文

总算把网站设计好了垫江网站建设报价

总算把网站设计好了,垫江网站建设报价,常规网站建设价格实惠,深圳个人网站制作文章目录 说明流程增加依赖修改配置文件注释掉MybatisConfig里面的Bean 代码生成使用IDEA生成代码注意 Controller文件 说明 若依管理系统是一个非常完善的管理系统模板#xff0c;里面含有代码生成的方法#xff0c;可以帮助用户快速进行开发#xff0c;但是项目使用的是m… 文章目录 说明流程增加依赖修改配置文件注释掉MybatisConfig里面的Bean 代码生成使用IDEA生成代码注意 Controller文件 说明 若依管理系统是一个非常完善的管理系统模板里面含有代码生成的方法可以帮助用户快速进行开发但是项目使用的是mybatis对于熟悉使用mybatis-plus进行开发的小伙伴们不是很便捷本文主要讲解如何在不影响系统现有功能的基础上将mybatis升级为mybatis-plus以帮助小伙伴们更快速地开发。 流程 增加依赖 【首先修改父模块的pom.xml文件】 分别在properties标签内和dependencies标签内增加内容所需增加的内容如下面的xml propertiesmybatis-plus.version3.2.0/mybatis-plus.version/properties!-- 依赖声明 --dependencyManagementdependencies!-- mybatis-plus --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion${mybatis-plus.version}/version/dependency/dependencies/dependencyManagement【其次修改common包下的pom.xml文件】 直接在dependencies标签内增加如下内容即可因为父模块已经管理了版本这里不需要再声明版本 dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactId/dependency修改配置文件 需要修改admin包下的application.yml文件 注释掉mybatis的配置之后mybatis-plus是兼容mybatis的小伙伴们放心注释就行增加mybatis-plus的配置配置如下 mybatis-plus:mapper-locations: classpath*:mapper/**/*Mapper.xmltype-aliases-package: com.ruoyi.**.domainglobal-config:db-config:id-type: autoconfiguration:map-underscore-to-camel-case: truecache-enabled: falselog-impl: org.apache.ibatis.logging.stdout.StdOutImpl注释掉MybatisConfig里面的Bean 系统会自动根据配置文件构建mybatisplus相关的Bean所以这里也不需要修改成mybatis-plus的 修改之后记得重新 install framework包这样修改才会生效 代码生成 上面的操作虽然是将mybatis-plus引入了但是有小伙伴疑问了使用若依管理系统自带的代码生成器生成的还是mybatis的代码呀那怎么办呢 为了解决小伙伴们心中的疑惑我这里提供一种解决思路那就是结合IDEA生成的代码和若依代码生成器的代码。 使用IDEA生成代码 首先安装下面的插件记得安装1.5.5版本的插件高版本的插件可能会有问题我之前是安装的高版本出问题之后才回退的具体安装可以去阅读其他博主的教程 生成成功由下图可知除了controller外其他代码都已经生成成功 注意 使用MybatisX生成的实体类是没有逻辑删除等注解的如果需要使用逻辑删除或者自动填充ID和时间需要在实体类上面添加注解 Controller文件 Controller文件直接使用若依的代码生成器生成即可使用这种方式生成的好处是若依会生成对应的前端文件这样可以直接搭配使用不需要再去修改生成的api 虽然若依生成器生成了Controller代码但是没办法直接将其进行应用因为我们前面生成的Service文件使用的是mybatis-plus所以还需要对Controller文件进行修改修改的方式可以参考我下面的代码当然这个代码还是非常不完善的比如数据校验那些都没有 package com.shm.controller;import java.util.List; import javax.servlet.http.HttpServletResponse;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.domain.entity.Follow; import com.ruoyi.common.core.domain.model.LoginUser; 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.shm.service.IFollowService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo;/*** 关注Controller** author dam* date 2023-08-08*/ RestController RequestMapping(/market/follow) public class FollowController extends BaseController {Autowiredprivate IFollowService followService;/*** 查询关注列表*/PreAuthorize(ss.hasPermi(shm:follow:list))GetMapping(/list)public TableDataInfo list(Follow follow) {startPage();ListFollow list followService.list(new QueryWrapperFollow(follow));return getDataTable(list);}/*** 导出关注列表*/PreAuthorize(ss.hasPermi(shm:follow:export))Log(title 关注, businessType BusinessType.EXPORT)PostMapping(/export)public void export(HttpServletResponse response, Follow follow) {ListFollow list followService.list(new QueryWrapperFollow(follow));ExcelUtilFollow util new ExcelUtilFollow(Follow.class);util.exportExcel(response, list, 关注数据);}/*** 获取关注详细信息*/PreAuthorize(ss.hasPermi(shm:follow:query))GetMapping(value /{id})public AjaxResult getInfo(PathVariable(id) Long id) {return success(followService.getById(id));}/*** 新增关注*/PreAuthorize(ss.hasPermi(shm:follow:add))Log(title 关注, businessType BusinessType.INSERT)PostMappingpublic AjaxResult add(RequestBody Follow follow) {// 设置商品主人LoginUser loginUser getLoginUser();follow.setFollowerId(loginUser.getUserId());return toAjax(followService.save(follow));}/*** 修改关注*/PreAuthorize(ss.hasPermi(shm:follow:edit))Log(title 关注, businessType BusinessType.UPDATE)PutMappingpublic AjaxResult edit(RequestBody Follow follow) {return toAjax(followService.updateById(follow));}/*** 删除关注*/PreAuthorize(ss.hasPermi(shm:follow:remove))Log(title 关注, businessType BusinessType.DELETE)DeleteMapping(/{ids})public AjaxResult remove(PathVariable ListLong ids) {return toAjax(followService.removeByIds(ids));} }
http://www.hkea.cn/news/14354810/

相关文章:

  • 做电商网站的步骤家装企业网站系统下载
  • 福建建设银行招聘网站js网站文字重叠
  • 酒店网站开发合同范本广州网站开发多少钱
  • 网站建设流程图片旅游网站建设的目标是什么意思
  • 品牌设计就业前景怎么样重庆seo什么意思
  • 怎么建设一个自己的网站首页郑州的团购网站建设
  • wordpress网站建设要钱吗织梦网站后台使用说明书
  • 做分享网站广西城乡建设厅官网
  • 商务网站开发与建设东莞市网站公司
  • 保定学校网站建设wordpress的mime类型
  • 赣州网站建设联系方式做风控的网站
  • html5制作网站开发centos 安装 wordpress
  • 低价自适应网站建设河间专业做网站电话
  • 手机网站的好外已备案个人网站做淘宝客
  • 学院的网站建设的意义同人那个小说网站做的最好
  • 厦门网站专业建设长沙网站建设王道下拉惠
  • 响应式网站企业沧州市做网站价格
  • 网站建设指导沈阳做企业网站哪家好
  • 上海做网站多少费用宁夏网站建设费用
  • 网站是一个链接的页面结合吗网站的运营模式
  • 网站开发培训光山上海全网营销推广
  • 织梦网站怎样入侵域名注册的网站
  • 重庆公司免费网站建设设计一个企业网站多少钱
  • 海南省住房和城乡建设厅官方网站建设工程合同可以约定仲裁管辖吗
  • 装修的网站 天堂资源地址在线官网
  • 010网站建设国内漂亮网站欣赏
  • 网站加载百度地图哪个网站财经做的最好
  • 网站推广业务企业建站公司流程
  • 首都在线官网网站零件加工网
  • 集约化网站建设的函网站规划与栏目结构诊断