|
|
|
@ -2,15 +2,15 @@ package com.weaver.seconddev.interfaces.workflow.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.weaver.common.authority.annotation.WeaPermission;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.verupgrade.general.Util;
|
|
|
|
|
import com.weaver.verupgrade.hrm.User;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
@ -27,14 +27,13 @@ import java.util.Map;
|
|
|
|
|
@RequestMapping({"/papi/secondev/workflow/controller" })
|
|
|
|
|
public class HTGD_IT13_GETIP_CONTROLLER {
|
|
|
|
|
@GetMapping("/getip")
|
|
|
|
|
public WeaResult<String> run(@RequestParam Map<String,Object> params) {
|
|
|
|
|
log.error("HTGD_IT13_GETIP_CONTROLLER ===> Start");
|
|
|
|
|
String userid = null2String(params.get("userId"));
|
|
|
|
|
log.error("HTGD_IT13_GETIP_CONTROLLER ===> params",userid);
|
|
|
|
|
User user = new User(Util.getLongValue(userid));
|
|
|
|
|
String IP = user.getLoginip();
|
|
|
|
|
Map<String,Object> data = new HashMap<>();
|
|
|
|
|
data.put("ip",IP);
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@WeaPermission(publicPermission = true)
|
|
|
|
|
public WeaResult<String> run(@RequestBody HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
response.setContentType("application/x-www-form-urlencoded; charset=utf-8");
|
|
|
|
|
String remoteAddr = request.getRemoteAddr();
|
|
|
|
|
Map<String,Object> data = new HashMap<>();
|
|
|
|
|
data.put("ip",remoteAddr);
|
|
|
|
|
return WeaResult.success(JSONObject.toJSONString(data));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|