master
晨哀 2024-08-06 19:32:17 +08:00
commit 8da8e77c15
59 changed files with 2682 additions and 0 deletions

35
.gitignore vendored 100644
View File

@ -0,0 +1,35 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

27
bwie-auth/pom.xml 100644
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.bwie</groupId>
<artifactId>yp_zhoukao86</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-auth</artifactId>
<dependencies>
<!-- 项目公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,22 @@
package com.bwie.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @Author
* @Packagecom.bwie.auth
* @Projectyp_zhoukao86
* @nameAuthApplication
* @Date2024/8/6 10:24
*/
@EnableFeignClients
@SpringBootApplication
public class AuthApplication {
public static void main(String[] args) {
SpringApplication.run(AuthApplication.class);
}
}

View File

@ -0,0 +1,52 @@
package com.bwie.auth.controller;
import com.bwie.auth.service.AuthService;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Author
* @Packagecom.bwie.auth.controller
* @Projectyp_zhoukao86
* @nameAuthController
* @Date2024/8/6 9:54
*/
@Log4j2
@RestController
@RequestMapping("auth")
public class AuthController {
@Autowired
private AuthService authService;
@PostMapping("getCode")
public Result<Integer> getCode(@RequestBody User user){
Result<Integer> result = authService.getCode(user);
log.info("响应解决:{}",result);
return result;
}
@PostMapping("login")
public Result<User> login(@RequestBody User user){
Result<User> result = authService.login(user);
log.info("响应解决:{}",result);
return result;
}
@GetMapping("info")
public Result<User> info( ){
Result<User> result = authService.info();
log.info("响应解决:{}",result);
return result;
}
@PostMapping("logout")
public void logout(){
authService.logout();
}
}

View File

@ -0,0 +1,23 @@
package com.bwie.auth.feign;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Author
* @Packagecom.bwie.auth.feign
* @Projectyp_zhoukao86
* @nameUserFeign
* @Date2024/8/6 10:02
*/
@FeignClient("bwie-user")
public interface UserFeign{
@PostMapping("user/login")
public Result<User> login(@RequestBody User user);
}

View File

@ -0,0 +1,25 @@
package com.bwie.auth.feign.factory;
import com.bwie.auth.feign.UserFeign;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
/**
* @Author
* @Packagecom.bwie.auth.feign.factory
* @Projectyp_zhoukao86
* @nameUserFeignFactory
* @Date2024/8/6 11:02
*/
public class UserFeignFactory implements FallbackFactory<UserFeign> {
@Override
public UserFeign create(Throwable cause) {
return new UserFeign() {
@Override
public Result<User> login(User user) {
return Result.error(cause.getMessage());
}
};
}
}

View File

@ -0,0 +1,23 @@
package com.bwie.auth.service;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
/**
*@Author
*@Packagecom.bwie.auth.service
*@Projectyp_zhoukao86
*@nameAuthService
*@Date2024/8/6 9:55
*/
public interface AuthService {
Result<User> login(User user);
Result<User> info();
void logout();
Result<Integer> getCode(User user);
}

View File

@ -0,0 +1,108 @@
package com.bwie.auth.service.impl;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.client.naming.utils.RandomUtils;
import com.bwie.auth.feign.UserFeign;
import com.bwie.auth.service.AuthService;
import com.bwie.common.constants.JwtConstants;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* @Author
* @Packagecom.bwie.auth.service.impl
* @Projectyp_zhoukao86
* @nameAuthServiceImpl
* @Date2024/8/6 9:55
*/
@Service
public class AuthServiceImpl implements AuthService {
@Autowired
private UserFeign userFeign;
@Autowired
private HttpServletRequest request;
@Autowired
private StringRedisTemplate redisTemplate;
@Override
public Result<Integer> getCode(User user) {
if (StringUtils.isAllEmpty(user.getUserPhone())){
return Result.error("手机号不能为空");
}
Result<User> login = userFeign.login(user);
if (login == null ){
return Result.error("手机号不存在");
}
int code = RandomUtils.nextInt(9999);
redisTemplate.opsForValue().set(TokenConstants.LOGIN_CODE_KEY+user.getUserPhone(),
JSONObject.toJSONString(code),
TokenConstants.REFRESH_TIME,
TimeUnit.MINUTES);
return Result.success(code,"验证码发送成功");
}
@Override
public Result<User> login(User user) {
if (StringUtils.isAllEmpty(user.getUserPhone(),user.getCode())){
return Result.error("手机号/验证码不能为空");
}
Result<User> login = userFeign.login(user);
User data = login.getData();
if (data == null ){
return Result.error("手机号不存在");
}
String code = redisTemplate.opsForValue().get(TokenConstants.LOGIN_CODE_KEY + user.getUserPhone());
if (!user.getCode().equals(code)){
return Result.error("验证码错");
}
String userKey = UUID.randomUUID().toString().replace("-", "");
Map<String, Object> map = new HashMap<>();
map.put(JwtConstants.USER_KEY,userKey);
String token = JwtUtils.createToken(map);
data.setToken(token);
redisTemplate.opsForValue().set(TokenConstants.LOGIN_TOKEN_KEY+userKey,JSONObject.toJSONString(data),
TokenConstants.EXPIRATION, TimeUnit.MINUTES);
return Result.success(data);
}
@Override
public Result<User> info() {
String token = request.getHeader(TokenConstants.TOKEN);
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
return Result.success(JSONObject.parseObject(s, User.class));
}
@Override
public void logout() {
String token = request.getHeader(TokenConstants.TOKEN);
String userKey = JwtUtils.getUserKey(token);
redisTemplate.delete(TokenConstants.LOGIN_TOKEN_KEY + userKey);
}
}

View File

@ -0,0 +1,34 @@
# Tomcat
server:
port: 9001
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-auth
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
config:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,94 @@
<?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.bwie</groupId>
<artifactId>yp_zhoukao86</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-common</artifactId>
<!-- 公共依赖 -->
<dependencies>
<!-- bootstrap 启动器 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</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>
<!-- 负载均衡-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<!-- SpringCloud Openfeign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- JWT -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<!-- Alibaba Fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<!-- SpringBoot Boot Redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- Hibernate Validator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- Apache Lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- lombok依赖 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- hutool -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<!-- 阿里大鱼 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
</dependency>
<!-- 图片长传 -->
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.26.5</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,18 @@
package com.bwie.common.constants;
/**
* @description:
* @author DongZl
*/
public class Constants {
/**
*
*/
public static final Integer SUCCESS = 200;
public static final String SUCCESS_MSG = "操作成功";
/**
*
*/
public static final Integer ERROR = 500;
public static final String ERROR_MSG = "操作异常";
}

View File

@ -0,0 +1,29 @@
package com.bwie.common.constants;
/**
* @author DongZl
* @description: Jwt
*/
public class JwtConstants {
/**
* ID
*/
public static final String DETAILS_USER_ID = "user_id";
/**
*
*/
public static final String DETAILS_USERNAME = "username";
/**
*
*/
public static final String USER_KEY = "user_key";
/**
*
*/
public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
}

View File

@ -0,0 +1,28 @@
package com.bwie.common.constants;
/**
* @author DongZl
* @description:
*/
public class TokenConstants {
/**
* 720
*/
public final static long EXPIRATION = 720;
/**
* 120
*/
public final static long REFRESH_TIME = 120;
/**
*
*/
public final static String LOGIN_TOKEN_KEY = "login_tokens1:";
/**
*
*/
public final static String LOGIN_CODE_KEY = "login_code1:";
/**
* token
*/
public static final String TOKEN = "token";
}

View File

@ -0,0 +1,27 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @Author
* @Packagecom.bwie.common.domain
* @Projectyp_zhoukao86
* @nameFirm
* @Date2024/8/6 9:41
*/
@Data
public class Firm {
private Long firmId;
private String firmJob;
private String firmJobDescription;
private String firmPriceMin;
private String firmPriceMax;
private Long jobId;
private String firmDate;
private String firmCount;
private String firmStatus;
private String jobName;
}

View File

@ -0,0 +1,23 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @Author
* @Packagecom.bwie.common.domain
* @Projectyp_zhoukao86
* @nameJob
* @Date2024/8/6 9:44
*/
@Data
public class Job {
private String jobId;
private String jobName;
private String userPriceMin;
private String userPriceMax;
private String userDate;
}

View File

@ -0,0 +1,30 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @Author
* @Packagecom.bwie.common.domain
* @Projectyp_zhoukao86
* @namePeople
* @Date2024/8/6 9:42
*/
@Data
public class People {
private Long peopleId;
private Long firmId;
private Long userId;
private String peopleDate;
private String peopleStatus;
private String firmJob;
private String userName;
private String userPhone;
private String userJob;
private String userPriceMin;
private String userPriceMax;
}

View File

@ -0,0 +1,28 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @Author
* @Packagecom.bwie.common.domain
* @Projectyp_zhoukao86
* @nameUser
* @Date2024/8/6 9:39
*/
@Data
public class User {
private Long userId;
private String userName;
private String userPhone;
private String userJob;
private String userCount;
private String userPriceMin;
private String userPriceMax;
private String userDate;
private String code;
private String token;
}

View File

@ -0,0 +1,38 @@
package com.bwie.common.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author DongZl
* @description:
*/
@Data
public class PageResult<T> implements Serializable {
/**
*
*/
private long total;
/**
*
*/
private List<T> list;
public PageResult() {
}
public PageResult(long total, List<T> list) {
this.total = total;
this.list = list;
}
public static <T> PageResult<T> toPageResult(long total, List<T> list) {
return new PageResult(total, list);
}
public static <T> Result<PageResult<T>> toResult(long total, List<T> list) {
return Result.success(PageResult.toPageResult(total, list));
}
}

View File

@ -0,0 +1,76 @@
package com.bwie.common.result;
import com.bwie.common.constants.Constants;
import lombok.Data;
import java.io.Serializable;
/**
* @author DongZl
* @description:
*/
@Data
public class Result<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
public static final int SUCCESS = Constants.SUCCESS;
/**
*
*/
public static final int FAIL = Constants.ERROR;
/**
*
*/
private int code;
/**
*
*/
private String msg;
/**
*
*/
private T data;
public static <T> Result<T> success() {
return restResult(null, SUCCESS, Constants.SUCCESS_MSG);
}
public static <T> Result<T> success(T data) {
return restResult(data, SUCCESS, Constants.SUCCESS_MSG);
}
public static <T> Result<T> success(T data, String msg) {
return restResult(data, SUCCESS, msg);
}
public static <T> Result<T> error() {
return restResult(null, FAIL, Constants.ERROR_MSG);
}
public static <T> Result<T> error(String msg) {
return restResult(null, FAIL, msg);
}
public static <T> Result<T> error(T data) {
return restResult(data, FAIL, Constants.ERROR_MSG);
}
public static <T> Result<T> error(T data, String msg) {
return restResult(data, FAIL, msg);
}
public static <T> Result<T> error(int code, String msg) {
return restResult(null, code, msg);
}
private static <T> Result<T> restResult(T data, int code, String msg) {
Result<T> apiResult = new Result<>();
apiResult.setCode(code);
apiResult.setData(data);
apiResult.setMsg(msg);
return apiResult;
}
}

View File

