| | |
| | | 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; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * FloatServer |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "FloatServer") |
| | | @RestController |
| | | @RequestMapping("/floatserver") |
| | | 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; |
| | |
| | | String rs = helper.b(data); |
| | | System.out.println("Lic: " + rs); |
| | | } catch (Exception ex) { |
| | | System.out.println(ex.getStackTrace()); |
| | | System.out.println(Arrays.toString(ex.getStackTrace())); |
| | | } |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseSecret"}) |
| | | @PostMapping({"/licenseEncryption/getLicenseSecret"}) |
| | | public void getLicenseSecret(HttpServletResponse res) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseSecret |
| | | String json = JSON.toJSONString(new SdkSecretEntity()); |
| | | WebHelper.writeStr2Page(res, json); |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseDecrypt"}) |
| | | @PostMapping({"/licenseEncryption/getLicenseDecrypt"}) |
| | | public void getLicenseDecrypt(HttpServletResponse res) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseDecrypt |
| | | String json = JSON.toJSONString(new SdkDecryptEntity()); |
| | | WebHelper.writeStr2Page(res, json); |
| | | } |
| | | } |