Compare commits

...

6 Commits

Author SHA1 Message Date
Saisai Liu d6c0538b01 区间查询,创建product项目 2024-02-27 08:28:51 +08:00
Saisai Liu 9100c76db4 区间查询,sentinel卫兵链接服务器 2024-02-26 09:15:48 +08:00
Saisai Liu a5f16646d4 book单表 2024-02-25 20:46:27 +08:00
Saisai Liu 11871c4b02 book单表 2024-02-25 11:09:17 +08:00
Saisai Liu cd8a13e2d9 book单表 2024-02-23 21:26:11 +08:00
Saisai Liu 9c612b837c book单表 2024-02-23 16:17:24 +08:00
30 changed files with 925 additions and 17 deletions

View File

@ -52,6 +52,7 @@
<artifactId>muyu-common-security</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -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
# 共享配置

View File

@ -24,7 +24,7 @@ public class CacheConstants {
/**
* 10
*/
public final static long PASSWORD_LOCK_TIME = 10;
public final static long PASSWORD_LOCK_TIME = 3;
/**
*

View File

@ -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>

View File

@ -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

View File

@ -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
# 共享配置

View File

@ -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>

View File

@ -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
# 共享配置

View File

@ -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
# 共享配置

View 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">
<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>

View File

@ -0,0 +1,7 @@
package com.muyu;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -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>

View File

@ -0,0 +1,7 @@
package com.muyu;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -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>

View File

@ -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);
}
}

View File

@ -0,0 +1,2 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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));
}
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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
# 共享配置

View File

@ -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>

View File

@ -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>

View File

@ -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
View File

@ -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>