Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
d6c0538b01 | |
|
9100c76db4 | |
|
a5f16646d4 | |
|
11871c4b02 | |
|
cd8a13e2d9 | |
|
9c612b837c |
|
@ -52,6 +52,7 @@
|
|||
<artifactId>muyu-common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -24,7 +24,7 @@ public class CacheConstants {
|
|||
/**
|
||||
* 密码锁定时间,默认10(分钟)
|
||||
*/
|
||||
public final static long PASSWORD_LOCK_TIME = 10;
|
||||
public final static long PASSWORD_LOCK_TIME = 3;
|
||||
|
||||
/**
|
||||
* 权限缓存前缀
|
||||
|
|
|
@ -88,6 +88,12 @@
|
|||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-core</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -28,12 +28,12 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:8718
|
||||
dashboard: 127.0.0.1:8900
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-product-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--系统核心包-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-product-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-product-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- sentinel流量监控-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-core</artifactId>
|
||||
<version>1.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-annotation-aspectj</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuYuProductApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuProductApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,28 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9202
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-product
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,30 @@
|
|||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-product</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>muyu-product-common</module>
|
||||
<module>muyu-product-remote</module>
|
||||
<module>muyu-product-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<description>
|
||||
muyu-product商品模块
|
||||
</description>
|
||||
|
||||
</project>
|
|
@ -78,6 +78,16 @@
|
|||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- sentinel流量监控-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-core</artifactId>
|
||||
<version>1.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-annotation-aspectj</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.domain.BookInfo;
|
||||
import com.muyu.system.service.IBookInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 书籍Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class BookInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBookInfoService bookInfoService;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<BookInfo>> list(BookInfo bookInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BookInfo> list = bookInfoService.selectBookInfoList(bookInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出导出列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:export")
|
||||
@Log(title = "导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BookInfo bookInfo)
|
||||
{
|
||||
List<BookInfo> list = bookInfoService.selectBookInfoList(bookInfo);
|
||||
ExcelUtil<BookInfo> util = new ExcelUtil<BookInfo>(BookInfo.class);
|
||||
util.exportExcel(response, list, "bookInfo数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取书籍详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bookInfoService.selectBookInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增bookInfo
|
||||
*/
|
||||
@RequiresPermissions("system:info:add")
|
||||
@Log(title = "书籍添加", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody BookInfo bookInfo)
|
||||
{
|
||||
return toAjax(bookInfoService.insertBookInfo(bookInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequiresPermissions("system:info:edit")
|
||||
@Log(title = "书记修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody BookInfo bookInfo)
|
||||
{
|
||||
return toAjax(bookInfoService.updateBookInfo(bookInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequiresPermissions("system:info:remove")
|
||||
@Log(title = "书记修改", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bookInfoService.deleteBookInfoByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName BookInfo
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/2/22/0022 20:01
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("book_info")
|
||||
public class BookInfo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Excel(name="编号", cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId(type = IdType.AUTO)
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
@Excel(name="作者")
|
||||
private String author;
|
||||
|
||||
|
||||
/**
|
||||
* 书名
|
||||
*/
|
||||
@Excel(name="书名")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 书名
|
||||
*/
|
||||
@Excel(name="书名")
|
||||
private String remak;
|
||||
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型", readConverterExp = "1=名著,2=小说")
|
||||
private String type;
|
||||
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
@Excel(name="图片上传")
|
||||
private String images;
|
||||
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
@Excel(name="描述信息")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 上架时间
|
||||
*/
|
||||
@Excel(name="上架时间")
|
||||
private String grounding;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name="说明")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name="创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:dd:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Excel(name="修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:dd:ss",timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Excel(name="修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:dd:ss",timezone = "GMT+8")
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Excel(name="修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:dd:ss",timezone = "GMT+8")
|
||||
private Date endTime;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.BookInfo;
|
||||
|
||||
/**
|
||||
* Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-02-23
|
||||
*/
|
||||
public interface BookInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
public BookInfo selectBookInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param bookInfo
|
||||
* @return 集合
|
||||
*/
|
||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBookInfo(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBookInfo(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBookInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBookInfoByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.system.domain.BookInfo;
|
||||
|
||||
/**
|
||||
* bookInfoService接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-02-23
|
||||
*/
|
||||
public interface IBookInfoService
|
||||
{
|
||||
/**
|
||||
* 查询bookInfo
|
||||
*
|
||||
* @param id bookInfo主键
|
||||
* @return bookInfo
|
||||
*/
|
||||
public BookInfo selectBookInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询bookInfo列表
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return bookInfo集合
|
||||
*/
|
||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 新增bookInfo
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBookInfo(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 修改bookInfo
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBookInfo(BookInfo bookInfo);
|
||||
|
||||
/**
|
||||
* 批量删除bookInfo
|
||||
*
|
||||
* @param ids 需要删除的bookInfo主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBookInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除bookInfo信息
|
||||
*
|
||||
* @param id bookInfo主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBookInfoById(Long id);
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import com.alibaba.csp.sentinel.EntryType;
|
||||
import com.alibaba.csp.sentinel.annotation.SentinelResource;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.system.domain.BookInfo;
|
||||
import com.muyu.system.mapper.BookInfoMapper;
|
||||
import com.muyu.system.service.IBookInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* bookInfoService业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BookInfoServiceImpl implements IBookInfoService {
|
||||
@Autowired
|
||||
private BookInfoMapper bookInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询bookInfo
|
||||
*
|
||||
* @param id bookInfo主键
|
||||
* @return bookInfo
|
||||
*/
|
||||
@Override
|
||||
public BookInfo selectBookInfoById(Long id) {
|
||||
return bookInfoMapper.selectBookInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询bookInfo列表
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return bookInfo
|
||||
*/
|
||||
@Override
|
||||
@SentinelResource(value = "selectBookInfoList", entryType = EntryType.IN)
|
||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo) {
|
||||
bookInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
return bookInfoMapper.selectBookInfoList(bookInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增bookInfo
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBookInfo(BookInfo bookInfo) {
|
||||
bookInfo.setCreateTime(DateUtils.getNowDate());
|
||||
bookInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
return bookInfoMapper.insertBookInfo(bookInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改bookInfo
|
||||
*
|
||||
* @param bookInfo bookInfo
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBookInfo(BookInfo bookInfo) {
|
||||
bookInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
bookInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
return bookInfoMapper.updateBookInfo(bookInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除bookInfo
|
||||
*
|
||||
* @param ids 需要删除的bookInfo主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBookInfoByIds(Long[] ids) {
|
||||
return bookInfoMapper.deleteBookInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除bookInfo信息
|
||||
*
|
||||
* @param id bookInfo主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBookInfoById(Long id) {
|
||||
return bookInfoMapper.deleteBookInfoById(id);
|
||||
}
|
||||
}
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.BookInfoMapper">
|
||||
|
||||
<resultMap type="com.muyu.system.domain.BookInfo" id="BookInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="author" column="author" />
|
||||
<result property="type" column="type" />
|
||||
<result property="images" column="images" />
|
||||
<result property="remak" column="remak" />
|
||||
<result property="content" column="content" />
|
||||
<result property="grounding" column="grounding" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBookInfoVo">
|
||||
select id, title, author, type, images, remak, content, grounding, create_by, create_time, update_time, update_by from book_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBookInfoList" parameterType="com.muyu.system.domain.BookInfo" resultMap="BookInfoResult">
|
||||
<include refid="selectBookInfoVo"/>
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="author != null and author != ''"> and author = #{author}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||
<if test="createBy != null and createBy != '' and createBy != 'admin'"> and create_by = #{createBy}</if>
|
||||
<if test="remak != null and remak != ''"> and remak = #{remak}</if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="grounding != null and grounding != ''"> and grounding = #{grounding}</if>
|
||||
<if test="beginTime != null "> and grounding > #{beginTime}</if>
|
||||
<if test="endTime != null "> and grounding lt; #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBookInfoById" parameterType="Long" resultMap="BookInfoResult">
|
||||
<include refid="selectBookInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBookInfo" parameterType="com.muyu.system.domain.BookInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into book_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="author != null and author != ''">author,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="images != null and images != ''">images,</if>
|
||||
<if test="remak != null">remak,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="grounding != null and grounding != ''">grounding,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="author != null and author != ''">#{author},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="images != null and images != ''">#{images},</if>
|
||||
<if test="remak != null">#{remak},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="grounding != null and grounding != ''">#{grounding},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBookInfo" parameterType="com.muyu.system.domain.BookInfo">
|
||||
update book_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="author != null and author != ''">author = #{author},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="images != null and images != ''">images = #{images},</if>
|
||||
<if test="remak != null">remak = #{remak},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="grounding != null and grounding != ''">grounding = #{grounding},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = now(),</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBookInfoById" parameterType="Long">
|
||||
delete from book_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBookInfoByIds" parameterType="String">
|
||||
delete from book_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -13,6 +13,7 @@
|
|||
<module>muyu-gen</module>
|
||||
<module>muyu-job</module>
|
||||
<module>muyu-file</module>
|
||||
<module>muyu-product</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 43.142.100.73:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
14
pom.xml
14
pom.xml
|
@ -206,6 +206,20 @@
|
|||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-remote</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
Loading…
Reference in New Issue