/** * <p>Title: EsignCallBackController.java</p> * <p>Description: </p> * @author dsc * @date 2020年5月19日 * @version 1.0 */ package cn.timer.api.callback.esign; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.transaction.Transactional; 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 cn.timer.api.callback.esign.service.SafeVerify; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * <p> * Title: EsignCallBackController.java * </p> * <p> * Description: * </p> * * @author dsc * @date 2020年5月19日 * @version 1.0 */ @RestController @Transactional @Api(tags = "99.97 e签宝回调接口") @RequestMapping(value = "/callback/esign", produces = { "application/json" }) public class EsignCallBackController { @Autowired private HttpServletRequest request; // @Autowired // private HttpServletResponse response; private static final String appSecret = "7b100813cca2746081c57837855ac5af"; @PostMapping(value = "/dev") // TODO @ApiOperation(value = "合同流程结束通知(dev)", httpMethod = "POST", notes = "接口发布说明") public Integer wxcallback_test() { String res = null; SafeVerify sv = new SafeVerify(); try { res = sv.checkPass(request, appSecret); // response.setCharacterEncoding("UTF-8"); // response.getWriter().append("Served at: ").append(request.getContextPath()).append("\n") // .append("是否通过验证:----》").append(res); } catch (IOException e) { e.printStackTrace(); } if (res != null && res.equals("true")) return 200; // 返回响应码 return 500; } }