| | |
| | | package com.lf.server.controller.all; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.ctrl.SdkDecryptEntity; |
| | | import com.lf.server.entity.ctrl.SdkSecretEntity; |
| | | import com.lf.server.entity.other.FloatServerResponse; |
| | | import com.lf.server.entity.other.ReqParamFloatServer; |
| | | import com.lf.server.helper.HttpHelper; |
| | | import com.lf.server.helper.LicHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import io.swagger.annotations.Api; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.entity.InputStreamEntity; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | public class FloatServerController extends BaseController { |
| | | private static LicHelper licHelper; |
| | | |
| | | private static boolean isRedirect = false; |
| | | private final static boolean IS_REDIRECT = false; |
| | | |
| | | @PostMapping({"/checkout/license"}) |
| | | public void license(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (isRedirect) { |
| | | if (IS_REDIRECT) { |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | httpHelper.service(req, res, "http://192.168.20.43:38080/floatserver/checkout/license", null); |
| | | return; |
| | |
| | | System.out.println(ex.getStackTrace()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseSecret"}) |
| | | public void getLicenseSecret(HttpServletResponse res) { |
| | | try { |
| | | String json = JSON.toJSONString(new SdkSecretEntity()); |
| | | WebHelper.write2Page(res, json); |
| | | } catch (Exception ex) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseSecret |
| | | } |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseDecrypt"}) |
| | | public void getLicenseDecrypt(HttpServletResponse res) { |
| | | try { |
| | | String json = JSON.toJSONString(new SdkDecryptEntity()); |
| | | WebHelper.write2Page(res, json); |
| | | } catch (Exception ex) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseDecrypt |
| | | } |
| | | } |
| | | } |