package com.stylefeng.guns.modular.huifu; import com.alibaba.fastjson.JSONObject; import com.huifu.bspay.sdk.opps.core.utils.RsaUtils; import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author mitao * @date 2025/11/21 */ @Slf4j @RestController @RequestMapping("/base/dougong/") public class DouGongNotifyController { @Autowired private HuiFuProperties huiFuProperties; /** * 斗拱主动取现接口回调 * @param request * @param response */ @PostMapping("/encashment") public void encashment(HttpServletRequest request, HttpServletResponse response) { String sign =request.getParameter("sign"); String resp_data = request.getParameter("resp_data"); log.info(""); resp_data = resp_data.replaceAll("& #40;", "(").replaceAll("& #41;",")"); boolean verify = RsaUtils.verify(resp_data, huiFuProperties.getRsaPublicKey(), sign); if(verify){ JSONObject respDataJson = JSONObject.parseObject(resp_data); } } }