@ -0,0 +1,109 @@
package com.bwie.common.utils;
import com.bwie.common.constants.JwtConstants;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import java.util.Map;
/**
* @description: Jwt
* @author DongZl
*/
public class JwtUtils {
/**
*
*/
public static String secret = JwtConstants.SECRET;
/**
*
*
* @param claims
* @return
*/
public static String createToken(Map<String, Object> claims){
String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
return token;
}
/**
*
*
* @param token
* @return
*/
public static Claims parseToken(String token){
return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
}
/**
*
*
* @param token
* @return ID
*/
public static String getUserKey(String token){
Claims claims = parseToken(token);
return getValue(claims, JwtConstants.USER_KEY);
}
/**
*
*
* @param claims
* @return ID
*/
public static String getUserKey(Claims claims){
return getValue(claims, JwtConstants.USER_KEY);
}
/**
* ID
*
* @param token
* @return ID
*/
public static String getUserId(String token){
Claims claims = parseToken(token);
return getValue(claims, JwtConstants.DETAILS_USER_ID);
}
/**
* ID
*
* @param claims
* @return ID
*/
public static String getUserId(Claims claims){
return getValue(claims, JwtConstants.DETAILS_USER_ID);
}
/**
*
*
* @param token
* @return
*/
public static String getUserName(String token){
Claims claims = parseToken(token);
return getValue(claims, JwtConstants.DETAILS_USERNAME);
}
/**
*
*
* @param claims
* @return
*/
public static String getUserName(Claims claims){
return getValue(claims, JwtConstants.DETAILS_USERNAME);
}
/**
*
*
* @param claims
* @param key
* @return
*/
public static String getValue(Claims claims, String key){
Object obj = claims.get(key);
return obj == null ? "" : obj.toString();
}
}

View File

@ -0,0 +1,68 @@
package com.bwie.common.utils;
import org.springframework.util.AntPathMatcher;
import java.util.Collection;
import java.util.List;
/**
* @author DongZl
* @description:
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
* *
*
* @param object Object
* @return true false
*/
public static boolean isNull(Object object) {
return object == null;
}
/**
* * Collection ListSetQueue
*
* @param coll Collection
* @return true false
*/
public static boolean isEmpty(Collection<?> coll) {
return isNull(coll) || coll.isEmpty();
}
/**
*
*
* @param str
* @param strs
* @return
*/
public static boolean matches(String str, List<String> strs) {
if (isEmpty(str) || isEmpty(strs)) {
return false;
}
for (String pattern : strs) {
if (isMatch(pattern, str))
{
return true;
}
}
return false;
}
/**
* url:
* ? ;
* * ;
* ** ;
*
* @param pattern
* @param url url
* @return
*/
public static boolean isMatch(String pattern, String url) {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
}
}

View File

@ -0,0 +1,87 @@
package com.bwie.common.utils;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import com.aliyun.teaopenapi.models.Config;
import lombok.extern.log4j.Log4j2;
import java.util.Map;
/**
*
*/
@Log4j2
public class TelSmsUtils {
/**
* AccessKeyaccessKeySecretAPI访
*/
private static String accessKeyId = "LTAIEVXszCmcd1T5";
private static String accessKeySecret = "2zHwciQXln8wExSEnkIYtRTSwLeRNd";
/**
* 访
*/
private static String endpoint = "dysmsapi.aliyuncs.com";
/**
*
*/
private static String signName = "登录验证";
/**
*
*/
private static Client client;
static {
log.info("初始化短信服务开始");
long startTime = System.currentTimeMillis();
try {
client = initClient();
log.info("初始化短信成功:{}",signName);
} catch (Exception e) {
e.printStackTrace();
}
log.info("初始化短信服务结束:耗时:{}MS",(System.currentTimeMillis()-startTime));
}
/**
*
* @return
* @throws Exception
*/
private static Client initClient() throws Exception{
Config config = new Config()
// 您的AccessKey ID
.setAccessKeyId(accessKeyId)
// 您的AccessKey Secret
.setAccessKeySecret(accessKeySecret);
// 访问的域名
config.endpoint = endpoint;
return new Client(config);
}
/**
*
* @param tel
* @param templateCode SMS_153991546
* @param sendDataMap
*/
public static String sendSms(String tel , String templateCode , Map<String,String> sendDataMap){
SendSmsRequest sendSmsRequest = new SendSmsRequest()
.setPhoneNumbers(tel)
.setSignName(signName)
.setTemplateCode(templateCode)
.setTemplateParam(JSONObject.toJSONString(sendDataMap));
SendSmsResponse sendSmsResponse = null;
try {
log.info("发送短信验证码:消息内容是:【{}】", JSONObject.toJSONString(sendDataMap));
sendSmsResponse = client.sendSms(sendSmsRequest);
} catch (Exception e) {
log.error("短信发送异常,手机号:【{}】,短信内容:【{}】,异常信息:【{}】", tel, sendDataMap, e);
}
return JSONObject.toJSONString(sendSmsResponse.getBody());
}
}

View File

@ -0,0 +1,38 @@
<?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.bwie</groupId>
<artifactId>yp_zhoukao86</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-gateway</artifactId>
<dependencies>
<!-- 公共模块 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- 网关依赖 -->
<!-- SpringCloud Gateway -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel Gateway -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>
<!-- 引入阿里巴巴sentinel限流 依赖-->
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-cloud-gateway-adapter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,20 @@
package com.bwie.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author
* @Packagecom.bwie.gateway
* @Projectyp_zhoukao86
* @nameGatewayApplication
* @Date2024/8/6 10:29
*/
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class);
}
}

View File

@ -0,0 +1,32 @@
package com.bwie.gateway.config;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author sx
*/
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "ignore")
@Data
@Log4j2
public class IgnoreWhiteConfig {
/**
*
*/
private List<String> whites = new ArrayList<>();
public void setWhites(List<String> whites) {
log.info("加载网关路径白名单:{}", JSONObject.toJSONString(whites));
this.whites = whites;
}
}

View File

@ -0,0 +1,79 @@
package com.bwie.gateway.filters;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.utils.JwtUtils;
import com.bwie.common.utils.StringUtils;
import com.bwie.gateway.config.IgnoreWhiteConfig;
import com.bwie.gateway.utils.GatewayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.concurrent.TimeUnit;
@Component
public class GatewayFilters implements GatewayFilter,Override {
@Autowired
private IgnoreWhiteConfig ignoreWhiteConfig;
@Autowired
private StringRedisTemplate redisTemplate;
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
List<String> whites = ignoreWhiteConfig.getWhites();
ServerHttpRequest request = exchange.getRequest();
String path = request.getURI().getPath();
if (StringUtils.matches(path,whites)){
return chain.filter(exchange);
}
// 判断 token 是否为空
String token = request.getHeaders().getFirst(TokenConstants.TOKEN);
if (StringUtils.isNotBlank(token)){
return GatewayUtils.errorResponse(exchange,"token 不能为空", HttpStatus.UNAUTHORIZED);
}
// 判断 token 是否合法
try {
JwtUtils.parseToken(token);
} catch (Exception e) {
return GatewayUtils.errorResponse(exchange,"token 不合法");
}
// 判断 token 是否过期
String userKey = JwtUtils.getUserKey(token);
if (!redisTemplate.hasKey(TokenConstants.LOGIN_TOKEN_KEY+userKey)){
return GatewayUtils.errorResponse(exchange,"token 已过期");
}
// 每次访问后台gateway进行拦截10分钟内访问后台自动续期Token到15分钟3分
Long expire = redisTemplate.getExpire(TokenConstants.LOGIN_TOKEN_KEY + userKey, TimeUnit.MINUTES);
if (expire>5){
redisTemplate.expire(TokenConstants.LOGIN_TOKEN_KEY+userKey,15,TimeUnit.MINUTES);
}else {
return GatewayUtils.errorResponse(exchange,"10分钟内为登录,请重新登录");
}
return chain.filter(exchange);
}
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
}

View File

@ -0,0 +1,98 @@
package com.bwie.gateway.utils;
import com.alibaba.fastjson.JSONObject;
import com.bwie.common.result.Result;
import com.bwie.common.utils.StringUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
/**
* @author DongZl
* @description:
*/
@Log4j2
public class GatewayUtils {
/**
*
* @param mutate
* @param key
* @param value
*/
public static void addHeader(ServerHttpRequest.Builder mutate, String key, Object value) {
if (StringUtils.isEmpty(key)){
log.warn("添加请求头参数键不可以为空");
return;
}
if (value == null) {
log.warn("添加请求头参数:[{}]值为空",key);
return;
}
String valueStr = value.toString();
mutate.header(key, valueStr);
log.info("添加请求头参数成功 - 键:[{}] , 值:[{}]", key , value);
}
/**
*
* @param mutate
* @param key
*/
public static void removeHeader(ServerHttpRequest.Builder mutate, String key) {
if (StringUtils.isEmpty(key)){
log.warn("删除请求头参数键不可以为空");
return;
}
mutate.headers(httpHeaders -> httpHeaders.remove(key)).build();
log.info("删除请求头参数 - 键:[{}]",key);
}
/**
*
* @param exchange
* @param msg
* @return
*/
public static Mono<Void> errorResponse(ServerWebExchange exchange, String msg, HttpStatus httpStatus) {
ServerHttpResponse response = exchange.getResponse();
//设置HTTP响应头状态
response.setStatusCode(httpStatus);
//设置HTTP响应头文本格式
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, "application/json");
//定义响应内容
Result<?> result = Result.error(msg);
String resultJson = JSONObject.toJSONString(result);
log.error("[鉴权异常处理]请求路径:[{}],异常信息:[{}],响应结果:[{}]", exchange.getRequest().getPath(), msg, resultJson);
DataBuffer dataBuffer = response.bufferFactory().wrap(resultJson.getBytes());
//进行响应
return response.writeWith(Mono.just(dataBuffer));
}
/**
*
* @param exchange
* @param msg
* @return
*/
public static Mono<Void> errorResponse(ServerWebExchange exchange, String msg) {
ServerHttpResponse response = exchange.getResponse();
//设置HTTP响应头状态
response.setStatusCode(HttpStatus.OK);
//设置HTTP响应头文本格式
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, "application/json");
//定义响应内容
Result<?> result = Result.error(msg);
String resultJson = JSONObject.toJSONString(result);
log.error("[鉴权异常处理]请求路径:[{}],异常信息:[{}],响应结果:[{}]", exchange.getRequest().getPath(), msg, resultJson);
DataBuffer dataBuffer = response.bufferFactory().wrap(resultJson.getBytes());
//进行响应
return response.writeWith(Mono.just(dataBuffer));
}
}

View File

@ -0,0 +1,33 @@
# Tomcat
server:
port: 18080
# Spring
spring:
application:
# 应用名称
name: bwie-gateway
profiles:
# 环境配置
active: dev
main:
# 允许使用循环引用
allow-circular-references: true
# 允许定义相同的bean对象 去覆盖原有的
allow-bean-definition-overriding: true
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
config:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,66 @@
<?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.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-firm</artifactId>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
<!-- 引入 javax 短信 -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.6</version>
</dependency>
<!-- 引入 oss 图片上传 -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.12.0</version>
</dependency>
<!-- 引入 rabbitMQ的依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,20 @@
package com.bwie.firm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author
* @Packagecom.bwie.firm
* @Projectyp_zhoukao86
* @nameFirmApplication
* @Date2024/8/6 11:01
*/
@SpringBootApplication
public class FirmApplication {
public static void main(String[] args) {
SpringApplication.run(FirmApplication.class);
}
}

View File

@ -0,0 +1,40 @@
package com.bwie.firm.config;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
public class ConfirmCallbackConfig implements RabbitTemplate.ConfirmCallback {
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* bean
*/
@PostConstruct
public void init() {
this.rabbitTemplate.setConfirmCallback(this);
}
/**
*
* @param correlationData correlation data for the callback.
* @param ack true for ack, false for nack
* @param cause An optional cause, for nack, when available, otherwise null.
*/
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
if (ack) {
System.out.println("消息发送到 broker 成功");
} else {
System.out.println("消息发送到 broker 失败,失败的原因:" + cause);
}
}
}

View File

@ -0,0 +1,50 @@
package com.bwie.firm.config;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* RabbitAdmin
*/
@Configuration
public class RabbitAdminConfig {
@Value("${spring.rabbitmq.host}")
private String host;
@Value("${spring.rabbitmq.username}")
private String username;
@Value("${spring.rabbitmq.password}")
private String password;
@Value("${spring.rabbitmq.virtual-host}")
private String virtualhost;
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setAddresses(host);
connectionFactory.setUsername(username);
connectionFactory.setPassword(password);
connectionFactory.setVirtualHost(virtualhost);
// 配置发送确认回调时次配置必须配置否则即使在RabbitTemplate配置了ConfirmCallback也不会生效
connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED);
connectionFactory.setPublisherReturns(true);
return connectionFactory;
}
/**
* rabbitAdmin
* @param connectionFactory
* @return
*/
@Bean
public RabbitAdmin rabbitAdmin(ConnectionFactory connectionFactory) {
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
rabbitAdmin.setAutoStartup(true);
return rabbitAdmin;
}
}

View File

@ -0,0 +1,15 @@
package com.bwie.firm.config;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitmqConfig {
// 消息转换配置
@Bean
public MessageConverter jsonMessageConverter(){
return new Jackson2JsonMessageConverter();
}
}

View File

@ -0,0 +1,37 @@
package com.bwie.firm.config;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
public class ReturnsCallbackConfig implements RabbitTemplate.ReturnsCallback {
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* bean
*/
@PostConstruct
public void init() {
this.rabbitTemplate.setReturnsCallback(this);
}
/**
* queue
*
* @param returnedMessage the returned message and metadata.
*/
@Override
public void returnedMessage(ReturnedMessage returnedMessage) {
System.out.println("消息" + returnedMessage.getMessage().toString() +
"被交换机" + returnedMessage.getExchange() + "回退!"
+ "退回原因为:" + returnedMessage.getReplyText());
// TODO 回退了所有的信息,可做补偿机制
}
}

View File

@ -0,0 +1,55 @@
package com.bwie.firm.consumer;
import com.rabbitmq.client.Channel;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* @Author
* @Packagecom.bwie.firm.consumer
* @Projectyp_zhoukao86
* @nameFirmConsumer
* @Date2024/8/6 15:34
*/
@Log4j2
@Component
public class FirmConsumerBai {
@Autowired
private StringRedisTemplate redisTemplate;
private static final String INDEX_SET = "INDEX_SET";
@RabbitListener(queuesToDeclare = {@Queue("INDEX_MQ_BAI")})
public void firmConsumerBai(String userPhone, Message message, Channel channel){
//iv. 考虑消息队列中消息重复消费以及消息丢失问题5分
try {
String messageId = message.getMessageProperties().getMessageId();
Long add = redisTemplate.opsForSet().add(INDEX_SET, messageId);
if (add == 1){
log.info("消费者开始消费,消费内容为{},",userPhone);
log.info("{}",userPhone);
log.info("消费者消费成功,消费内容为{},",userPhone);
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
}
} catch (Exception e) {
log.info("报错为:{}",e);
try {
channel.basicReject(message.getMessageProperties().getDeliveryTag(),true);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
}

View File

@ -0,0 +1,54 @@
package com.bwie.firm.consumer;
import com.rabbitmq.client.Channel;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* @Author
* @Packagecom.bwie.firm.consumer
* @Projectyp_zhoukao86
* @nameFirmConsumer
* @Date2024/8/6 15:34
*/
@Log4j2
@Component
public class FirmConsumerGong {
@Autowired
private StringRedisTemplate redisTemplate;
private static final String INDEX_SET = "INDEX_SET_GONG";
@RabbitListener(queuesToDeclare = {@Queue("INDEX_MQ_GONG")})
public void firmConsumerBai(String userPhone, Message message, Channel channel){
//iv. 考虑消息队列中消息重复消费以及消息丢失问题5分
try {
String messageId = message.getMessageProperties().getMessageId();
Long add = redisTemplate.opsForSet().add(INDEX_SET, messageId);
if (add == 1){
log.info("消费者开始消费,消费内容为{},",userPhone);
log.info("{}",userPhone);
log.info("消费者消费成功,消费内容为{},",userPhone);
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
}
} catch (Exception e) {
log.info("报错为:{}",e);
try {
channel.basicReject(message.getMessageProperties().getDeliveryTag(),true);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
}

View File

@ -0,0 +1,49 @@
package com.bwie.firm.controller;
import com.bwie.common.domain.Firm;
import com.bwie.common.domain.People;
import com.bwie.common.result.Result;
import com.bwie.firm.service.FirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Author
* @Packagecom.bwie.user.controller
* @Projectyp_zhoukao86
* @nameFirmController
* @Date2024/8/6 10:39
*/
@RestController
@RequestMapping("firm")
public class FirmController {
@Autowired
private FirmService firmService;
@PostMapping("firmList")
public Result firmList(@RequestBody Firm firm){
return firmService.firmList(firm);
}
@PostMapping("peopleList")
public Result peopleList(@RequestBody People people){
return firmService.peopleList(people);
}
@PostMapping("peopleAdd")
public Result peopleAdd(@RequestBody People people){
return firmService.peopleAdd(people);
}
@PostMapping("peopleUpd")
public Result peopleUpd(@RequestBody People people){
return firmService.peopleUpd(people);
}
@GetMapping("jobList")
public Result jobList(){
return firmService.jobList();
}
}

View File

@ -0,0 +1,40 @@
package com.bwie.firm.mapper;
import com.bwie.common.domain.Firm;
import com.bwie.common.domain.Job;
import com.bwie.common.domain.People;
import com.bwie.common.domain.User;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author
* @Packagecom.bwie.user.mapper
* @Projectyp_zhoukao86
* @nameFirmMapper
* @Date2024/8/6 10:41
*/
@Mapper
public interface FirmMapper {
List<Firm> firmList(Firm firm);
List<People> peopleList(People people);
List<Job> jobList();
People listPeopleId(People people);
void peopleAdd(People people);
void updFirmCount(Long firmId);
void updUserCount(Long userId);
void updPeopleStatus(People people);
User listUserId(Long userId);
}

View File

@ -0,0 +1,24 @@
package com.bwie.firm.service;
import com.bwie.common.domain.Firm;
import com.bwie.common.domain.People;
import com.bwie.common.result.Result;
/**
* @Author
* @Packagecom.bwie.user.service
* @Projectyp_zhoukao86
* @nameFirmService
* @Date2024/8/6 10:40
*/
public interface FirmService {
Result firmList(Firm firm);
Result peopleList(People people);
Result peopleAdd(People people);
Result peopleUpd(People people);
Result jobList();
}

View File

@ -0,0 +1,115 @@
package com.bwie.firm.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Firm;
import com.bwie.common.domain.Job;
import com.bwie.common.domain.People;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.firm.mapper.FirmMapper;
import com.bwie.firm.service.FirmService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* @Author
* @Packagecom.bwie.user.service.impl
* @Projectyp_zhoukao86
* @nameFirmServiceImpl
* @Date2024/8/6 10:40
*/
@Service
public class FirmServiceImpl implements FirmService {
private static final String LIST_JOB = "job";
@Autowired
private FirmMapper firmMapper;
@Autowired
private HttpServletRequest request;
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
private StringRedisTemplate redisTemplate;
@Override
public Result firmList(Firm firm) {
List<Firm> firmList = firmMapper.firmList(firm);
return Result.success(firmList);
}
@Override
public Result peopleList(People people) {
List<People> peopleList = firmMapper.peopleList(people);
return Result.success(peopleList);
}
@Transactional
@Override
public Result peopleAdd(People people) {
String token = request.getHeader(TokenConstants.TOKEN);
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
User user = JSONObject.parseObject(s, User.class);
people.setUserId(user.getUserId());
//g) 点击投个简历按钮执行以下逻辑
People people1 = firmMapper.listPeopleId(people);
if (people1 == null){
//i. 在该岗位的候选人列表中插入一条记录2分
firmMapper.peopleAdd(people);
//ii. 插入成功后更新企业招聘列表中的候选人数加一2分
firmMapper.updFirmCount(people.getFirmId());
//iii. 更新个人简历表中的已投递岗位数量加一最近投递时间列更新为系统当前时间3分
firmMapper.updUserCount(people.getUserId());
return Result.success();
}
//iv. 如果该岗位当前登录用户已投递则提示用户该岗位您已投递过请耐心等待5分
return Result.error("该岗位您已投递过,请耐心等待!");
}
@Override
public Result peopleUpd(People people) {
//1. 把该条记录的状态改为已通过2分
//1. 把该条记录的状态改为不通过2分
firmMapper.updPeopleStatus(people);
User user = firmMapper.listUserId(people.getUserId());
if (people.getPeopleStatus().equals("1")){
//2. 通过中间件异步调用消息服务发送短信给候选人提示恭喜你你的简历已通过请前来面试注意在消费者打印短信内容并且有演示短信内容自拟能够成功发送即可否则0分3分
rabbitTemplate.convertAndSend("INDEX_MQ_GONG",user.getUserPhone(),message -> {
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
return message;
});
}
//2. 通过中间件异步调用消息服务发送短信给候选人提示很遗憾你的简历不符合岗位要求请再接再厉注意在消费者打印短信内容并且有演示短信内容自拟能够成功发送即可否则0分3分
rabbitTemplate.convertAndSend("INDEX_MQ_BAI",user.getUserPhone(),message -> {
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
return message;
});
return Result.success();
}
@Override
public Result jobList() {
String s = redisTemplate.opsForValue().get(LIST_JOB);
if (s == null){
return Result.success(JSONObject.parseObject(s, Job.class));
}
List<Job> jobList = firmMapper.jobList();
redisTemplate.opsForValue().set(LIST_JOB,JSONObject.toJSONString(jobList),
TokenConstants.REFRESH_TIME, TimeUnit.MINUTES);
return Result.success(jobList);
}
}

View File

@ -0,0 +1,24 @@
package com.bwie.firm.util;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(RuntimeException.class)//捕获运行时异常
@ResponseBody
public Map<String,Object> exceptionHandler(HttpServletRequest request, Exception e){//处理异常方法
Map<String,Object> map=new HashMap<String, Object>();
map.put("errorCode","101");
map.put("errorMsg","已捕获到全局异常,系统错误!");
map.put("requestURL", request.getRequestURL().toString()); // 获取请求的URL
map.put("exception", e.getMessage()); // 获取异常的消息(可能不是具体原因)
return map;
}
}

View File

@ -0,0 +1,77 @@
package com.bwie.firm.utils;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Component
public class DLXQueue {
// routingKey
private static final String DEAD_ROUTING_KEY = "dead.routingkey";
private static final String ROUTING_KEY = "routingkey";
private static final String DEAD_EXCHANGE = "dead.exchange";
private static final String EXCHANGE = "common.exchange";
@Autowired
RabbitTemplate rabbitTemplate;
@Resource
RabbitAdmin rabbitAdmin;
/**
*
*
* @param queueName
* @param deadQueueName
* @param params
* @param expiration
*/
public void sendDLXQueue(String queueName, String deadQueueName, Object params, Integer expiration) {
/**
* ----------------------------------ttl--------------------------------------------
*/
Map<String, Object> map = new HashMap<>();
// 队列设置存活时间单位ms, 必须是整形数据。
map.put("x-message-ttl", expiration);
// 设置死信交换机
map.put("x-dead-letter-exchange", DEAD_EXCHANGE);
// 设置死信交换器路由
map.put("x-dead-letter-routing-key", DEAD_ROUTING_KEY);
/*参数1队列名称 参数2持久化 参数3是否排他 参数4自动删除队列 参数5队列参数*/
Queue queue = new Queue(queueName, true, false, false, map);
rabbitAdmin.declareQueue(queue);
/**
* ------------------------------------------------------------------------------
*/
DirectExchange directExchange = new DirectExchange(EXCHANGE, true, false);
rabbitAdmin.declareExchange(directExchange);
/**
* ------------------------------------------------------------------------------
*/
Binding binding = BindingBuilder.bind(queue).to(directExchange).with(ROUTING_KEY);
rabbitAdmin.declareBinding(binding);
/**
* ------------------------------------------------------------------------------
*/
DirectExchange deadExchange = new DirectExchange(DEAD_EXCHANGE, true, false);
rabbitAdmin.declareExchange(deadExchange);
Queue deadQueue = new Queue(deadQueueName, true, false, false);
rabbitAdmin.declareQueue(deadQueue);
/**
* ------------------------------------------------------------------------------
*/
// 将队列和交换机绑定
Binding deadbinding = BindingBuilder.bind(deadQueue).to(deadExchange).with(DEAD_ROUTING_KEY);
rabbitAdmin.declareBinding(deadbinding);
// 发送消息
rabbitTemplate.convertAndSend(EXCHANGE, ROUTING_KEY, params);
}
}

View File

@ -0,0 +1,79 @@
package com.bwie.firm.utils;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.CustomExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
*
*/
@Component
public class DelayedQueue {
// routingKey
private static final String DELAYED_ROUTING_KEY = "delayed.routingkey";
// 延迟队列交换机
private static final String DELAYED_EXCHANGE = "delayed.exchange";
@Autowired
RabbitTemplate rabbitTemplate;
@Resource
RabbitAdmin rabbitAdmin;
/**
*
*
* @param queueName
* @param params
* @param expiration
*/
public void sendDelayedQueue(String queueName, Object params, Integer expiration) {
// 先创建一个队列
Queue queue = new Queue(queueName);
rabbitAdmin.declareQueue(queue);
// 创建延迟队列交换机
CustomExchange customExchange = createCustomExchange();
rabbitAdmin.declareExchange(customExchange);
// 将队列和交换机绑定
Binding binding = BindingBuilder.bind(queue).to(customExchange).with(DELAYED_ROUTING_KEY).noargs();
rabbitAdmin.declareBinding(binding);
// 发送延迟消息
rabbitTemplate.convertAndSend(DELAYED_EXCHANGE, DELAYED_ROUTING_KEY, params, msg -> {
// 发送消息的时候 延迟时长
msg.getMessageProperties().setMessageId(UUID.randomUUID().toString().replaceAll("-", ""));
msg.getMessageProperties().setDelay(expiration);
return msg;
});
}
private CustomExchange createCustomExchange() {
Map<String, Object> arguments = new HashMap<>();
/**
*
* 1.
* 2.
* 3.
* 4.
* 5.
*/
arguments.put("x-delayed-type", "direct");
return new CustomExchange(DELAYED_EXCHANGE, "x-delayed-message", true, false, arguments);
}
}

View File

@ -0,0 +1,66 @@
package com.bwie.firm.utils;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* TTL
*
*/
@Component
public class TtlQueue {
// routingKey
private static final String TTL_KEY = "ttl.routingkey";
private static final String TTL_EXCHANGE = "ttl.exchange";
@Autowired
RabbitTemplate rabbitTemplate;
@Resource
RabbitAdmin rabbitAdmin;
/**
* TTL
*
* @param queueName
* @param params
* @param expiration
*/
public void sendTtlQueue(String queueName, Object params, Integer expiration) {
/**
* ----------------------------------ttl--------------------------------------------
*/
Map<String, Object> map = new HashMap<>();
// 队列设置存活时间单位ms,必须是整形数据。
map.put("x-message-ttl", expiration);
/*参数1队列名称 参数2持久化 参数3是否排他 参数4自动删除队列 参数5队列参数*/
Queue queue = new Queue(queueName, true, false, false, map);
rabbitAdmin.declareQueue(queue);
/**
* ------------------------------------------------------------------------------
*/
DirectExchange directExchange = new DirectExchange(TTL_EXCHANGE, true, false);
rabbitAdmin.declareExchange(directExchange);
/**
* ------------------------------------------------------------------------------
*/
// 将队列和交换机绑定
Binding binding = BindingBuilder.bind(queue).to(directExchange).with(TTL_KEY);
rabbitAdmin.declareBinding(binding);
// 发送消息
rabbitTemplate.convertAndSend(TTL_EXCHANGE, TTL_KEY, params);
}
}

View File

@ -0,0 +1,50 @@
# Tomcat
server:
port: 10009
# Spring
spring:
rabbitmq:
host: 123.249.110.115
port: 5672
username: guest
password: guest
virtual-host: /
listener:
simple:
prefetch: 1 # 默认每次取出一条消息消费, 消费完成取下一条
acknowledge-mode: manual # 设置消费端手动ack确认
retry:
enabled: true # 是否支持重试
publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange)
publisher-returns: true #确认消息已发送到队列(Queue)
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-car
profiles:
# 环境配置
active: dev
main:
# 允许使用循环引用
allow-circular-references: true
# 允许定义相同的bean对象 去覆盖原有的
allow-bean-definition-overriding: true
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
config:
# 配置中心地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,71 @@
<?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">
<!--
1.在mybats的开发中namespace有特殊的意思一定要是对应接口的全限定名
通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)
-->
<mapper namespace="com.bwie.firm.mapper.FirmMapper">
<insert id="peopleAdd">
INSERT INTO `yp_zhoukao86`.`people` ( `firm_id`, `user_id`, `people_date`)
VALUES (#{firmId}, #{userId}, now());
</insert>
<update id="updFirmCount">
update firm set firm_count = firm_count + 1 where firm_id = #{firmId}
</update>
<update id="updUserCount">
UPDATE `yp_zhoukao86`.`user`
SET
`user_count` = user_count + 1,
`user_date` = now()
WHERE
`user_id` = #{userId}
</update>
<update id="updPeopleStatus">
update people set people_status = #{peopleStatus} where people_id = #{peopleId}
</update>
<!-- 添加 -->
<select id="firmList" resultType="com.bwie.common.domain.Firm">
SELECT f.*,j.job_name FROM firm f LEFT JOIN job j ON f.job_id=j.job_id
<where>
<if test="jobId != null and jobId != '' ">
and f.job_id = #{jobId}
</if>
<if test="firmJob != null and firmJob != '' ">
and INSTR( f.firm_job , #{firmJob} )
</if>
<if test="firmPriceMin != null and firmPriceMin != '' ">
or f.firm_price_min &lt; #{firmPriceMin}
</if>
<if test="firmPriceMax != null and firmPriceMax != '' ">
or f.firm_price_max &gt; #{firmPriceMax}
</if>
</where>
</select>
<select id="peopleList" resultType="com.bwie.common.domain.People">
SELECT p.*,f.firm_job,u.* FROM people p
LEFT JOIN firm f ON p.firm_id=f.firm_id
LEFT JOIN user u ON p.user_id=u.user_id
<where>
<if test="firmId != null and firmId != '' ">
and p.firm_id = #{firmId}
</if>
</where>
</select>
<select id="jobList" resultType="com.bwie.common.domain.Job">
select *
from job
</select>
<select id="listPeopleId" resultType="com.bwie.common.domain.People">
select *
from people where firm_id = #{firmId} and user_id = #{userId}
</select>
<select id="listUserId" resultType="com.bwie.common.domain.User">
select *
from user where user_id = #{userId}
</select>
</mapper>

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.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-message</artifactId>
<dependencies>
<!-- 项目公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,20 @@
package com.bwie.message;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author
* @Packagecom.bwie.message
* @Projectyp_zhoukao86
* @nameMessageApplication
* @Date2024/8/6 15:45
*/
@SpringBootApplication
public class MessageApplication {
public static void main(String[] args) {
SpringApplication.run(MessageApplication.class);
}
}

View File

@ -0,0 +1,37 @@
# Tomcat
server:
port: 10008
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-message
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
config:
# 配置中心地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
es:
host: 123.249.110.115
port: 9200
scheme: http

View File

@ -0,0 +1,59 @@
<?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.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-user</artifactId>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
<!-- 引入 javax 短信 -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.6</version>
</dependency>
<!-- 引入 oss 图片上传 -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,23 @@
package com.bwie.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author
* @Packagecom.bwie.user
* @Projectyp_zhoukao86
* @nameUserApplication
* @Date2024/8/6 9:53
*/
@SpringBootApplication
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class);
}
}

View File

@ -0,0 +1,31 @@
package com.bwie.user.controller;
import com.bwie.user.service.UserService;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author
* @Packagecom.bwie.book.controller
* @Projectyp_zhoukao86
* @nameUserController
* @Date2024/8/6 9:48
*/
@RestController
@RequestMapping("user")
public class UserController {
@Autowired
private UserService userService;
@PostMapping("login")
public Result<User> login(@RequestBody User user){
return userService.login(user);
}
}

View File

@ -0,0 +1,17 @@
package com.bwie.user.mapper;
import com.bwie.common.domain.User;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author
* @Packagecom.bwie.book.mapper
* @Projectyp_zhoukao86
* @nameUserMapper
* @Date2024/8/6 9:46
*/
@Mapper
public interface UserMapper {
User login(String userPhone);
}

View File

@ -0,0 +1,16 @@
package com.bwie.user.service;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
/**
* @Author
* @Packagecom.bwie.book.service
* @Projectyp_zhoukao86
* @nameUserMapper
* @Date2024/8/6 9:47
*/
public interface UserService {
Result<User> login(User user);
}

View File

@ -0,0 +1,29 @@
package com.bwie.user.service.impl;
import com.bwie.user.mapper.UserMapper;
import com.bwie.user.service.UserService;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author
* @Packagecom.bwie.book.service.impl
* @Projectyp_zhoukao86
* @nameUserMapperImpl
* @Date2024/8/6 9:46
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public Result<User> login(User user) {
User user1 = userMapper.login(user.getUserPhone());
return Result.success(user1);
}
}

View File

@ -0,0 +1,33 @@
# Tomcat
server:
port: 10007
# Spring
spring:
application:
# 应用名称
name: bwie-user
profiles:
# 环境配置
active: dev
main:
# 允许使用循环引用
allow-circular-references: true
# 允许定义相同的bean对象 去覆盖原有的
allow-bean-definition-overriding: true
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
config:
# 配置中心地址
server-addr: 123.249.110.115:8848
# 命名空间
namespace: yp
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,15 @@
<?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">
<!--
1.在mybats的开发中namespace有特殊的意思一定要是对应接口的全限定名
通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)
-->
<mapper namespace="com.bwie.user.mapper.UserMapper">
<!-- 添加 -->
<select id="login" resultType="com.bwie.common.domain.User">
select *
from user where user_phone = #{userPhone}
</select>
</mapper>

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.bwie</groupId>
<artifactId>yp_zhoukao86</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-modules</artifactId>
<packaging>pom</packaging>
<modules>
<module>bwie-user</module>
<module>bwie-firm</module>
<module>bwie-message</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>
</project>

