Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fangyeqing
/
xkl-interface
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhaoyue
8 years ago
Commit
64bb2ffc8584660d97a3fc545337aa4c0a5101b2
1 parent
f15f0648
Add admin info inter
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
src/main/java/com/xkl/controller/uploadsoft/AdminInfoController.java
src/main/java/com/xkl/controller/uploadsoft/AdminInfoController.java
0 → 100644
View file @
64bb2ff
package
com
.
xkl
.
controller
.
uploadsoft
;
import
com.wordnik.swagger.annotations.ApiImplicitParam
;
import
com.wordnik.swagger.annotations.ApiImplicitParams
;
import
com.wordnik.swagger.annotations.ApiOperation
;
import
com.xkl.authorization.annotation.*
;
import
com.xkl.config.ResultStatus
;
import
com.xkl.domain.XklAdminEntity
;
import
com.xkl.domain.XklCompanyEntity
;
import
com.xkl.model.AdminLoginModel
;
import
com.xkl.model.ResultModel
;
import
com.xkl.repository.XklCompanyRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 操作员信息查询接口
*/
@RestController
@RequestMapping
(
"/adminInfo"
)
public
class
AdminInfoController
{
@Autowired
private
XklCompanyRepository
xklCompanyRepository
;
@RequestMapping
(
method
=
RequestMethod
.
GET
)
@Authorization
@ApiOperation
(
value
=
"操作员信息查询接口"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"authorization"
,
value
=
"请输入登录返回信息:userId_tokens"
,
required
=
true
,
dataType
=
"string"
,
paramType
=
"header"
),
})
public
ResponseEntity
<
ResultModel
>
getAdminInfo
(
@CurrentAdmin
XklAdminEntity
admin
)
{
XklCompanyEntity
companyEntity
=
xklCompanyRepository
.
findById
(
admin
.
getCoid
());
if
(
companyEntity
==
null
)
{
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
COMPANY_ERROR
),
HttpStatus
.
OK
);
}
AdminLoginModel
adminLoginModel
=
new
AdminLoginModel
(
admin
.
getId
(),
admin
.
getAccount
(),
companyEntity
.
getId
(),
companyEntity
.
getName
(),
""
,
""
);
return
new
ResponseEntity
<>(
ResultModel
.
ok
(
adminLoginModel
),
HttpStatus
.
OK
);
}
}
...
...
Please
register
or
login
to post a comment