-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
dove-config-server/src/main/java/com/licc/dove/config/controller/ApiController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.licc.dove.config.controller; | ||
|
||
import com.licc.dove.config.service.ApiService; | ||
import java.io.IOException; | ||
import javax.annotation.Resource; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
/** | ||
* 服务端对完API | ||
* @author lichangchao | ||
* @version 1.0.0 | ||
* @date 2018/1/4 13:43 | ||
* @see | ||
*/ | ||
@Controller | ||
@RequestMapping(value = "api") | ||
public class ApiController { | ||
@Resource | ||
ApiService apiService; | ||
|
||
@RequestMapping(value = "/getProfileByIp", method = RequestMethod.GET) | ||
@ResponseBody | ||
public String getProfileByIp(@RequestParam String ip) throws IOException { | ||
String profile = apiService.getProfileByIp(ip); | ||
return profile; | ||
} | ||
} |