Commit fbf94c08 authored by lihaipeng's avatar lihaipeng

modify

parent 56cf4cdc
package com.unififi.api; package com.unififi.api;
import com.unififi.model.User; import com.unififi.model.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -10,7 +9,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -10,7 +9,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@FeignClient(value = "unififi-demo2-service") @FeignClient(value = "unififi-demo2-service")
@Api(tags = "用户操作")
public interface UserApi { public interface UserApi {
@RequestMapping(value = "/echo/{string}", method = RequestMethod.GET) @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)
......
package com.unififi.controller; package com.unififi.controller;
import com.unififi.config.AppConfig;
import com.unififi.api.UserApi; import com.unififi.api.UserApi;
import com.unififi.config.AppConfig;
import com.unififi.model.User; import com.unififi.model.User;
import com.unififi.service.UserService; import com.unififi.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@RestController @RestController
@Api(tags = "用户操作")
public class Demo2Controller implements UserApi { public class Demo2Controller implements UserApi {
@Autowired @Autowired
...@@ -54,7 +56,7 @@ public class Demo2Controller implements UserApi { ...@@ -54,7 +56,7 @@ public class Demo2Controller implements UserApi {
return userService.get(name); return userService.get(name);
} }
@GetMapping("/config/username") @GetMapping("/config/username1")
public String get() throws InterruptedException { public String get() throws InterruptedException {
return appConfig.getUsername(); return appConfig.getUsername();
} }
......
...@@ -38,17 +38,12 @@ ...@@ -38,17 +38,12 @@
<logger name="org.springframework" level="WARN"/> <logger name="org.springframework" level="WARN"/>
<!-- 开发环境输出到控制台 -->
<springProfile name="dev">
<root level="INFO"> <root level="INFO">
<appender-ref ref="STDOUT"/> <appender-ref ref="STDOUT"/>
</root>
</springProfile>
<!-- 生产环境输出到文件 -->
<springProfile name="prod">
<root level="INFO">
<appender-ref ref="ASYNC"/> <appender-ref ref="ASYNC"/>
</root> </root>
<!-- 开发环境输出到控制台 -->
<springProfile name="dev">
</springProfile> </springProfile>
</configuration> </configuration>
...@@ -49,17 +49,12 @@ ...@@ -49,17 +49,12 @@
<logger name="org.springframework" level="WARN"/> <logger name="org.springframework" level="WARN"/>
<!-- 开发环境输出到控制台 -->
<springProfile name="dev">
<root level="INFO"> <root level="INFO">
<appender-ref ref="STDOUT"/> <appender-ref ref="STDOUT"/>
</root>
</springProfile>
<!-- 生产环境输出到文件 -->
<springProfile name="prod">
<root level="INFO">
<appender-ref ref="ASYNC"/> <appender-ref ref="ASYNC"/>
</root> </root>
<!-- 开发环境输出到控制台 -->
<springProfile name="dev">
</springProfile> </springProfile>
</configuration> </configuration>
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