Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
b558724e
Commit
b558724e
authored
Sep 27, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
147fabd7
22eec2e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-1
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+19
-0
ChwUserController.java
...ub/wxiaoqi/security/admin/rest/chw/ChwUserController.java
+34
-1
UserRest.java
.../java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
+6
-0
UserMapper.xml
...odules/ace-admin/src/main/resources/mapper/UserMapper.xml
+3
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
b558724e
...
@@ -52,6 +52,25 @@ public class AuthController {
...
@@ -52,6 +52,25 @@ public class AuthController {
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
}
}
@RequestMapping
(
value
=
"/chw/token"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
String
>
chwCreateAuthenticationToken
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
,
HttpServletRequest
request
)
throws
Exception
{
log
.
info
(
authenticationRequest
.
getUsername
()+
" require logging..."
);
// keliii 分请求类型处理token
String
requestType
=
request
.
getHeader
(
RequestTypeConstants
.
HEADER_KEY
);
if
(
requestType
==
null
||
requestType
.
trim
().
equals
(
""
))
{
requestType
=
RequestTypeConstants
.
BASE
;
}
final
String
token
;
if
(
RequestTypeConstants
.
APP
.
equals
(
requestType
))
{
token
=
appAuthService
.
login
(
authenticationRequest
);
}
else
{
token
=
authService
.
login
(
authenticationRequest
);
}
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
}
@RequestMapping
(
value
=
"token/small"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"token/small"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
String
>
createAuthenticationTokenSmall
(
public
ObjectRestResponse
<
String
>
createAuthenticationTokenSmall
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
,
@RequestBody
JwtAuthenticationRequest
authenticationRequest
,
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/chw/ChwUserController.java
View file @
b558724e
...
@@ -31,6 +31,7 @@ import java.util.List;
...
@@ -31,6 +31,7 @@ import java.util.List;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_OPERATE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_OPERATE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -40,7 +41,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.
...
@@ -40,7 +41,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.
*/
*/
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"user"
)
@RequestMapping
(
"
/chw/
user"
)
public
class
ChwUserController
extends
CommonBaseController
implements
UserRestInterface
{
public
class
ChwUserController
extends
CommonBaseController
implements
UserRestInterface
{
public
final
static
Integer
CURRENT_COMPANY
=
1
;
public
final
static
Integer
CURRENT_COMPANY
=
1
;
...
@@ -98,6 +99,8 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -98,6 +99,8 @@ public class ChwUserController extends CommonBaseController implements UserRestI
@IgnoreClientToken
@IgnoreClientToken
public
ObjectRestResponse
<
User
>
add
(
@RequestBody
UserController
.
UserVO
vo
)
{
public
ObjectRestResponse
<
User
>
add
(
@RequestBody
UserController
.
UserVO
vo
)
{
String
username
=
vo
.
getUsername
();
String
username
=
vo
.
getUsername
();
vo
.
setBizType
(
BIZ_TYPE_OPERATE
);
vo
.
setStatus
(
SYS_TRUE
);
if
(
StringUtils
.
isNotBlank
(
username
))
{
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
...
@@ -110,6 +113,36 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -110,6 +113,36 @@ public class ChwUserController extends CommonBaseController implements UserRestI
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ObjectRestResponse
<
User
>
update
(
@RequestBody
UserController
.
UserVO
vo
)
{
handleDataLimit
(
vo
);
String
username
=
vo
.
getUsername
();
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
if
(
list
.
size
()
>
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
if
(
list
.
size
()
==
1
)
{
User
user
=
list
.
get
(
0
);
if
(!
user
.
getId
().
equals
(
vo
.
getId
()))
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
}
}
userBiz
.
updateSelectiveById
(
vo
);
//添加权限关系
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
return
new
ObjectRestResponse
<
User
>();
}
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
public
ObjectRestResponse
<
User
>
remove
(
@PathVariable
int
id
)
{
userBiz
.
deleteById
(
id
);
return
new
ObjectRestResponse
<
User
>();
}
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
if
(
null
!=
dto
.
getDataLimit
())
{
if
(
null
!=
dto
.
getDataLimit
())
{
dto
.
setDataCompany
(
""
);
dto
.
setDataCompany
(
""
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
View file @
b558724e
...
@@ -40,6 +40,12 @@ public class UserRest {
...
@@ -40,6 +40,12 @@ public class UserRest {
public
@ResponseBody
UserInfo
validate
(
@RequestBody
Map
<
String
,
String
>
body
){
public
@ResponseBody
UserInfo
validate
(
@RequestBody
Map
<
String
,
String
>
body
){
return
permissionService
.
validate
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
return
permissionService
.
validate
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
}
}
@RequestMapping
(
value
=
"/user/chw/validate"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
UserInfo
chwValidate
(
@RequestBody
Map
<
String
,
String
>
body
){
return
permissionService
.
validate
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
}
@RequestMapping
(
value
=
"/user/validate/small"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/validate/small"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
UserInfo
validateSmall
(
@RequestBody
Map
<
String
,
String
>
body
){
public
@ResponseBody
UserInfo
validateSmall
(
@RequestBody
Map
<
String
,
String
>
body
){
return
permissionService
.
validateSmall
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
return
permissionService
.
validateSmall
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
...
...
ace-modules/ace-admin/src/main/resources/mapper/UserMapper.xml
View file @
b558724e
...
@@ -71,6 +71,9 @@
...
@@ -71,6 +71,9 @@
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
<where>
<where>
<if
test=
"bizType != null"
>
and u.biz_type = #{bizType}
</if>
<if
test=
"companyId != null and companyId > 0"
>
<if
test=
"companyId != null and companyId > 0"
>
and u.company_id = #{companyId}
and u.company_id = #{companyId}
</if>
</if>
...
...
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