init
This commit is contained in:
3
sl-express-ms-user-service/.gitignore
vendored
Normal file
3
sl-express-ms-user-service/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.idea
|
||||
target/
|
||||
*.iml
|
||||
13
sl-express-ms-user-service/Dockerfile
Normal file
13
sl-express-ms-user-service/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM openjdk:11-jdk
|
||||
LABEL maintainer="研究院研发组 <research@itcast.cn>"
|
||||
|
||||
# 时区修改为东八区
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
WORKDIR /app
|
||||
ARG JAR_FILE=target/*.jar
|
||||
ADD ${JAR_FILE} app.jar
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -jar $JAVA_OPTS app.jar"]
|
||||
13
sl-express-ms-user-service/README.md
Normal file
13
sl-express-ms-user-service/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# sl-express-user使用手册
|
||||
|
||||
## 1、说明
|
||||
|
||||
user服务主要用于客户(下单用户)数据,地址薄数据记录,
|
||||
主要功能:
|
||||
|
||||
- 提供地址簿功能,可以设置默认地址簿。
|
||||
- 提供用户功能,存储了包括微信绑定信息,身份信息,名称,电话等。
|
||||
|
||||
|
||||
|
||||
|
||||
90
sl-express-ms-user-service/pom.xml
Normal file
90
sl-express-ms-user-service/pom.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?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>
|
||||
<groupId>com.sl-express</groupId>
|
||||
<artifactId>sl-express-parent</artifactId>
|
||||
<version>1.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.sl-express.ms.user</groupId>
|
||||
<artifactId>sl-express-ms-user-service</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<description>用户微服务</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<sl-express-common.version>1.2-SNAPSHOT</sl-express-common.version>
|
||||
<sl-express-user-domain.version>1.1-SNAPSHOT</sl-express-user-domain.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sl-express.common</groupId>
|
||||
<artifactId>sl-express-common</artifactId>
|
||||
<version>${sl-express-common.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sl-express.ms.user</groupId>
|
||||
<artifactId>sl-express-ms-user-domain</artifactId>
|
||||
<version>${sl-express-user-domain.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!--指定主类-->
|
||||
<mainClass>com.sl.UserApplication</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.sl;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class UserApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UserApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.sl.ms.user.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sl.ms.user.domain.dto.AddressBookDTO;
|
||||
import com.sl.ms.user.domain.enums.AddressBookShowStatus;
|
||||
import com.sl.ms.user.entity.AddressBookEntity;
|
||||
import com.sl.ms.user.service.AddressBookService;
|
||||
import com.sl.transport.common.util.PageResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 地址簿
|
||||
*/
|
||||
@Api(tags = "地址簿")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("addressBook")
|
||||
public class AddressBookController {
|
||||
|
||||
@Resource
|
||||
private AddressBookService addressBookService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 页码
|
||||
* @param pageSize 页大小
|
||||
* @param userId 用户ID
|
||||
* @return 地址簿
|
||||
*/
|
||||
@ApiOperation(value = "地址簿分页查询")
|
||||
@GetMapping("page")
|
||||
public PageResponse<AddressBookEntity> page(Integer page, Integer pageSize, Long userId, String keyword, Integer type) {
|
||||
Page<AddressBookEntity> iPage = new Page<>(page, pageSize);
|
||||
Page<AddressBookEntity> pageResult = addressBookService.lambdaQuery()
|
||||
// 用户ID
|
||||
.eq(ObjectUtil.isNotEmpty(userId), AddressBookEntity::getUserId, userId)
|
||||
// 地址薄类型
|
||||
.eq(ObjectUtil.isNotEmpty(type), AddressBookEntity::getType, type)
|
||||
// 是否展示 不同步地址薄的下单地址不展示
|
||||
.eq(AddressBookEntity::getIsShow, AddressBookShowStatus.SHOW_STATUS.getCode())
|
||||
// 其他关键词
|
||||
.and(StrUtil.isNotEmpty(keyword), wrapper ->
|
||||
wrapper.like(AddressBookEntity::getName, keyword).or()
|
||||
.like(AddressBookEntity::getPhoneNumber, keyword).or()
|
||||
.like(AddressBookEntity::getCompanyName, keyword))
|
||||
.orderByDesc(AddressBookEntity::getCreated)
|
||||
.page(iPage);
|
||||
|
||||
return PageResponse.<AddressBookEntity>builder()
|
||||
.items(pageResult.getRecords())
|
||||
.page(page)
|
||||
.pageSize(pageSize)
|
||||
.pages(pageResult.getPages())
|
||||
.counts(pageResult.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param dto 地址簿
|
||||
* @return 地址簿
|
||||
*/
|
||||
@ApiOperation(value = "新增")
|
||||
@PostMapping
|
||||
public AddressBookDTO save(@Valid @RequestBody AddressBookDTO dto) {
|
||||
AddressBookEntity entity = BeanUtil.toBean(dto, AddressBookEntity.class);
|
||||
if (1 == entity.getIsDefault()) {
|
||||
addressBookService.lambdaUpdate()
|
||||
.set(AddressBookEntity::getIsDefault, 0)
|
||||
.eq(AddressBookEntity::getUserId, entity.getUserId())
|
||||
.update();
|
||||
}
|
||||
addressBookService.save(entity);
|
||||
return BeanUtil.toBean(entity, AddressBookDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param id 地址簿ID
|
||||
* @param dto 地址簿
|
||||
* @return 地址簿
|
||||
*/
|
||||
@ApiOperation(value = "修改")
|
||||
@PutMapping("/{id}")
|
||||
public AddressBookDTO update(@PathVariable(name = "id") Long id, @RequestBody AddressBookDTO dto) {
|
||||
AddressBookEntity entity = BeanUtil.toBean(dto, AddressBookEntity.class);
|
||||
entity.setId(id);
|
||||
if (1 == entity.getIsDefault()) {
|
||||
addressBookService.lambdaUpdate()
|
||||
.set(AddressBookEntity::getIsDefault, 0)
|
||||
.eq(AddressBookEntity::getUserId, entity.getUserId())
|
||||
.update();
|
||||
}
|
||||
addressBookService.updateById(entity);
|
||||
return BeanUtil.toBean(entity, AddressBookDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 地址簿ID
|
||||
*/
|
||||
@ApiOperation(value = "删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public void del(@PathVariable(name = "id") Long id) {
|
||||
addressBookService.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id 地址簿ID
|
||||
* @return 地址簿
|
||||
*/
|
||||
@ApiOperation(value = "明细")
|
||||
@ApiImplicitParam(name = "id", value = "主键", required = true)
|
||||
@GetMapping("detail/{id}")
|
||||
public AddressBookDTO detail(@PathVariable(name = "id") Long id) {
|
||||
AddressBookEntity entity = addressBookService.getById(id);
|
||||
return BeanUtil.toBean(entity, AddressBookDTO.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.sl.ms.user.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sl.ms.user.domain.dto.MemberDTO;
|
||||
import com.sl.ms.user.entity.MemberEntity;
|
||||
import com.sl.ms.user.service.MemberService;
|
||||
import com.sl.transport.common.util.PageResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
*/
|
||||
@Api(tags = "用户")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("member")
|
||||
public class MemberController {
|
||||
|
||||
@Resource
|
||||
private MemberService memberService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("page")
|
||||
public PageResponse<MemberEntity> page(Integer page, Integer pageSize) {
|
||||
Page<MemberEntity> iPage = new Page(page, pageSize);
|
||||
LambdaQueryWrapper<MemberEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<MemberEntity> pageResult = memberService.page(iPage, queryWrapper);
|
||||
|
||||
return PageResponse.<MemberEntity>builder()
|
||||
.items(pageResult.getRecords())
|
||||
.page(page)
|
||||
.pageSize(pageSize)
|
||||
.pages(pageResult.getPages())
|
||||
.counts(pageResult.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "新增")
|
||||
@PostMapping
|
||||
public void save(@RequestBody MemberDTO dto) {
|
||||
MemberEntity entity = BeanUtil.toBean(dto, MemberEntity.class);
|
||||
memberService.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param id
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "更新个人信息")
|
||||
@PutMapping("/{id}")
|
||||
public void update(@PathVariable(name = "id") Long id, @RequestBody MemberDTO dto) {
|
||||
MemberEntity entity = BeanUtil.toBean(dto, MemberEntity.class);
|
||||
entity.setId(id);
|
||||
memberService.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "解除我的信息")
|
||||
@DeleteMapping("/{id}")
|
||||
public void del(@PathVariable(name = "id") Long id) {
|
||||
memberService.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "详情")
|
||||
@GetMapping("detail/{id}")
|
||||
public MemberDTO detail(@PathVariable(name = "id") Long id) {
|
||||
MemberEntity entity = memberService.getById(id);
|
||||
return BeanUtil.toBean(entity, MemberDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "详情 -openId")
|
||||
@GetMapping("openId/{openId}")
|
||||
MemberDTO detailByOpenId(@PathVariable(name = "openId") String openId) {
|
||||
MemberEntity one = memberService.getOne(Wrappers.<MemberEntity>lambdaQuery().eq(MemberEntity::getOpenId, openId));
|
||||
return BeanUtil.toBean(one, MemberDTO.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.sl.ms.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sl.transport.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 地址簿
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sl_address_book")
|
||||
public class AddressBookEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
@NotNull(message = "名字不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotNull(message = "手机号不能为空")
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 分机号
|
||||
*/
|
||||
private String extensionNumber;
|
||||
/**
|
||||
* 省id
|
||||
*/
|
||||
private Long provinceId;
|
||||
/**
|
||||
* 市id
|
||||
*/
|
||||
private Long cityId;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Long countyId;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
* 是否默认地址 1是 0否
|
||||
*/
|
||||
private Integer isDefault;
|
||||
|
||||
/**
|
||||
* 是否展示 1展示 0 不展示
|
||||
*/
|
||||
private Integer isShow;
|
||||
|
||||
/**
|
||||
* 地址簿类型 1寄件 2收件
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.sl.ms.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sl.transport.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sl_member")
|
||||
public class MemberEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 认证id
|
||||
*/
|
||||
private String authId;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCardNo;
|
||||
/**
|
||||
* 身份证号是否认证 1认证
|
||||
*/
|
||||
private Integer idCardNoVerify;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 微信openID
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private String birthday;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.sl.ms.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sl.ms.user.entity.AddressBookEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 地址簿 Mapper 接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface AddressBookMapper extends BaseMapper<AddressBookEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.sl.ms.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sl.ms.user.entity.MemberEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户表 Mapper 接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberMapper extends BaseMapper<MemberEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sl.ms.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sl.ms.user.entity.AddressBookEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 用户表 服务类
|
||||
*/
|
||||
public interface AddressBookService extends IService<AddressBookEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sl.ms.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sl.ms.user.entity.MemberEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 用户表 服务类
|
||||
*/
|
||||
public interface MemberService extends IService<MemberEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.sl.ms.user.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sl.ms.user.entity.AddressBookEntity;
|
||||
import com.sl.ms.user.mapper.AddressBookMapper;
|
||||
import com.sl.ms.user.service.AddressBookService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 用户表 服务类实现
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AddressBookServiceImpl extends ServiceImpl<AddressBookMapper, AddressBookEntity>
|
||||
implements AddressBookService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.sl.ms.user.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sl.ms.user.entity.MemberEntity;
|
||||
import com.sl.ms.user.mapper.MemberMapper;
|
||||
import com.sl.ms.user.service.MemberService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 用户表 服务类实现
|
||||
*/
|
||||
@Service
|
||||
public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberEntity>
|
||||
implements MemberService {
|
||||
|
||||
}
|
||||
7
sl-express-ms-user-service/src/main/resources/banner.txt
Normal file
7
sl-express-ms-user-service/src/main/resources/banner.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
_ ${spring.application.name} ${application.version}
|
||||
___ | | ___ __ __ _ __ _ __ ___ ___ ___ Port: ${server.port}
|
||||
/ __|| | _____ / _ \\ \/ /| '_ \ | '__|/ _ \/ __|/ __| Pid: ${pid} Profile(s): ${AnsiColor.GREEN}${spring.profiles.active}${AnsiColor.DEFAULT}
|
||||
\__ \| ||_____|| __/ > < | |_) || | | __/\__ \\__ \
|
||||
|___/|_| \___|/_/\_\| .__/ |_| \___||___/|___/ https://sl-express.itheima.net/
|
||||
|_|
|
||||
@@ -0,0 +1,25 @@
|
||||
server:
|
||||
port: 18084
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
max: 1000
|
||||
min-spare: 30
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.150.101:8848
|
||||
discovery:
|
||||
namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
|
||||
ip: 192.168.150.1
|
||||
config:
|
||||
namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
|
||||
shared-configs: #共享配置
|
||||
- data-id: shared-spring-mysql.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-mybatis-plus.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,24 @@
|
||||
server:
|
||||
port: 18084
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
max: 1000
|
||||
min-spare: 30
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: vO5/dZ9,iL
|
||||
server-addr: nacos-service.yjy-public-slwl-java-prod.svc.cluster.local:8848
|
||||
discovery:
|
||||
namespace: 92312ba8-1119-440f-81af-c29618df303b
|
||||
config:
|
||||
namespace: 92312ba8-1119-440f-81af-c29618df303b
|
||||
shared-configs: #共享配置
|
||||
- data-id: shared-spring-mysql.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-mybatis-plus.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,24 @@
|
||||
server:
|
||||
port: 18084
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
max: 1000
|
||||
min-spare: 30
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.150.101:8848
|
||||
discovery:
|
||||
namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
|
||||
config:
|
||||
namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
|
||||
shared-configs: #共享配置
|
||||
- data-id: shared-spring-mysql.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-mybatis-plus.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,24 @@
|
||||
server:
|
||||
port: 18084
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
max: 1000
|
||||
min-spare: 30
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: nacos-service.yjy-public-slwl-java.svc.cluster.local:8848
|
||||
discovery:
|
||||
namespace: 92312ba8-1119-440f-81af-c29618df303b
|
||||
config:
|
||||
namespace: 92312ba8-1119-440f-81af-c29618df303b
|
||||
shared-configs: #共享配置
|
||||
- data-id: shared-spring-mysql.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-mybatis-plus.yml
|
||||
group: SHARED_GROUP
|
||||
refresh: false
|
||||
23
sl-express-ms-user-service/src/main/resources/bootstrap.yml
Normal file
23
sl-express-ms-user-service/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
application:
|
||||
version: v1.0
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
spring:
|
||||
application:
|
||||
name: sl-express-ms-user
|
||||
profiles:
|
||||
active: local
|
||||
mvc:
|
||||
pathmatch:
|
||||
#解决异常:swagger Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
|
||||
#因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher
|
||||
matching-strategy: ant_path_matcher
|
||||
sl:
|
||||
swagger:
|
||||
package-path: com.sl.ms.user.controller
|
||||
title: 神领物流 - 用户服务微服务接口文档
|
||||
description: 该微服务完成用户相关的业务。
|
||||
contact-name: 传智教育·研究院
|
||||
contact-url: http://www.itcast.cn/
|
||||
contact-email: yjy@itcast.cn
|
||||
version: ${application.version}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--scan: 当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。-->
|
||||
<!--scanPeriod: 设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。-->
|
||||
<!--debug: 当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。-->
|
||||
<configuration debug="false" scan="false" scanPeriod="60 seconds">
|
||||
<springProperty scope="context" name="appName" source="spring.application.name"/>
|
||||
<!--文件名-->
|
||||
<property name="logback.appname" value="${appName}"/>
|
||||
<!--文件位置-->
|
||||
<property name="logback.logdir" value="/data/logs"/>
|
||||
|
||||
<!-- 定义控制台输出 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - [%thread] - %-5level - %logger{50} - %msg%n</pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<File>${logback.logdir}/${logback.appname}/${logback.appname}.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${logback.logdir}/${logback.appname}/${logback.appname}.%d{yyyy-MM-dd}.log.zip</FileNamePattern>
|
||||
<maxHistory>90</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--evel:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,-->
|
||||
<!--不能设置为INHERITED或者同义词NULL。默认是DEBUG。-->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user