DAY_01作业内容
parent
c28bb19733
commit
0d2c933966
|
@ -46,6 +46,11 @@
|
||||||
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
|
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.csp</groupId>
|
||||||
|
<artifactId>sentinel-transport-simple-http</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Sentinel Datasource Nacos -->
|
<!-- Sentinel Datasource Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.csp</groupId>
|
<groupId>com.alibaba.csp</groupId>
|
||||||
|
|
|
@ -28,7 +28,8 @@ spring:
|
||||||
eager: true
|
eager: true
|
||||||
transport:
|
transport:
|
||||||
# 控制台地址
|
# 控制台地址
|
||||||
dashboard: 43.142.44.217:8718
|
dashboard: 43.142.44.217:8858
|
||||||
|
client-ip: 127.0.0.1
|
||||||
# nacos配置持久化
|
# nacos配置持久化
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
|
|
|
@ -35,6 +35,17 @@
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Sentinel Datasource Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.csp</groupId>
|
||||||
|
<artifactId>sentinel-datasource-nacos</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.csp</groupId>
|
||||||
|
<artifactId>sentinel-transport-simple-http</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot Actuator -->
|
<!-- SpringBoot Actuator -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -78,6 +89,7 @@
|
||||||
<artifactId>muyu-common-swagger</artifactId>
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -3,6 +3,9 @@ package com.muyu.system.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.muyu.common.security.auth.AuthUtil;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
@ -38,11 +41,14 @@ public class BookInfoController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 查询【请填写功能名称】列表
|
* 查询【请填写功能名称】列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:list")
|
@RequiresPermissions("system:book:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<BookInfo>> list(BookInfo bookInfo)
|
public Result<TableDataInfo<BookInfo>> list(BookInfo bookInfo)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
|
if (!AuthUtil.hasRole("admin")){
|
||||||
|
bookInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
}
|
||||||
List<BookInfo> list = bookInfoService.selectBookInfoList(bookInfo);
|
List<BookInfo> list = bookInfoService.selectBookInfoList(bookInfo);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +56,7 @@ public class BookInfoController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 导出【请填写功能名称】列表
|
* 导出【请填写功能名称】列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:export")
|
@RequiresPermissions("system:book:list")
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, BookInfo bookInfo)
|
public void export(HttpServletResponse response, BookInfo bookInfo)
|
||||||
|
@ -63,7 +69,7 @@ public class BookInfoController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 获取【请填写功能名称】详细信息
|
* 获取【请填写功能名称】详细信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:query")
|
@RequiresPermissions("system:book:list")
|
||||||
@GetMapping(value = "/{bid}")
|
@GetMapping(value = "/{bid}")
|
||||||
public Result getInfo(@PathVariable("bid") Long bid)
|
public Result getInfo(@PathVariable("bid") Long bid)
|
||||||
{
|
{
|
||||||
|
@ -73,29 +79,31 @@ public class BookInfoController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 新增【请填写功能名称】
|
* 新增【请填写功能名称】
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:add")
|
@RequiresPermissions("system:book:list")
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody BookInfo bookInfo)
|
public Result add(@RequestBody BookInfo bookInfo)
|
||||||
{
|
{
|
||||||
|
bookInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(bookInfoService.insertBookInfo(bookInfo));
|
return toAjax(bookInfoService.insertBookInfo(bookInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改【请填写功能名称】
|
* 修改【请填写功能名称】
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:edit")
|
@RequiresPermissions("system:book:list")
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result edit(@RequestBody BookInfo bookInfo)
|
public Result edit(@RequestBody BookInfo bookInfo)
|
||||||
{
|
{
|
||||||
|
bookInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(bookInfoService.updateBookInfo(bookInfo));
|
return toAjax(bookInfoService.updateBookInfo(bookInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除【请填写功能名称】
|
* 删除【请填写功能名称】
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:info:remove")
|
@RequiresPermissions("system:book:list")
|
||||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{bids}")
|
@DeleteMapping("/{bids}")
|
||||||
public Result remove(@PathVariable Long[] bids)
|
public Result remove(@PathVariable Long[] bids)
|
||||||
|
|
|
@ -11,6 +11,14 @@ spring:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
|
sentinel:
|
||||||
|
# 取消控制台懒加载
|
||||||
|
eager: true
|
||||||
|
transport:
|
||||||
|
# 控制台地址
|
||||||
|
dashboard: 43.142.44.217:8858
|
||||||
|
client-ip: 127.0.0.1
|
||||||
|
port: 8721
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
<select id="selectBookInfoList" parameterType="com.muyu.system.domain.BookInfo" resultMap="BookInfoResult">
|
<select id="selectBookInfoList" parameterType="com.muyu.system.domain.BookInfo" resultMap="BookInfoResult">
|
||||||
<include refid="selectBookInfoVo"/>
|
<include refid="selectBookInfoVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
|
||||||
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
|
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
|
||||||
<if test="author != null and author != ''"> and author = #{author}</if>
|
<if test="author != null and author != ''"> and author = #{author}</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
|
|
|
@ -22,4 +22,5 @@
|
||||||
muyu-modules业务模块
|
muyu-modules业务模块
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue