自动生成 3张表的代码
This commit is contained in:
		| @@ -1,14 +1,17 @@ | ||||
| package com.ruoyi; | ||||
|  | ||||
| import org.mybatis.spring.annotation.MapperScan; | ||||
| import org.springframework.boot.SpringApplication; | ||||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||
| import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | ||||
| import org.springframework.context.annotation.ComponentScan; | ||||
|  | ||||
| /** | ||||
|  * 启动程序 | ||||
|  *  | ||||
|  * @author ruoyi | ||||
|  */ | ||||
|  | ||||
| @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) | ||||
| 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)); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user