Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antai-sport
antai-sport-http-server
Commits
137aa752
Commit
137aa752
authored
Jun 07, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化团长管理端
parent
ea67eb85
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1086 additions
and
0 deletions
+1086
-0
pom.xml
pom.xml
+1
-0
pom.xml
team-training-leader-api/pom.xml
+75
-0
TeamTrainingLeaderApiApplication.java
...training/leader/api/TeamTrainingLeaderApiApplication.java
+19
-0
CustomResponseAdvice.java
...team/training/leader/api/advice/CustomResponseAdvice.java
+71
-0
LoginUser.java
...server/team/training/leader/api/annotation/LoginUser.java
+17
-0
AuthController.java
...g/leader/api/business/auth/controller/AuthController.java
+38
-0
AuthConverter.java
...ing/leader/api/business/auth/converter/AuthConverter.java
+10
-0
LoginRequestDTO.java
...raining/leader/api/business/auth/dto/LoginRequestDTO.java
+18
-0
UserInfoResponseDTO.java
...ing/leader/api/business/auth/dto/UserInfoResponseDTO.java
+9
-0
AuthMapper.java
.../training/leader/api/business/auth/mapper/AuthMapper.java
+9
-0
AuthService.java
...raining/leader/api/business/auth/service/AuthService.java
+74
-0
UploadController.java
...aining/leader/api/common/controller/UploadController.java
+27
-0
UploadService.java
...eam/training/leader/api/common/service/UploadService.java
+37
-0
BaseConfig.java
...tp/server/team/training/leader/api/config/BaseConfig.java
+91
-0
TokenInterceptor.java
...eam/training/leader/api/interceptor/TokenInterceptor.java
+47
-0
TeamTrainingLeaderArgumentResolver.java
...ader/api/resolver/TeamTrainingLeaderArgumentResolver.java
+71
-0
OssUtils.java
.../http/server/team/training/leader/api/utils/OssUtils.java
+213
-0
application-dev.yaml
...aining-leader-api/src/main/resources/application-dev.yaml
+24
-0
application-local.yaml
...ning-leader-api/src/main/resources/application-local.yaml
+23
-0
application-prod.yaml
...ining-leader-api/src/main/resources/application-prod.yaml
+27
-0
application-test.yaml
...ining-leader-api/src/main/resources/application-test.yaml
+24
-0
application.yaml
team-training-leader-api/src/main/resources/application.yaml
+80
-0
logback-spring-prod.xml
...ing-leader-api/src/main/resources/logback-spring-prod.xml
+68
-0
AuthMapper.xml
...-leader-api/src/main/resources/mapper/auth/AuthMapper.xml
+13
-0
No files found.
pom.xml
View file @
137aa752
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
<module>
constants
</module>
<module>
constants
</module>
<module>
server-api
</module>
<module>
server-api
</module>
<module>
management-api
</module>
<module>
management-api
</module>
<module>
team-training-leader-api
</module>
</modules>
</modules>
...
...
team-training-leader-api/pom.xml
0 → 100644
View file @
137aa752
<?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>
<artifactId>
antai-sport-http-server
</artifactId>
<groupId>
com.antai.sport.http.server
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
team-training-leader-api
</artifactId>
<packaging>
jar
</packaging>
<properties>
<maven.compiler.source>
11
</maven.compiler.source>
<maven.compiler.target>
11
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
com.antai.sport.http.server
</groupId>
<artifactId>
common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.7.0
</version>
</dependency>
</dependencies>
<build>
<finalName>
antai-sport-http-server-management-api
</finalName>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<fork>
true
</fork>
<encoding>
${project.build.sourceEncoding}
</encoding>
<annotationProcessorPaths>
<path>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
${lombok.version}
</version>
</path>
<path>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${org.mapstruct.version}
</version>
</path>
<!-- other annotation processors -->
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<configuration>
<skipTests>
true
</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/TeamTrainingLeaderApiApplication.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
springfox.documentation.oas.annotations.EnableOpenApi
;
@SpringBootApplication
@EnableOpenApi
@EnableAsync
@ComponentScan
(
value
=
"com.antai"
)
@MapperScan
(
"com.antai.**.mapper"
)
public
class
TeamTrainingLeaderApiApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
TeamTrainingLeaderApiApplication
.
class
,
args
);
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/advice/CustomResponseAdvice.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
advice
;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.common.jwt.TokenService
;
import
com.antai.sport.http.server.common.jwt.TokenVO
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
io.jsonwebtoken.Claims
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.server.ServerHttpRequest
;
import
org.springframework.http.server.ServerHttpResponse
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @Author liming
* @Date 2021/8/22 18:07
* @Email lmmax@126.com
* @Description:
*/
@RestControllerAdvice
(
basePackages
=
"com.antai"
)
@ResponseBody
public
class
CustomResponseAdvice
implements
ResponseBodyAdvice
<
Object
>
{
@Value
(
"${project.header-token-key}"
)
private
String
headerTokenKey
;
@Value
(
"${project.jwt.subject-key}"
)
private
String
subjectKey
;
@Value
(
"${project.jwt.long-token-key}"
)
private
String
longTokenKey
;
@Resource
private
TokenService
tokenService
;
@Override
public
boolean
supports
(
MethodParameter
methodParameter
,
Class
<?
extends
HttpMessageConverter
<?>>
aClass
)
{
return
true
;
}
@Override
public
Object
beforeBodyWrite
(
Object
result
,
MethodParameter
methodParameter
,
MediaType
mediaType
,
Class
<?
extends
HttpMessageConverter
<?>>
aClass
,
ServerHttpRequest
serverHttpRequest
,
ServerHttpResponse
serverHttpResponse
)
{
if
(!(
result
instanceof
Result
))
{
return
result
;
}
String
token
;
List
<
String
>
tokenList
=
serverHttpRequest
.
getHeaders
().
get
(
headerTokenKey
);
if
(
tokenList
!=
null
&&
!
tokenList
.
isEmpty
())
{
token
=
tokenList
.
get
(
0
);
if
(!
StringUtils
.
isBlank
(
token
))
{
Claims
claims
=
tokenService
.
validateToken
(
token
);
if
(
claims
!=
null
&&
claims
.
containsKey
(
longTokenKey
))
{
Result
realResult
=
(
Result
)
result
;
TokenVO
tokenVO
=
tokenService
.
initToken
(
claims
.
get
(
subjectKey
).
toString
());
realResult
.
setRefreshToken
(
true
);
realResult
.
setLongToken
(
tokenVO
.
getLongToken
());
realResult
.
setShortToken
(
tokenVO
.
getShortToken
());
}
}
}
return
result
;
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/annotation/LoginUser.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @Author liming
* @Date 2021/8/23 1:59
* @Email lmmax@126.com
* @Description:
*/
@Target
(
ElementType
.
PARAMETER
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
LoginUser
{
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/controller/AuthController.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
controller
;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
;
import
com.antai.sport.http.server.team.training.leader.api.annotation.LoginUser
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.dto.LoginRequestDTO
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.dto.UserInfoResponseDTO
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.service.AuthService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
static
com
.
antai
.
sport
.
http
.
server
.
common
.
util
.
ResultUtil
.
success
;
@RequestMapping
(
"auth"
)
@RestController
@Api
(
tags
=
{
"授权相关接口"
})
public
class
AuthController
{
@Resource
private
AuthService
authService
;
@ApiOperation
(
"登录接口"
)
@PostMapping
(
"login"
)
public
ResponseEntity
<
Result
>
login
(
@RequestBody
LoginRequestDTO
loginParam
)
{
return
success
(
authService
.
login
(
loginParam
));
}
@ApiOperation
(
"获取用户信息"
)
@GetMapping
(
"/user/info"
)
public
ResponseEntity
<
Result
<
UserInfoResponseDTO
>>
getUserInfo
(
@LoginUser
TeamTrainingLeader
loginUser
)
{
return
success
(
authService
.
getUserInfo
(
loginUser
));
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/converter/AuthConverter.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
converter
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.dto.UserInfoResponseDTO
;
import
org.mapstruct.Mapper
;
@Mapper
(
componentModel
=
"spring"
)
public
interface
AuthConverter
{
UserInfoResponseDTO
toUserInfoResponseDTO
(
TeamTrainingLeader
source
);
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/dto/LoginRequestDTO.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"登录接口传入参数"
)
public
class
LoginRequestDTO
{
@ApiModelProperty
(
"用户名"
)
private
String
username
;
@ApiModelProperty
(
"密码"
)
private
String
password
;
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/dto/UserInfoResponseDTO.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
dto
;
import
lombok.Data
;
@Data
public
class
UserInfoResponseDTO
{
private
String
realName
;
private
String
avatar
;
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/mapper/AuthMapper.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
mapper
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
;
import
org.springframework.cache.annotation.Cacheable
;
public
interface
AuthMapper
{
@Cacheable
(
value
=
"team_training_leader"
,
key
=
"#p0"
,
unless
=
"#result == null"
)
TeamTrainingLeader
getByUsername
(
String
username
);
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/business/auth/service/AuthService.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
business
.
auth
.
service
;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.common.exception.BusinessException
;
import
com.antai.sport.http.server.common.jwt.TokenService
;
import
com.antai.sport.http.server.common.jwt.TokenVO
;
import
com.antai.sport.http.server.constants.DeleteStatus
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
;
import
com.antai.sport.http.server.repository.teamtraining.mapper.TeamTrainingLeaderMapper
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.converter.AuthConverter
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.dto.LoginRequestDTO
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.dto.UserInfoResponseDTO
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.DigestUtils
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
AuthService
{
@Resource
private
TeamTrainingLeaderMapper
teamTrainingLeaderMapper
;
@Resource
private
TokenService
tokenService
;
@Resource
private
AuthConverter
authConverter
;
/**
* 登录
*
* @param loginParam
* @return
*/
public
Result
login
(
LoginRequestDTO
loginParam
)
{
if
(
StringUtils
.
isBlank
(
loginParam
.
getUsername
()))
{
throw
new
BusinessException
(
"请输入用户名"
);
}
if
(
StringUtils
.
isBlank
(
loginParam
.
getPassword
()))
{
throw
new
BusinessException
(
"请输入密码"
);
}
List
<
TeamTrainingLeader
>
userList
=
teamTrainingLeaderMapper
.
selectList
(
new
QueryWrapper
<
TeamTrainingLeader
>().
eq
(
"username"
,
loginParam
.
getUsername
()).
eq
(
"deleted"
,
DeleteStatus
.
UNDELETED
));
if
(
userList
.
isEmpty
())
{
throw
new
BusinessException
(
"用户名或密码错误"
);
}
TeamTrainingLeader
user
=
userList
.
get
(
0
);
String
hashPwd
=
DigestUtils
.
md5DigestAsHex
(
loginParam
.
getPassword
().
getBytes
());
if
(!
hashPwd
.
equals
(
user
.
getPassword
()))
{
throw
new
BusinessException
(
"用户名或密码错误"
);
}
Result
result
=
new
Result
();
TokenVO
tokenVO
=
tokenService
.
initToken
(
loginParam
.
getUsername
());
result
.
setLongToken
(
tokenVO
.
getLongToken
());
result
.
setShortToken
(
tokenVO
.
getShortToken
());
result
.
setRefreshToken
(
true
);
result
.
setRespMsg
(
"登录成功"
);
return
result
;
}
/**
* 获取用户信息
*
* @param loginUser
* @return
*/
public
UserInfoResponseDTO
getUserInfo
(
TeamTrainingLeader
loginUser
)
{
return
authConverter
.
toUserInfoResponseDTO
(
loginUser
);
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/common/controller/UploadController.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
common
.
controller
;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.repository.sys.entity.SysUser
;
import
com.antai.sport.http.server.team.training.leader.api.annotation.LoginUser
;
import
com.antai.sport.http.server.team.training.leader.api.common.service.UploadService
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.util.Map
;
import
static
com
.
antai
.
sport
.
http
.
server
.
common
.
util
.
ResultUtil
.
success
;
@RequestMapping
(
"/upload"
)
@RestController
public
class
UploadController
{
@Resource
private
UploadService
uploadService
;
@ResponseBody
@PostMapping
public
ResponseEntity
<
Result
<
Map
>>
upload
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@LoginUser
SysUser
loginUser
)
{
return
success
(
uploadService
.
upload
(
file
,
loginUser
));
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/common/service/UploadService.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
common
.
service
;
import
com.antai.sport.http.server.common.util.UUIDUtil
;
import
com.antai.sport.http.server.repository.sys.entity.SysUser
;
import
com.antai.sport.http.server.team.training.leader.api.utils.OssUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
public
class
UploadService
{
@Resource
private
OssUtils
ossUtils
;
public
Map
<
String
,
String
>
upload
(
MultipartFile
file
,
SysUser
loginUser
)
{
Map
<
String
,
String
>
result
=
new
HashMap
<>();
String
originalFilename
=
file
.
getOriginalFilename
();
//获取文件类型
String
fileExtension
=
originalFilename
.
substring
(
originalFilename
.
lastIndexOf
(
"."
));
//获取文件名
String
fileName
=
originalFilename
.
substring
(
0
,
originalFilename
.
lastIndexOf
(
"."
));
String
url
=
""
;
try
{
url
=
ossUtils
.
uploadFile
(
UUIDUtil
.
createUUID
()
+
"-"
+
fileName
+
fileExtension
,
file
.
getBytes
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
result
.
put
(
"url"
,
url
);
return
result
;
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/config/BaseConfig.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
config
;
import
com.antai.sport.http.server.team.training.leader.api.interceptor.TokenInterceptor
;
import
com.antai.sport.http.server.team.training.leader.api.resolver.TeamTrainingLeaderArgumentResolver
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.task.AsyncTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.util.List
;
/**
* @Author liming
* @Date 2021/8/22 17:03
* @Email lmmax@126.com
* @Description:
*/
@Configuration
@EnableTransactionManagement
@ConfigurationProperties
(
prefix
=
"project"
)
public
class
BaseConfig
implements
WebMvcConfigurer
{
private
List
<
String
>
permitUrl
;
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
).
allowedOriginPatterns
(
"*"
).
allowCredentials
(
true
).
allowedMethods
(
"GET"
,
"POST"
,
"DELETE"
,
"PUT"
,
"OPTIONS"
).
maxAge
(
3600
);
}
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
tokenInterceptor
()).
addPathPatterns
(
"/**"
).
excludePathPatterns
(
permitUrl
);
}
@Bean
TokenInterceptor
tokenInterceptor
()
{
return
new
TokenInterceptor
();
}
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
argumentResolvers
.
add
(
teamTrainingLeaderArgumentResolver
());
}
@Bean
TeamTrainingLeaderArgumentResolver
teamTrainingLeaderArgumentResolver
()
{
return
new
TeamTrainingLeaderArgumentResolver
();
}
public
void
setPermitUrl
(
List
<
String
>
permitUrl
)
{
this
.
permitUrl
=
permitUrl
;
}
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
PaginationInnerInterceptor
innerInterceptor
=
new
PaginationInnerInterceptor
();
innerInterceptor
.
setDbType
(
DbType
.
MYSQL
);
innerInterceptor
.
setOverflow
(
true
);
interceptor
.
addInnerInterceptor
(
new
OptimisticLockerInnerInterceptor
());
interceptor
.
addInnerInterceptor
(
innerInterceptor
);
return
interceptor
;
}
@Bean
public
ConfigurationCustomizer
configurationCustomizer
()
{
return
mybatisConfiguration
->
mybatisConfiguration
.
setUseGeneratedShortKey
(
false
);
}
@Bean
(
"asyncTaskExecutor"
)
public
AsyncTaskExecutor
asyncTaskExecutor
()
{
ThreadPoolTaskExecutor
asyncTaskExecutor
=
new
ThreadPoolTaskExecutor
();
asyncTaskExecutor
.
setMaxPoolSize
(
50
);
asyncTaskExecutor
.
setCorePoolSize
(
20
);
asyncTaskExecutor
.
setThreadNamePrefix
(
"异步线程-"
);
asyncTaskExecutor
.
initialize
();
return
asyncTaskExecutor
;
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/interceptor/TokenInterceptor.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
interceptor
;
import
com.antai.sport.http.server.common.jwt.TokenService
;
import
io.jsonwebtoken.Claims
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
UNAUTHORIZED
;
public
class
TokenInterceptor
implements
HandlerInterceptor
{
@Value
(
"${project.header-token-key}"
)
private
String
headerTokenKey
;
@Resource
private
TokenService
tokenService
;
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
token
=
request
.
getHeader
(
headerTokenKey
);
if
(
request
.
getMethod
().
equals
(
RequestMethod
.
OPTIONS
.
name
()))
{
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
true
;
}
if
(
null
==
token
)
{
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
UNAUTHORIZED
.
getReasonPhrase
());
return
false
;
}
Claims
claims
=
tokenService
.
validateToken
(
token
);
if
(
claims
==
null
)
{
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
UNAUTHORIZED
.
getReasonPhrase
());
return
false
;
}
return
true
;
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/resolver/TeamTrainingLeaderArgumentResolver.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
resolver
;
import
com.antai.sport.http.server.common.exception.BusinessException
;
import
com.antai.sport.http.server.common.jwt.TokenService
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
;
import
com.antai.sport.http.server.team.training.leader.api.annotation.LoginUser
;
import
com.antai.sport.http.server.team.training.leader.api.business.auth.mapper.AuthMapper
;
import
io.jsonwebtoken.Claims
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.web.bind.support.WebDataBinderFactory
;
import
org.springframework.web.context.request.NativeWebRequest
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.method.support.ModelAndViewContainer
;
import
javax.annotation.Resource
;
public
class
TeamTrainingLeaderArgumentResolver
implements
HandlerMethodArgumentResolver
{
@Value
(
"${project.header-token-key}"
)
private
String
headerTokenKey
;
@Value
(
"${project.jwt.subject-key}"
)
private
String
subjectKey
;
@Resource
private
AuthMapper
authMapper
;
@Resource
private
TokenService
tokenService
;
/**
* 判断是否支持要转换的参数类型
*/
@Override
public
boolean
supportsParameter
(
MethodParameter
methodParameter
)
{
if
(
methodParameter
.
getParameterType
().
isAssignableFrom
(
TeamTrainingLeader
.
class
)
&&
methodParameter
.
hasParameterAnnotation
(
LoginUser
.
class
))
{
return
true
;
}
return
false
;
}
/**
* 当支持后进行相应的转换 做业务操作
*/
@Override
public
Object
resolveArgument
(
MethodParameter
methodParameter
,
ModelAndViewContainer
modelAndViewContainer
,
NativeWebRequest
request
,
WebDataBinderFactory
webDataBinderFactory
)
throws
Exception
{
//从请求头中获参数信息
String
token
=
request
.
getHeader
(
headerTokenKey
);
if
(
token
==
null
||
token
.
isEmpty
())
{
throw
new
BusinessException
(
"token信息错误"
);
}
Claims
claims
=
tokenService
.
validateToken
(
token
);
if
(
claims
==
null
)
{
throw
new
BusinessException
(
"token解析异常"
);
}
String
username
=
claims
.
get
(
subjectKey
).
toString
();
TeamTrainingLeader
sysUser
=
authMapper
.
getByUsername
(
username
);
if
(
sysUser
==
null
)
{
throw
new
BusinessException
(
"当前用户不存在"
);
}
return
sysUser
;
}
}
team-training-leader-api/src/main/java/com/antai/sport/http/server/team/training/leader/api/utils/OssUtils.java
0 → 100644
View file @
137aa752
package
com
.
antai
.
sport
.
http
.
server
.
team
.
training
.
leader
.
api
.
utils
;
import
com.aliyun.oss.OSS
;
import
com.aliyun.oss.OSSClientBuilder
;
import
com.aliyun.oss.model.OSSObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.util.zip.Adler32
;
import
java.util.zip.CheckedOutputStream
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
/**
* @author 潘维吉
* @date 2019/10/16 9:27
* @email 406798106@qq.com
* @description OSS工具类封装 基于阿里云存储服务
*/
@ConditionalOnProperty
(
prefix
=
"aliyun.oss"
,
name
=
{
"enabled"
},
matchIfMissing
=
false
)
@Service
@Slf4j
public
class
OssUtils
{
@Value
(
"${aliyun.oss.access-key-id}"
)
private
String
accessKeyId
;
@Value
(
"${aliyun.oss.access-key-secret}"
)
private
String
accessKeySecret
;
@Value
(
"${aliyun.oss.endpoint:http://oss-cn-beijing.aliyuncs.com}"
)
private
String
endpoint
;
@Value
(
"${aliyun.oss.bucket-name}"
)
private
String
bucketName
;
@Value
(
"${aliyun.oss.cdn-url}"
)
private
String
cdnUrl
;
private
OSS
ossClient
;
@PostConstruct
private
void
initClient
()
{
// 创建OSSClient实例
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
// 关闭OSSClient
//ossClient.shutdown();
}
/**
* 上传文件
*
* @param filePath 指定的文件路径 可指定目录(test/1.jpg)
* @param content 内容
*/
public
String
uploadFile
(
String
filePath
,
byte
[]
content
)
{
// 上传内容到指定的存储空间(bucketName)并保存为指定的文件名称(filePath)
ossClient
.
putObject
(
bucketName
,
filePath
,
new
ByteArrayInputStream
(
content
));
return
cdnUrl
+
filePath
;
}
/**
* 下载文件
*/
public
void
downloadFile
(
String
filePath
)
throws
IOException
{
// 调用ossClient.getObject返回一个OSSObject实例,该实例包含文件内容及文件元信息。
OSSObject
ossObject
=
ossClient
.
getObject
(
bucketName
,
filePath
);
// 调用ossObject.getObjectContent获取文件输入流,可读取此输入流获取其内容。
InputStream
content
=
ossObject
.
getObjectContent
();
if
(
content
!=
null
)
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
content
));
while
(
true
)
{
String
line
=
reader
.
readLine
();
if
(
line
==
null
)
{
break
;
}
System
.
out
.
println
(
"\n"
+
line
);
}
// 数据读取完成后,获取的流必须关闭,否则会造成连接泄漏,导致请求无连接可用,程序无法正常工作。
content
.
close
();
}
}
/**
* 删除文件
*/
public
void
deleteFile
(
String
filePath
)
{
ossClient
.
deleteObject
(
bucketName
,
filePath
);
}
/**
* 是否存在存储空间 不存在自动创建存储空间
*/
private
void
isExistsBucket
()
{
if
(!
ossClient
.
doesBucketExist
(
bucketName
))
{
// 创建bucket
ossClient
.
createBucket
(
bucketName
);
}
}
/**
* 创建存储空间
*/
private
void
createBucket
(
String
bucketName
)
{
ossClient
.
createBucket
(
bucketName
);
}
/**
* 获取阿里云图片服务缩略压缩图
*
* @param oriUrl 原图地址
* @param width 宽度
* @param height 高度
* @return 缩略图url
*/
public
String
getThumbnailUrl
(
String
oriUrl
,
int
width
,
int
height
)
{
if
(
oriUrl
==
null
||
!
oriUrl
.
toLowerCase
().
startsWith
(
"http"
))
{
return
oriUrl
;
}
// 等比缩放,限定在矩形框外 将图缩略成宽度为 width,高度为 height,按长边优先
StringBuilder
result
=
new
StringBuilder
(
oriUrl
);
result
.
append
(
"?x-oss-process=image/resize,m_lfit,h_"
);
result
.
append
(
height
);
result
.
append
(
",w_"
);
result
.
append
(
width
);
return
result
.
toString
();
}
/**
* 阿里OSS服务器多文件打包ZIP下载,批量下载
*
* @param key 带目录的key 多文件用,号分割
* @param zipFileName zip包文件名
* @param request
* @param response
* @return
*/
public
HttpServletResponse
zipFilesDown
(
String
key
,
String
zipFileName
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
try
{
String
fileName
=
zipFileName
+
".zip"
;
// 创建临时文件
File
zipFile
=
File
.
createTempFile
(
zipFileName
,
".zip"
);
FileOutputStream
f
=
new
FileOutputStream
(
zipFile
);
CheckedOutputStream
outputStream
=
new
CheckedOutputStream
(
f
,
new
Adler32
());
// 用于将数据压缩成Zip文件格式
ZipOutputStream
zos
=
new
ZipOutputStream
(
outputStream
);
String
[]
keyList
=
key
.
split
(
","
);
for
(
String
ossFile
:
keyList
)
{
ossFile
=
ossFile
.
trim
();
// 获取Object,返回结果为OSSObject对象
OSSObject
ossObject
=
ossClient
.
getObject
(
bucketName
,
ossFile
);
// 读去Object内容 返回
InputStream
inputStream
=
ossObject
.
getObjectContent
();
// 对于每一个要被存放到压缩包的文件,都必须调用ZipOutputStream对象的putNextEntry()方法,确保压缩包里面文件不同名
zos
.
putNextEntry
(
new
ZipEntry
(
ossFile
.
split
(
"/"
)[
1
]));
int
bytesRead
=
0
;
// 向压缩文件中输出数据
while
((
bytesRead
=
inputStream
.
read
())
!=
-
1
)
{
zos
.
write
(
bytesRead
);
}
inputStream
.
close
();
zos
.
closeEntry
();
// 当前文件写完,定位为写入下一条项目
}
zos
.
close
();
String
header
=
request
.
getHeader
(
"User-Agent"
).
toUpperCase
();
if
(
header
.
contains
(
"MSIE"
)
||
header
.
contains
(
"TRIDENT"
)
||
header
.
contains
(
"EDGE"
))
{
fileName
=
URLEncoder
.
encode
(
fileName
,
"utf-8"
);
fileName
=
fileName
.
replace
(
"+"
,
"%20"
);
//IE下载文件名空格变+号问题
}
else
{
fileName
=
new
String
(
fileName
.
getBytes
(),
"ISO8859-1"
);
}
response
.
reset
();
response
.
setContentType
(
"text/plain"
);
response
.
setContentType
(
"application/octet-stream; charset=utf-8"
);
response
.
setHeader
(
"Location"
,
fileName
);
response
.
setHeader
(
"Cache-Control"
,
"max-age=0"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
fileName
);
FileInputStream
fis
=
new
FileInputStream
(
zipFile
);
BufferedInputStream
buff
=
new
BufferedInputStream
(
fis
);
BufferedOutputStream
out
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
byte
[]
car
=
new
byte
[
1024
];
int
l
=
0
;
while
(
l
<
zipFile
.
length
())
{
int
j
=
buff
.
read
(
car
,
0
,
1024
);
l
+=
j
;
out
.
write
(
car
,
0
,
j
);
}
// 关闭流
fis
.
close
();
buff
.
close
();
out
.
close
();
ossClient
.
shutdown
();
// 删除临时文件
zipFile
.
delete
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
response
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
new
OssUtils
().
getThumbnailUrl
(
"https://an-plus-test.oss-cn-beijing.aliyuncs.com/qr_code/748323084095721472.jpg"
,
750
,
750
));
}
}
team-training-leader-api/src/main/resources/application-dev.yaml
0 → 100644
View file @
137aa752
spring
:
profiles
:
include
:
-
common-db-dev
redis
:
database
:
2
host
:
127.0.0.1
port
:
6379
password
:
123456
swagger
:
enable
:
true
aliyun
:
oss
:
region-id
:
cn-beijing
access-key-id
:
LTAI4Fq5tjMLps5529Vnp7Kz
access-key-secret
:
W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
enabled
:
true
endpoint
:
https://oss-cn-beijing.aliyuncs.com
bucket-name
:
antai-sport
cdn-url
:
http://antai-sport.oss-cn-beijing.aliyuncs.com/
simple-match-change-notify-url
:
http://47.100.168.51:3281/api/match/update
\ No newline at end of file
team-training-leader-api/src/main/resources/application-local.yaml
0 → 100644
View file @
137aa752
spring
:
profiles
:
include
:
-
common-db-local
redis
:
database
:
1
host
:
127.0.0.1
port
:
6379
swagger
:
enable
:
true
aliyun
:
oss
:
region-id
:
cn-beijing
access-key-id
:
LTAI4Fq5tjMLps5529Vnp7Kz
access-key-secret
:
W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
enabled
:
true
endpoint
:
https://oss-cn-beijing.aliyuncs.com
bucket-name
:
antai-sport
cdn-url
:
http://antai-sport.oss-cn-beijing.aliyuncs.com/
simple-match-change-notify-url
:
http://47.100.168.51:3281/api/match/update
\ No newline at end of file
team-training-leader-api/src/main/resources/application-prod.yaml
0 → 100644
View file @
137aa752
spring
:
profiles
:
include
:
-
common-db-prod
redis
:
database
:
0
host
:
172.18.83.254
port
:
6379
password
:
ENC(UgcvbmfTyoBY7fyKdpGFyiKZj7ICxY21K1P8o7UITfI=)
swagger
:
enable
:
true
aliyun
:
oss
:
region-id
:
cn-shanghai
access-key-id
:
LTAI5tJag75RdSQiVopwRdhc
access-key-secret
:
ShrA1zdrCRevavWUU9GwgyIodMFB2F
enabled
:
true
endpoint
:
https://oss-cn-shanghai.aliyuncs.com
bucket-name
:
shanghaijingji-sport-prod
cdn-url
:
https://shanghaijingji-sport-prod.oss-cn-shanghai.aliyuncs.com/
simple-match-change-notify-url
:
http://127.0.0.1:3281/api/match/update
logging
:
config
:
classpath:logback-spring-prod.xml
\ No newline at end of file
team-training-leader-api/src/main/resources/application-test.yaml
0 → 100644
View file @
137aa752
spring
:
profiles
:
include
:
-
common-db-test
redis
:
database
:
1
host
:
127.0.0.1
port
:
6379
password
:
ENC(yKZoKLWfAj6BRglq4C2HWWjsL64maeCm)
swagger
:
enable
:
true
aliyun
:
oss
:
region-id
:
cn-beijing
access-key-id
:
LTAI4Fq5tjMLps5529Vnp7Kz
access-key-secret
:
W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
enabled
:
true
endpoint
:
https://oss-cn-beijing.aliyuncs.com
bucket-name
:
antai-sport
cdn-url
:
http://antai-sport.oss-cn-beijing.aliyuncs.com/
simple-match-change-notify-url
:
http://47.100.168.51:3281/api/match/update
\ No newline at end of file
team-training-leader-api/src/main/resources/application.yaml
0 → 100644
View file @
137aa752
server
:
port
:
8087
spring
:
application
:
name
:
"
antai-sport-http-server-team-training-leader-api"
config
:
use-legacy-processing
:
true
profiles
:
active
:
dev
cache
:
redis
:
use-key-prefix
:
true
time-to-live
:
1d
expire
:
login-sms-captcha
:
600
keys
:
login-sms-captcha
:
login:sms-captcha
redis
:
timeout
:
10s
jedis
:
pool
:
max-idle
:
500
min-idle
:
50
max-wait
:
-1s
max-active
:
-1
jackson
:
date-format
:
com.antai.sport.http.server.common.jackson.StdDateFormat
time-zone
:
GMT+8
default-property-inclusion
:
always
project
:
header-token-key
:
Authorization
jwt
:
subject-key
:
username
long-token-key
:
longToken
secret
:
antaikeji666
prefix
:
Bearer
long-token-expire
:
2_592_000_000
short-token-expire
:
7_200_000
permit-url
:
-
/swagger**/**
-
/webjars/**
-
/doc.html
-
/v3/**
-
/favicon.ico
-
/error
-
/auth/login
swagger
:
enable
:
false
projectName
:
团长管理端
header-token-key
:
${project.header-token-key}
api-version
:
1.0
author
:
liming
email
:
lmmax@126.com
scan-package
:
com.antai.sport.http.server.team.training.leader.api
description
:
接口文档
service-website
:
https://www.antaikeji.top/
ignored-parameter-list
:
-
com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader
aliyun
:
oss
:
region-id
:
cn-beijing
access-key-id
:
LTAI4Fq5tjMLps5529Vnp7Kz
access-key-secret
:
W1UAzbKf5Ufo6lrFVTe6hicKPoSBSG
enabled
:
true
endpoint
:
https://oss-cn-beijing.aliyuncs.com
bucket-name
:
antai-sport
cdn-url
:
http://antai-sport.oss-cn-beijing.aliyuncs.com/
arn
:
acs:ram::1484442943946857:role/oss
mybatis-plus
:
configuration
:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
global-config
:
db-config
:
logic-delete-value
:
1
logic-not-delete-value
:
0
\ No newline at end of file
team-training-leader-api/src/main/resources/logback-spring-prod.xml
0 → 100644
View file @
137aa752
<configuration>
<!--为了防止进程退出时,内存中的数据丢失,请加上此选项-->
<shutdownHook
class=
"ch.qos.logback.core.hook.DelayingShutdownHook"
/>
<appender
name=
"stdout"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%d [%thread] %-5level %logger{36} [%file : %line] - %msg%n
</pattern>
</encoder>
</appender>
<appender
name=
"aliyunAppender"
class=
"com.aliyun.openservices.log.logback.LoghubAppender"
>
<!--必选项-->
<!-- 账号及网络配置 -->
<endpoint>
cn-shanghai.log.aliyuncs.com
</endpoint>
<accessKeyId>
LTAI5tJag75RdSQiVopwRdhc
</accessKeyId>
<accessKeySecret>
ShrA1zdrCRevavWUU9GwgyIodMFB2F
</accessKeySecret>
<!-- sls 项目配置 -->
<project>
shanghaijingji-sport-prod
</project>
<logStore>
team-training-leader-api
</logStore>
<!--必选项 (end)-->
<!-- 可选项 详见 '参数说明'-->
<totalSizeInBytes>
104857600
</totalSizeInBytes>
<maxBlockMs>
60000
</maxBlockMs>
<ioThreadCount>
8
</ioThreadCount>
<batchSizeThresholdInBytes>
524288
</batchSizeThresholdInBytes>
<batchCountThreshold>
4096
</batchCountThreshold>
<lingerMs>
2000
</lingerMs>
<retries>
10
</retries>
<baseRetryBackoffMs>
100
</baseRetryBackoffMs>
<maxRetryBackoffMs>
100
</maxRetryBackoffMs>
<!-- 可选项 通过配置 encoder 的 pattern 自定义 log 的格式 -->
<encoder>
<pattern>
%d %-5level [%thread] %logger{0}: %msg
</pattern>
</encoder>
<!-- 可选项 设置 time 字段呈现的格式 -->
<timeFormat>
yyyy-MM-dd'T'HH:mmZ
</timeFormat>
<!-- 可选项 设置 time 字段呈现的时区 -->
<timeZone>
UTC+8
</timeZone>
</appender>
<appender
name=
"fileAppender"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!-- daily rollover -->
<fileNamePattern>
/usr/local/project/team-training-leader-api/logs/logFile.%d{yyyy-MM-dd}-%i.log
</fileNamePattern>
<!-- keep 30 days' worth of history capped at 3GB total size -->
<maxHistory>
30
</maxHistory>
<maxFileSize>
100MB
</maxFileSize>
<totalSizeCap>
3GB
</totalSizeCap>
</rollingPolicy>
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder
by default -->
<encoder>
<pattern>
%d %-5level [%thread] %logger{0}: %msg %n
</pattern>
</encoder>
</appender>
<root>
<level
value=
"INFO"
/>
<!-- <appender-ref ref="stdout"/>-->
<appender-ref
ref=
"fileAppender"
/>
<appender-ref
ref=
"aliyunAppender"
/>
</root>
</configuration>
team-training-leader-api/src/main/resources/mapper/auth/AuthMapper.xml
0 → 100644
View file @
137aa752
<?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.antai.sport.http.server.team.training.leader.api.business.auth.mapper.AuthMapper"
>
<select
id=
"getByUsername"
parameterType=
"java.lang.String"
resultType=
"com.antai.sport.http.server.repository.teamtraining.entity.TeamTrainingLeader"
>
select *
from team_training_leader t1
where t1.username = #{username}
and t1.deleted = 0
limit 1
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment