Merge branch 'dev' of http://139.159.177.244:3000/hurui/hai-server into dev
commit
9f91550bb7
@ -0,0 +1,75 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.alipay.api.domain.Data; |
||||
import com.cweb.config.SysConst; |
||||
import com.hai.common.pay.util.sdk.WXPayConstants; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.HttpsUtils; |
||||
import com.hai.common.utils.MD5Util; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.common.utils.WxUtils; |
||||
import com.hai.entity.HighUser; |
||||
import com.hai.model.HighUserModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.service.HighUserService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/tPig") |
||||
@Api(value = "千猪接口") |
||||
public class tPigController { |
||||
|
||||
@Resource |
||||
private HighUserService highUserService; |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@RequestMapping(value = "/getTPigToken", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "【小程序】获取千猪Token") |
||||
public ResponseData getH5AccessToken(HttpServletRequest request) { |
||||
try { |
||||
|
||||
// 用户
|
||||
// SessionObject sessionObject = userCenter.getSessionObject(request);
|
||||
// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
|
||||
//
|
||||
// HighUser highUser = highUserService.findByUserId(userInfoModel.getHighUser().getId());
|
||||
|
||||
Map<String, String> params = new HashMap<>(); |
||||
// params.put("platformUniqueId", highUser.getUnionId());
|
||||
// params.put("nickname", highUser.getName());
|
||||
// params.put("mobile", highUser.getPhone());
|
||||
|
||||
params.put("platformUniqueId", "oArhO6WlHsR2e5LuPUbxTcGo4nsQ"); |
||||
params.put("nickname", "Sum1Dream"); |
||||
params.put("platformId", "10376"); |
||||
params.put("mobile", "18090580471"); |
||||
// params.put("timestamp", String.valueOf(new Date().getTime()));
|
||||
params.put("timestamp", "1624793550754"); |
||||
String sign = WxUtils.generateSignaturePig(params, "ktxb49sh2jfhgn8g" , WXPayConstants.SignType.MD5); |
||||
params.put("sign", sign); |
||||
return ResponseMsgUtil.success(HttpsUtils.doGet("https://live-test.qianzhu8.com/api/v2/platform/getToken", params , "")); |
||||
|
||||
} catch (Exception e) { |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue