Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
QianQiXiang
haoban-manage3.0
Commits
bc4d16ff
Commit
bc4d16ff
authored
Mar 03, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
290dd0e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
Config.java
...rc/main/java/com/gic/haoban/manage/web/config/Config.java
+43
-0
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+5
-2
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/config/Config.java
0 → 100644
View file @
bc4d16ff
package
com
.
gic
.
haoban
.
manage
.
web
.
config
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
/**
* Created by tgs on 2020/2/23.
*/
@Configuration
@EnableApolloConfig
public
class
Config
{
@Value
(
"${corpid}"
)
private
String
corpid
;
@Value
(
"${suiteid}"
)
private
String
suiteId
;
@Value
(
"${host}"
)
private
String
host
;
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getSuiteId
()
{
return
suiteId
;
}
public
void
setSuiteId
(
String
suiteId
)
{
this
.
suiteId
=
suiteId
;
}
public
String
getHost
()
{
return
host
;
}
public
void
setHost
(
String
host
)
{
this
.
host
=
host
;
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
bc4d16ff
...
...
@@ -10,6 +10,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
...
...
@@ -26,9 +27,11 @@ public class InfoController extends WebBaseController{
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
Config
config
;
@RequestMapping
(
"get-info-by-code"
)
public
HaobanResponse
getInfoByCode
(
String
code
)
{
String
userDTOJson
=
qywxCorpApiService
.
getUserInfoSimple
(
siteId
,
code
);
String
userDTOJson
=
qywxCorpApiService
.
getUserInfoSimple
(
config
.
getSuiteId
()
,
code
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
String
userId
=
user
.
getUserid
();
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
...
...
@@ -43,7 +46,7 @@ public class InfoController extends WebBaseController{
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
siteId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getSuiteId
()
);
InfoVo
infoVo
=
new
InfoVo
();
infoVo
.
setAccessToken
(
accesstoken
);
infoVo
.
setStaffId
(
loginStaff
.
getStaffId
());
...
...
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