Commit 25e8d0f7 authored by liming's avatar liming

新增服务端api

parent 96ee4ca8
...@@ -18,17 +18,17 @@ import java.util.Map; ...@@ -18,17 +18,17 @@ import java.util.Map;
*/ */
@Component @Component
public class TokenService { public class TokenService {
@Value("${project.jwt.secret}") @Value("${project.jwt.secret:null}")
private String secret; private String secret;
@Value("${project.jwt.prefix}") @Value("${project.jwt.prefix:null}")
private String tokenPrefix; private String tokenPrefix;
@Value("${project.jwt.long-token-expire}") @Value("${project.jwt.long-token-expire:0}")
private long longTokenExpire; private long longTokenExpire;
@Value("${project.jwt.short-token-expire}") @Value("${project.jwt.short-token-expire:0}")
private long shortTokenExpire; private long shortTokenExpire;
@Value("${project.jwt.subject-key}") @Value("${project.jwt.subject-key:null}")
private String subjectKey; private String subjectKey;
@Value("${project.jwt.long-token-key}") @Value("${project.jwt.long-token-key:null}")
private String longTokenKey; private String longTokenKey;
public TokenVO initToken(String username) { public TokenVO initToken(String username) {
......
server:
port: 8080
spring: spring:
profiles: profiles:
include: include:
......
server:
port: 8080
spring: spring:
profiles: profiles:
include: include:
......
server:
port: 8080
spring: spring:
profiles: profiles:
include: include:
......
server:
port: 8080
spring: spring:
application: application:
name: "antai-sport-http-server-mobile-api" name: "antai-sport-http-server-mobile-api"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<module>code-generator</module> <module>code-generator</module>
<module>common</module> <module>common</module>
<module>constants</module> <module>constants</module>
<module>server-api</module>
</modules> </modules>
......
<?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>server-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>com.easemob.im</groupId>
<artifactId>im-sdk-core</artifactId>
<version>0.5.2</version>
</dependency>
</dependencies>
<build>
<finalName>antai-sport-http-server-server-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>
</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
package com.antai.sport.http.server.server.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 springfox.documentation.oas.annotations.EnableOpenApi;
@SpringBootApplication
@EnableOpenApi
@ComponentScan(value = "com.antai")
@MapperScan("com.antai")
public class ServerApiApplication {
public static void main(String[] args) {
SpringApplication.run(ServerApiApplication.class, args);
}
}
package com.antai.sport.http.server.server.api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@Api(tags = {"test"})
public class TestController {
@ApiOperation(value = "测试")
@GetMapping("test")
public Map test(){
return Map.of("test","hha");
}
}
spring:
profiles:
include:
- common-db-dev
redis:
database: 0
host: 127.0.0.1
port: 6379
password: 123456
swagger:
enable: true
game-server-address: http://8.141.144.99:3333/close?MatchId=force
\ No newline at end of file
spring:
profiles:
include:
- common-db-local
redis:
database: 1
host: 127.0.0.1
port: 6379
swagger:
enable: true
game-server-address: http://127.0.0.1:3333/close?MatchId=force
\ No newline at end of file
spring:
profiles:
include:
- common-db-prod
redis:
database: 0
host: 127.0.0.1
port: 6379
password: ENC(yKZoKLWfAj6BRglq4C2HWWjsL64maeCm)
game-server-address: http://8.141.144.99:3333/close?MatchId=force
\ No newline at end of file
spring:
profiles:
include:
- common-db-test
redis:
database: 1
host: 127.0.0.1
port: 6379
password: ENC(yKZoKLWfAj6BRglq4C2HWWjsL64maeCm)
swagger:
enable: true
game-server-address: http://8.141.144.99:3333/close?MatchId=force
\ No newline at end of file
server:
port: 8081
spring:
application:
name: "antai-sport-http-server-server-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
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.server.api
description: 接口文档
service-website: https://www.antaikeji.top/
aliyun:
access-key-id: LTAI4FivP3A9hfXzF5Z2KKNM
access-key-secret: W1erPY4SLOoPK0YwwptLZCSfZ61K4c
sms:
sign: 安泰实业
region-id: cn-qingdao
time-out: 1000
template-code:
login: SMS_136440120 #登录确认验证码
mybatis-plus:
global-config:
db-config:
logic-delete-value: 1
logic-not-delete-value: 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment