Commit 06cadb45 by XiaHou

云应用相关的业务代码

parent 4839b5f8
...@@ -21,33 +21,39 @@ import javax.servlet.http.HttpServletRequest; ...@@ -21,33 +21,39 @@ import javax.servlet.http.HttpServletRequest;
@Controller @Controller
@RequestMapping(value = "/wx") @RequestMapping(value = "/wx")
@Api(tags = "安泰乐微信相关接口") @Api(tags = "安泰乐微信相关接口")
@CrossOrigin(origins = "*",maxAge = 3600) @CrossOrigin(origins = "*", maxAge = 3600)
public class AtlWxController extends BaseController{ public class AtlWxController extends BaseController {
@Autowired @Autowired
private AtlWxService atlWxService; private AtlWxService atlWxService;
@RequestMapping(value = "getQrcodeUrl",method = RequestMethod.GET) @RequestMapping(value = "getQrcodeUrl", method = RequestMethod.GET)
@ApiOperation("获取二维码链接地址(微信网页应用)") @ApiOperation("获取二维码链接地址(微信网页应用)")
@ResponseBody @ResponseBody
public JsonResult getQrcodeUrl() { public JsonResult getQrcodeUrl() {
return this.atlWxService.getQrcodeUrl(); return this.atlWxService.getQrcodeUrl();
} }
@RequestMapping(value = "getQrcodeAndState",method = RequestMethod.GET) @RequestMapping(value = "getQrcodeAndState", method = RequestMethod.GET)
@ApiOperation("微信二维码回调地址,通过微信code换取openId等信息(微信网页应用)") @ApiOperation("微信二维码回调地址,通过微信code换取openId等信息(微信网页应用)")
@ResponseBody @ResponseBody
public JsonResult getQrcodeAndState(@RequestParam(value = "code", required = true) String code, @RequestParam(value = "state", required = false) String state) { public JsonResult getQrcodeAndState(@RequestParam(value = "code", required = true) String code, @RequestParam(value = "state", required = false) String state) {
return this.atlWxService.getAccessToken(code,state,1 ); return this.atlWxService.getAccessToken(code, state, 1);
} }
@RequestMapping(value = "returnQrcodeAndState",method = RequestMethod.GET) @RequestMapping(value = "returnQrcodeAndState", method = RequestMethod.GET)
@ApiOperation("重定向:返回微信Code与state(微信网页应用)") @ApiOperation("重定向:返回微信Code与state(微信网页应用)")
public String returnQrcodeAndState(@RequestParam(value = "code", required = true) String code, @RequestParam(value = "state", required = true) String state) { public String returnQrcodeAndState(@RequestParam(value = "code", required = true) String code,
return "redirect:https://www.atl-life.com/#/bindPage?code="+code+"&state="+state; @RequestParam(value = "state", required = true) String state,
@RequestParam(value = "timeId", required = false) Long timeId) {
//时光纪模板 网页版需要用到登录 先和官网appid登录一起使用
if (timeId != null) {
return "redirect:https://go.yunzhongci.com/?code=" + code + "&state=" + state + "&timerid=" + timeId;
}
return "redirect:https://www.atl-life.com/#/bindPage?code=" + code + "&state=" + state;
} }
@RequestMapping(value = "insertAtlUserByWxLogin",method = RequestMethod.POST) @RequestMapping(value = "insertAtlUserByWxLogin", method = RequestMethod.POST)
@ApiOperation("新用户微信扫码登录,绑定手机号密码(微信网页应用)") @ApiOperation("新用户微信扫码登录,绑定手机号密码(微信网页应用)")
@ResponseBody @ResponseBody
public JsonResult insertAtlUserByWxLogin(@ApiParam(value = "传入对象") @RequestBody WxInsertUserParam wxInsertUserParam) { public JsonResult insertAtlUserByWxLogin(@ApiParam(value = "传入对象") @RequestBody WxInsertUserParam wxInsertUserParam) {
...@@ -56,14 +62,14 @@ public class AtlWxController extends BaseController{ ...@@ -56,14 +62,14 @@ public class AtlWxController extends BaseController{
return this.atlWxService.insertAtlUserByWxLogin(wxInsertUserParam); return this.atlWxService.insertAtlUserByWxLogin(wxInsertUserParam);
} }
@RequestMapping(value = "getOfficeAccessToken",method = RequestMethod.GET) @RequestMapping(value = "getOfficeAccessToken", method = RequestMethod.GET)
@ApiOperation("获取公众号accessToken,通过微信code换取openId等信息(公众号应用)") @ApiOperation("获取公众号accessToken,通过微信code换取openId等信息(公众号应用)")
@ResponseBody @ResponseBody
public JsonResult getOfficeAccessToken(@RequestParam(value = "code", required = true) String code, @RequestParam(value = "state", required = false) String state) { public JsonResult getOfficeAccessToken(@RequestParam(value = "code", required = true) String code, @RequestParam(value = "state", required = false) String state) {
return this.atlWxService.getAccessToken(code,state,2 ); return this.atlWxService.getAccessToken(code, state, 2);
} }
@RequestMapping(value = "insertAtlUserByOfficeWxLogin",method = RequestMethod.POST) @RequestMapping(value = "insertAtlUserByOfficeWxLogin", method = RequestMethod.POST)
@ApiOperation("绑定手机号密码(公众号应用)") @ApiOperation("绑定手机号密码(公众号应用)")
@ResponseBody @ResponseBody
public JsonResult insertAtlUserByOfficeWxLogin(@ApiParam(value = "传入对象") @RequestBody WxInsertUserParam wxInsertUserParam) { public JsonResult insertAtlUserByOfficeWxLogin(@ApiParam(value = "传入对象") @RequestBody WxInsertUserParam wxInsertUserParam) {
...@@ -79,4 +85,11 @@ public class AtlWxController extends BaseController{ ...@@ -79,4 +85,11 @@ public class AtlWxController extends BaseController{
return this.atlWxService.officeWxPayByJsapi(wxPayCreateOrderQureyParam); return this.atlWxService.officeWxPayByJsapi(wxPayCreateOrderQureyParam);
} }
@RequestMapping(value = "getWebTimeQrcodeUrl", method = RequestMethod.GET)
@ApiOperation("网页版时光纪获取二维码链接地址(微信网页应用)")
@ResponseBody
public JsonResult getWebTimeQrcodeUrl(@RequestParam(value = "timeId", required = true) Long timeId) {
return this.atlWxService.getWebTimeQrcodeUrl(timeId);
}
} }
...@@ -88,6 +88,16 @@ public class AtlWxService { ...@@ -88,6 +88,16 @@ public class AtlWxService {
} }
/** /**
* 组装拼接网页版时光纪登录url
*
* @return
*/
public JsonResult getWebTimeQrcodeUrl(Long timeId) {
String url = "https://open.weixin.qq.com/connect/qrconnect?appid=" + appid + "&redirect_uri=" + redirectUri+"?timeId="+timeId+ "&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect";
return JsonResult.success("获取微信登录链接成功", url);
}
/**
* 获取accessToken * 获取accessToken
* *
* @param code 微信换取accessToken code 必传 * @param code 微信换取accessToken code 必传
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment