Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
appApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antaile
appApi
Commits
06cadb45
Commit
06cadb45
authored
Aug 10, 2021
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云应用相关的业务代码
parent
4839b5f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
AtlWxController.java
...java/com/hwstudio/antaile/controller/AtlWxController.java
+25
-12
AtlWxService.java
src/main/java/com/hwstudio/antaile/service/AtlWxService.java
+10
-0
No files found.
src/main/java/com/hwstudio/antaile/controller/AtlWxController.java
View file @
06cadb45
...
@@ -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
);
}
}
}
src/main/java/com/hwstudio/antaile/service/AtlWxService.java
View file @
06cadb45
...
@@ -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 必传
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment