Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synergy-api-util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raimbek Egemberdiev
synergy-api-util
Commits
9fc2c4b3
Commit
9fc2c4b3
authored
Nov 17, 2016
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
страница администратора npp защищена
parent
7766d560
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
219 additions
and
0 deletions
+219
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
+32
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
+156
-0
src/main/java/kz/arta/synergy/api/services/PersonService.java
...main/java/kz/arta/synergy/api/services/PersonService.java
+31
-0
No files found.
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
0 → 100644
View file @
9fc2c4b3
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
/**
* @author raimbek
* @since 08.08.2016
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyPosition
{
private
String
positionID
;
private
String
departmentID
;
public
SynergyPosition
()
{
}
public
String
getPositionID
()
{
return
positionID
;
}
public
void
setPositionID
(
String
positionID
)
{
this
.
positionID
=
positionID
;
}
public
String
getDepartmentID
()
{
return
departmentID
;
}
public
void
setDepartmentID
(
String
departmentID
)
{
this
.
departmentID
=
departmentID
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
0 → 100644
View file @
9fc2c4b3
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author raimbek
* @since 08.08.2016
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyUser
{
private
String
userid
;
private
String
lastname
;
private
String
firstname
;
private
String
patronymic
;
private
String
mail
;
private
String
jid
;
private
String
code
;
private
String
access
;
private
String
admin
;
private
String
configurator
;
private
String
modified
;
private
List
<
SynergyPosition
>
positions
=
new
ArrayList
<>();
@JsonIgnore
private
String
login
;
@JsonIgnore
private
String
password
;
public
SynergyUser
()
{
}
public
String
getUserid
()
{
return
userid
;
}
public
void
setUserid
(
String
userid
)
{
this
.
userid
=
userid
;
}
public
String
getLastname
()
{
return
lastname
;
}
public
void
setLastname
(
String
lastname
)
{
this
.
lastname
=
lastname
;
}
public
String
getFirstname
()
{
return
firstname
;
}
public
void
setFirstname
(
String
firstname
)
{
this
.
firstname
=
firstname
;
}
public
String
getPatronymic
()
{
return
patronymic
;
}
public
void
setPatronymic
(
String
patronymic
)
{
this
.
patronymic
=
patronymic
;
}
public
String
getMail
()
{
return
mail
;
}
public
void
setMail
(
String
mail
)
{
this
.
mail
=
mail
;
}
public
String
getJid
()
{
return
jid
;
}
public
void
setJid
(
String
jid
)
{
this
.
jid
=
jid
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getAccess
()
{
return
access
;
}
public
void
setAccess
(
String
access
)
{
this
.
access
=
access
;
}
public
String
getAdmin
()
{
return
admin
;
}
public
void
setAdmin
(
String
admin
)
{
this
.
admin
=
admin
;
}
public
String
getConfigurator
()
{
return
configurator
;
}
public
void
setConfigurator
(
String
configurator
)
{
this
.
configurator
=
configurator
;
}
public
String
getModified
()
{
return
modified
;
}
public
void
setModified
(
String
modified
)
{
this
.
modified
=
modified
;
}
public
List
<
SynergyPosition
>
getPositions
()
{
return
positions
;
}
public
void
setPositions
(
List
<
SynergyPosition
>
positions
)
{
this
.
positions
=
positions
;
}
public
String
getFIO
()
{
String
result
=
lastname
;
if
(
firstname
!=
null
)
{
result
+=
" "
+
firstname
;
}
return
result
;
}
public
String
getLogin
()
{
return
login
;
}
public
void
setLogin
(
String
login
)
{
this
.
login
=
login
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
src/main/java/kz/arta/synergy/api/services/PersonService.java
0 → 100644
View file @
9fc2c4b3
package
kz.arta.synergy.api.services
;
import
kz.arta.synergy.api.JsonUtils
;
import
kz.arta.synergy.api.Query
;
import
kz.arta.synergy.api.QueryContext
;
import
kz.arta.synergy.api.RestHttpQuery
;
import
kz.arta.synergy.api.pojo.SynergyUser
;
import
java.io.IOException
;
/**
* @author raimbek
* @since 14.11.2016
*/
public
class
PersonService
{
private
final
RestHttpQuery
restHttpQuery
;
private
PersonService
(
QueryContext
context
)
{
this
.
restHttpQuery
=
new
RestHttpQuery
(
context
);
}
public
static
PersonService
newInstance
(
QueryContext
queryContext
)
{
return
new
PersonService
(
queryContext
);
}
public
SynergyUser
getUser
()
throws
IOException
{
String
user
=
restHttpQuery
.
doQuery
(
Query
.
newInstance
().
url
(
"/rest/api/person/auth"
));
return
JsonUtils
.
read
(
user
,
SynergyUser
.
class
);
}
}
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