Merge remote-tracking branch 'origin/ht' into ht
commit
316c965fd1
@ -0,0 +1,53 @@
|
||||
package com.weaver.seconddev.interfaces.workflow.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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 java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: XinfengYin
|
||||
* @CreateTime: 2025-02-17
|
||||
* @Description: IP地址赋值
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@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);
|
||||
return WeaResult.success(JSONObject.toJSONString(data));
|
||||
}
|
||||
|
||||
|
||||
public static String null2String(String s){
|
||||
return s == null ? "" : s;
|
||||
}
|
||||
|
||||
public static String null2String(Object o){
|
||||
return o == null ? "" : o.toString();
|
||||
}
|
||||
|
||||
public static String null2String(String s1,String s2){
|
||||
return s1 == null ? (s2 == null ? "" : s2) : s1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue