Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
config-server-api
Project
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
何熠
config-server-api
Commits
f9467261
Commit
f9467261
authored
Dec 29, 2021
by
zhaoxiaolei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LDAP
parent
3ba85684
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
81 additions
and
66 deletions
+81
-66
config-server-api.iml
config-server-api.iml
+24
-5
IntegrateController.java
.../uitech/authorization/controller/IntegrateController.java
+9
-4
aquanTest.java
...ava/cn/com/uitech/authorization/controller/aquanTest.java
+0
-19
UserInfoMapper.java
...va/cn/com/uitech/authorization/mapper/UserInfoMapper.java
+2
-0
Person.java
.../java/cn/com/uitech/authorization/pojo/entity/Person.java
+30
-0
UserInfo.java
...ava/cn/com/uitech/authorization/pojo/entity/UserInfo.java
+1
-1
IntegrateService.java
...cn/com/uitech/authorization/service/IntegrateService.java
+2
-2
IntegrateServiceImpl.java
...tech/authorization/service/impl/IntegrateServiceImpl.java
+0
-0
TempServiceImpl.java
...om/uitech/authorization/service/impl/TempServiceImpl.java
+1
-0
application-lcrx-prod.yml
src/main/resources/application-lcrx-prod.yml
+5
-0
application.yml
src/main/resources/application.yml
+1
-1
UserInfoMapper.xml
src/main/resources/mapper/UserInfoMapper.xml
+6
-1
IntegrateServiceTest.java
...om/uitech/authorization/service/IntegrateServiceTest.java
+0
-33
No files found.
config-server-api.iml
View file @
f9467261
...
...
@@ -7,6 +7,10 @@
<facet
type=
"web"
name=
"Web"
>
<configuration>
<webroots
/>
<sourceRoots>
<root
url=
"file://$MODULE_DIR$/src/main/java"
/>
<root
url=
"file://$MODULE_DIR$/src/main/resources"
/>
</sourceRoots>
</configuration>
</facet>
<facet
type=
"kotlin-language"
name=
"Kotlin"
>
...
...
@@ -38,6 +42,7 @@
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
...
...
@@ -78,8 +83,6 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.annotation:javax.annotation-api:1.3.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-core:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"RUNTIME"
name=
"Maven: org.yaml:snakeyaml:1.23"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
@@ -123,6 +126,25 @@
<orderEntry
type=
"library"
name=
"Maven: io.netty:netty-resolver:4.1.36.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.projectreactor:reactor-core:3.2.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.reactivestreams:reactive-streams:1.0.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-test:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-test:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.jayway.jsonpath:json-path:2.4.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.minidev:json-smart:2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.minidev:accessors-smart:1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.ow2.asm:asm:5.0.4"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.assertj:assertj-core:3.11.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mockito:mockito-core:2.23.4"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.bytebuddy:byte-buddy:1.9.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.bytebuddy:byte-buddy-agent:1.9.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.objenesis:objenesis:2.6"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hamcrest:hamcrest-core:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hamcrest:hamcrest-library:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.skyscreamer:jsonassert:1.5.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-core:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: redis.clients:jedis:2.9.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.apache.commons:commons-pool2:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"PROVIDED"
name=
"Maven: org.projectlombok:lombok:1.18.8"
level=
"project"
/>
...
...
@@ -156,7 +178,6 @@
<orderEntry
type=
"library"
name=
"Maven: jakarta.persistence:jakarta.persistence-api:2.2.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hibernate:hibernate-core:5.3.10.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.javassist:javassist:3.23.2-GA"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: net.bytebuddy:byte-buddy:1.9.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: antlr:antlr:2.7.7"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.jboss:jandex:2.0.5.Final"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.dom4j:dom4j:2.1.1"
level=
"project"
/>
...
...
@@ -197,6 +218,5 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework.data:spring-data-ldap:2.1.8.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.ldap:spring-ldap-core:2.3.2.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: junit:junit:4.12"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.hamcrest:hamcrest-core:1.3"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
src/main/java/cn/com/uitech/authorization/controller/IntegrateController.java
View file @
f9467261
...
...
@@ -19,6 +19,7 @@ import org.springframework.http.HttpEntity;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.ldap.filter.EqualsFilter
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.validation.Errors
;
...
...
@@ -349,12 +350,16 @@ public class IntegrateController {
return
ResultGenerator
.
genSuccessResult
(
integrateService
.
getUserDimension
(
userinfo
));
}
@PostMapping
(
"/checkToken"
)
@PostMapping
(
"/check
User
Token"
)
@ApiOperation
(
value
=
"检查token是否过期"
,
notes
=
"checkToken"
,
httpMethod
=
"POST"
)
public
CrmResponseEntity
<?>
checkToken
(
@RequestBody
UserInfo
userinfo
)
{
return
ResultGenerator
.
genSuccessResult
(
integrateService
.
checkToken
(
userinfo
));
public
CrmResponseEntity
<?>
check
User
Token
(
@RequestBody
UserInfo
userinfo
)
{
return
ResultGenerator
.
genSuccessResult
(
integrateService
.
check
User
Token
(
userinfo
));
}
@PostMapping
(
"/ldapAuth"
)
@ApiOperation
(
value
=
"登录LDAP验证用户"
,
notes
=
"ldapAuth"
,
httpMethod
=
"POST"
)
public
CrmResponseEntity
<?>
ldapAuth
(
@RequestBody
UserInfo
userinfo
)
{
return
ResultGenerator
.
genSuccessResult
(
integrateService
.
ldapAuth
(
userinfo
));
}
}
src/main/java/cn/com/uitech/authorization/controller/aquanTest.java
deleted
100644 → 0
View file @
3ba85684
package
cn
.
com
.
uitech
.
authorization
.
controller
;
import
cn.com.uitech.authorization.service.IntegrateService
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
@Controller
public
class
aquanTest
{
@Autowired
IntegrateService
integrateService
;
@Test
public
void
testOne
()
{
System
.
out
.
println
(
"验证结果"
+
integrateService
.
ldapAuth
(
"ldapupdate"
,
"6KRutglNdiXp"
));
}
}
\ No newline at end of file
src/main/java/cn/com/uitech/authorization/mapper/UserInfoMapper.java
View file @
f9467261
...
...
@@ -11,4 +11,6 @@ public interface UserInfoMapper extends IBaseMapper<UserInfo> {
UserInfo
getUser
(
UserInfo
userinfo
);
List
<
MenuInfo
>
getUserDimension
(
String
userCode
);
UserInfo
getUserOne
(
UserInfo
userinfo
);
}
src/main/java/cn/com/uitech/authorization/pojo/entity/Person.java
0 → 100644
View file @
f9467261
package
cn
.
com
.
uitech
.
authorization
.
pojo
.
entity
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
org.springframework.ldap.odm.annotations.Attribute
;
import
org.springframework.ldap.odm.annotations.Entry
;
import
org.springframework.ldap.odm.annotations.Id
;
import
javax.naming.Name
;
@Entry
(
objectClasses
=
{
"person"
})
public
class
Person
{
@Id
@JsonIgnore
// 必写
private
Name
distinguishedName
;
/* 登录账号 */
@Attribute
(
name
=
"sAMAccountName"
)
private
String
loginName
;
/* 用户姓名 */
@Attribute
(
name
=
"cn"
)
private
String
userName
;
/* 邮箱 */
@Attribute
(
name
=
"mail"
)
private
String
email
;
// gettet...setter...toString...
}
\ No newline at end of file
src/main/java/cn/com/uitech/authorization/pojo/entity/UserInfo.java
View file @
f9467261
...
...
@@ -21,7 +21,7 @@ public class UserInfo {
@Column
(
name
=
"user_code"
)
private
String
userCode
;
@Column
(
name
=
"pass_word"
)
private
String
pass
w
ord
;
private
String
pass
W
ord
;
@Column
(
name
=
"user_name"
)
private
String
userName
;
@Column
(
name
=
"user_dimension"
)
...
...
src/main/java/cn/com/uitech/authorization/service/IntegrateService.java
View file @
f9467261
...
...
@@ -47,7 +47,7 @@ public interface IntegrateService {
Object
getUserDimension
(
UserInfo
userinfo
);
Object
checkToken
(
UserInfo
userinfo
);
Object
check
User
Token
(
UserInfo
userinfo
);
boolean
ldapAuth
(
String
username
,
String
passWord
);
Object
ldapAuth
(
UserInfo
userinfo
);
}
src/main/java/cn/com/uitech/authorization/service/impl/IntegrateServiceImpl.java
View file @
f9467261
This diff is collapsed.
Click to expand it.
src/main/java/cn/com/uitech/authorization/service/impl/TempServiceImpl.java
View file @
f9467261
...
...
@@ -120,6 +120,7 @@ public class TempServiceImpl implements TempServer {
result
.
setMsg
(
msg
);
}
}
getTempList
();
}
else
{
result
.
setCode
(
200
);
result
.
setMsg
(
"数据初始化完成"
);
...
...
src/main/resources/application-lcrx-prod.yml
View file @
f9467261
...
...
@@ -36,6 +36,11 @@ spring:
sleuth
:
sampler
:
probability
:
1.0
ldap
:
urls
:
ldap://10.0.2.3:389
base
:
OU=紫光计算机,DC=unispc,DC=com
username
:
ldapupdate
password
:
6KRutglNdiXp
selector
:
url
:
http://172.16.0.89:8080/api/v1/selector
...
...
src/main/resources/application.yml
View file @
f9467261
...
...
@@ -2,7 +2,7 @@ server:
port
:
8081
spring
:
profiles
:
active
:
lcrx
-prod
active
:
lcrx
application
:
name
:
${APPLICATION_NAME:uitech}--${SERVICE_NAME:system}
# 遇到相同名字时,是否允许覆盖注册
...
...
src/main/resources/mapper/UserInfoMapper.xml
View file @
f9467261
...
...
@@ -4,7 +4,7 @@
<mapper
namespace=
"cn.com.uitech.authorization.mapper.UserInfoMapper"
>
<select
id=
"getUser"
resultType=
"cn.com.uitech.authorization.pojo.entity.UserInfo"
>
select * from user_info where user_code = #{userCode} and pass_word = #{pass
w
ord}
select * from user_info where user_code = #{userCode} and pass_word = #{pass
W
ord}
</select>
<select
id=
"getUserDimension"
resultType=
"cn.com.uitech.authorization.pojo.entity.MenuInfo"
>
...
...
@@ -17,4 +17,8 @@
WHERE
A.user_code = #{userCode}
</select>
<select
id=
"getUserOne"
resultType=
"cn.com.uitech.authorization.pojo.entity.UserInfo"
>
select * from user_info where user_code = #{userCode}
</select>
</mapper>
\ No newline at end of file
src/test/java/cn/com/uitech/authorization/service/IntegrateServiceTest.java
deleted
100644 → 0
View file @
3ba85684
package
cn
.
com
.
uitech
.
authorization
.
service
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
Assert
.*;
/**
* @Author: ZXN
* @Date: 2021/12/29/11:01
* @Description:
* @version: 1.0
* This Class Created with IntelliJ IDEA 2019.1.4
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
IntegrateServiceTest
{
@Autowired
private
IntegrateService
integrateService
;
@Test
public
void
ldapAuth
()
{
System
.
out
.
println
(
"验证结果"
+
integrateService
.
ldapAuth
(
"ldapupdate"
,
"6KRutglNdiXp"
));
}
}
\ No newline at end of file
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