113
pom.xml 100644
View File

@ -0,0 +1,113 @@
<?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>
<groupId>com.bwie</groupId>
<artifactId>yp_zhoukao86</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>bwie-common</module>
<module>bwie-gateway</module>
<module>bwie-auth</module>
<module>bwie-modules</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.cloud-version>2021.0.0</spring.cloud-version>
<spring.cloud.alibaba-version>2021.1</spring.cloud.alibaba-version>
<jwt.version>0.9.1</jwt.version>
<fastjson.version>1.2.80</fastjson.version>
<hutool.version>5.8.3</hutool.version>
<dysms.version>2.0.1</dysms.version>
<common.version>1.0-SNAPSHOT</common.version>
<druid.version>1.2.8</druid.version>
<mybatis.version>2.2.2</mybatis.version>
<pagehelper.version>1.4.1</pagehelper.version>
</properties>
<!-- 规定SpringBoot版本 -->
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.6.2</version>
<relativePath/>
</parent>
<!-- 依赖 -->
<dependencyManagement>
<dependencies>
<!-- SpringCloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring.cloud-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringCloudAlibaba -->
<!-- SpringCloud Alibaba 微服务 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring.cloud.alibaba-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- JWT -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- Alibaba Fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- hutool -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<!-- 阿里大鱼 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
<version>${dysms.version}</version>
</dependency>
<!-- 公共模块 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
<version>${common.version}</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>