Browse Source

debug

master
zhizhi wu 4 years ago
parent
commit
4a1910b479
  1. 8
      src/main/java/com/ccsens/yanyuan/api/DebugController.java
  2. 4
      src/main/resources/application-common.yml
  3. 16
      src/main/resources/application-dev.yml

8
src/main/java/com/ccsens/yanyuan/api/DebugController.java

@ -1,5 +1,6 @@
package com.ccsens.yanyuan.api;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "DEBUG" , description = "DebugController | ")
@ -17,13 +19,17 @@ import javax.servlet.http.HttpServletRequest;
@Slf4j
public class DebugController {
@Resource
private Snowflake snowflake;
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
long l = snowflake.nextId();
return JsonResponse.newInstance().ok("测试");
return JsonResponse.newInstance().ok("测试:" + l);
}
}

4
src/main/resources/application-common.yml

@ -25,6 +25,6 @@ spring:
max-file-size: 10MB
max-request-size: 100MB
snowflake:
datacenterId: 2
workerId: 2
datacenterId: 6
workerId: 1

16
src/main/resources/application-dev.yml

@ -7,16 +7,16 @@ spring:
name: yanyuan
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# rabbitmq:
# host: 192.168.0.99
# password: 111111
# port: 5672
# username: admin
rabbitmq:
host: 127.0.0.1
password: guest
host: dd.tall.wiki
password: 111111
port: 5672
username: guest
username: admin
# rabbitmq:
# host: 127.0.0.1
# password: guest
# port: 5672
# username: guest
redis:
database: 0
host: 127.0.0.1

Loading…
Cancel
Save