自动生成 3张表的代码
This commit is contained in:
8
pom.xml
8
pom.xml
@ -173,6 +173,13 @@
|
|||||||
<artifactId>ruoyi-system</artifactId>
|
<artifactId>ruoyi-system</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 系统模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-bookmark</artifactId>
|
||||||
|
<version>${ruoyi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 通用工具-->
|
<!-- 通用工具-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -191,6 +198,7 @@
|
|||||||
<module>ruoyi-quartz</module>
|
<module>ruoyi-quartz</module>
|
||||||
<module>ruoyi-generator</module>
|
<module>ruoyi-generator</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
|
<module>ruoyi-bookmark</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
@ -72,7 +72,10 @@
|
|||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-bookmark</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.ruoyi.web.controller.bookmark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.sq.domain.SqBookmark;
|
||||||
|
import com.ruoyi.sq.service.ISqBookmarkService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书签Controller
|
||||||
|
*
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2020-07-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bookmark/bookmark")
|
||||||
|
public class SqBookmarkController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISqBookmarkService sqBookmarkService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询书签列表
|
||||||
|
*/
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.SELECT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SqBookmark sqBookmark)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SqBookmark> list = sqBookmarkService.selectSqBookmarkList(sqBookmark);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出书签列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:export')")
|
||||||
|
@Log(title = "书签", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(SqBookmark sqBookmark)
|
||||||
|
{
|
||||||
|
List<SqBookmark> list = sqBookmarkService.selectSqBookmarkList(sqBookmark);
|
||||||
|
ExcelUtil<SqBookmark> util = new ExcelUtil<SqBookmark>(SqBookmark.class);
|
||||||
|
return util.exportExcel(list, "bookmark");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取书签详细信息
|
||||||
|
*/
|
||||||
|
@Log(title = "查询书签信息ID", businessType = BusinessType.SELECT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:query')")
|
||||||
|
@GetMapping(value = "/{bookmarkId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("bookmarkId") Long bookmarkId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(sqBookmarkService.selectSqBookmarkById(bookmarkId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增书签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:add')")
|
||||||
|
@Log(title = "新增书签", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SqBookmark sqBookmark)
|
||||||
|
{
|
||||||
|
return toAjax(sqBookmarkService.insertSqBookmark(sqBookmark));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改书签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:edit')")
|
||||||
|
@Log(title = "修改书签", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SqBookmark sqBookmark)
|
||||||
|
{
|
||||||
|
return toAjax(sqBookmarkService.updateSqBookmark(sqBookmark));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除书签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:bookmark:remove')")
|
||||||
|
@Log(title = "删除书签", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{bookmarkIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] bookmarkIds)
|
||||||
|
{
|
||||||
|
return toAjax(sqBookmarkService.deleteSqBookmarkByIds(bookmarkIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.ruoyi.web.controller.bookmark;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.sq.domain.SqLabel;
|
||||||
|
import com.ruoyi.sq.service.ISqLabelService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书签_标签Controller
|
||||||
|
*
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2020-07-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bookmark/label")
|
||||||
|
public class SqLabelController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISqLabelService sqLabelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询书签_标签列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SqLabel sqLabel)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SqLabel> list = sqLabelService.selectSqLabelList(sqLabel);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出书签_标签列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:export')")
|
||||||
|
@Log(title = "书签_标签", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(SqLabel sqLabel)
|
||||||
|
{
|
||||||
|
List<SqLabel> list = sqLabelService.selectSqLabelList(sqLabel);
|
||||||
|
ExcelUtil<SqLabel> util = new ExcelUtil<SqLabel>(SqLabel.class);
|
||||||
|
return util.exportExcel(list, "label");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取书签_标签详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(sqLabelService.selectSqLabelById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增书签_标签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:add')")
|
||||||
|
@Log(title = "书签_标签", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SqLabel sqLabel)
|
||||||
|
{
|
||||||
|
return toAjax(sqLabelService.insertSqLabel(sqLabel));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改书签_标签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:edit')")
|
||||||
|
@Log(title = "书签_标签", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SqLabel sqLabel)
|
||||||
|
{
|
||||||
|
return toAjax(sqLabelService.updateSqLabel(sqLabel));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除书签_标签
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:label:remove')")
|
||||||
|
@Log(title = "书签_标签", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(sqLabelService.deleteSqLabelByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.ruoyi.web.controller.bookmark;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.sq.domain.SqMenu;
|
||||||
|
import com.ruoyi.sq.service.ISqMenuService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书签_菜单Controller
|
||||||
|
*
|
||||||
|
* @author wanghao
|
||||||
|
* @date 2020-07-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bookmark/menu")
|
||||||
|
public class SqMenuController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISqMenuService sqMenuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询书签_菜单列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SqMenu sqMenu)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SqMenu> list = sqMenuService.selectSqMenuList(sqMenu);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出书签_菜单列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:export')")
|
||||||
|
@Log(title = "书签_菜单", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(SqMenu sqMenu)
|
||||||
|
{
|
||||||
|
List<SqMenu> list = sqMenuService.selectSqMenuList(sqMenu);
|
||||||
|
ExcelUtil<SqMenu> util = new ExcelUtil<SqMenu>(SqMenu.class);
|
||||||
|
return util.exportExcel(list, "menu");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取书签_菜单详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:query')")
|
||||||
|
@GetMapping(value = "/{menuId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("menuId") Long menuId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(sqMenuService.selectSqMenuById(menuId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增书签_菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:add')")
|
||||||
|
@Log(title = "书签_菜单", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SqMenu sqMenu)
|
||||||
|
{
|
||||||
|
return toAjax(sqMenuService.insertSqMenu(sqMenu));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改书签_菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:edit')")
|
||||||
|
@Log(title = "书签_菜单", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SqMenu sqMenu)
|
||||||
|
{
|
||||||
|
return toAjax(sqMenuService.updateSqMenu(sqMenu));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除书签_菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bookmark:menu:remove')")
|
||||||
|
@Log(title = "书签_菜单", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{menuIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] menuIds)
|
||||||
|
{
|
||||||
|
return toAjax(sqMenuService.deleteSqMenuByIds(menuIds));
|
||||||
|
}
|
||||||
|
}
|
@ -84,7 +84,7 @@ token:
|
|||||||
# 令牌密钥
|
# 令牌密钥
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
# 令牌有效期(默认30分钟)
|
# 令牌有效期(默认30分钟)
|
||||||
expireTime: 30
|
expireTime: 300
|
||||||
|
|
||||||
# MyBatis配置
|
# MyBatis配置
|
||||||
mybatis:
|
mybatis:
|
||||||
|
27
ruoyi-bookmark/pom.xml
Normal file
27
ruoyi-bookmark/pom.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>ruoyi</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-bookmark</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
bookmark系统模块
|
||||||
|
</description>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -7,6 +7,10 @@ package com.ruoyi.common.enums;
|
|||||||
*/
|
*/
|
||||||
public enum BusinessType
|
public enum BusinessType
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
SELECT,
|
||||||
/**
|
/**
|
||||||
* 其它
|
* 其它
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user