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
86e24d85
You need to sign in or sign up before continuing.
Commit
86e24d85
authored
Jan 30, 2017
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new types and services
parent
0b50b254
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
210 additions
and
0 deletions
+210
-0
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
...ain/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
+37
-0
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormDataContainer.java
...kz/arta/synergy/api/asforms/pojo/AsFormDataContainer.java
+16
-0
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormWrapper.java
.../java/kz/arta/synergy/api/asforms/pojo/AsFormWrapper.java
+27
-0
src/main/java/kz/arta/synergy/api/pojo/Registry.java
src/main/java/kz/arta/synergy/api/pojo/Registry.java
+56
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
+45
-0
src/main/java/kz/arta/synergy/api/services/PositionsService.java
...n/java/kz/arta/synergy/api/services/PositionsService.java
+7
-0
src/main/java/kz/arta/synergy/api/services/RegistryService.java
...in/java/kz/arta/synergy/api/services/RegistryService.java
+15
-0
src/main/java/kz/arta/synergy/api/services/UserService.java
src/main/java/kz/arta/synergy/api/services/UserService.java
+7
-0
No files found.
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
View file @
86e24d85
...
...
@@ -160,4 +160,41 @@ public class AsFormData extends AsFormDataContainer {
asFormData
.
setValue
(
value
);
return
asFormData
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
if
(!
super
.
equals
(
o
))
return
false
;
AsFormData
that
=
(
AsFormData
)
o
;
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
if
(
type
!=
null
?
!
type
.
equals
(
that
.
type
)
:
that
.
type
!=
null
)
return
false
;
if
(
label
!=
null
?
!
label
.
equals
(
that
.
label
)
:
that
.
label
!=
null
)
return
false
;
if
(
value
!=
null
?
!
value
.
equals
(
that
.
value
)
:
that
.
value
!=
null
)
return
false
;
if
(
key
!=
null
?
!
key
.
equals
(
that
.
key
)
:
that
.
key
!=
null
)
return
false
;
if
(
valueID
!=
null
?
!
valueID
.
equals
(
that
.
valueID
)
:
that
.
valueID
!=
null
)
return
false
;
if
(
username
!=
null
?
!
username
.
equals
(
that
.
username
)
:
that
.
username
!=
null
)
return
false
;
if
(
userID
!=
null
?
!
userID
.
equals
(
that
.
userID
)
:
that
.
userID
!=
null
)
return
false
;
if
(
values
!=
null
?
!
values
.
equals
(
that
.
values
)
:
that
.
values
!=
null
)
return
false
;
return
!(
keys
!=
null
?
!
keys
.
equals
(
that
.
keys
)
:
that
.
keys
!=
null
);
}
@Override
public
int
hashCode
()
{
int
result
=
super
.
hashCode
();
result
=
31
*
result
+
(
id
!=
null
?
id
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
type
!=
null
?
type
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
label
!=
null
?
label
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
value
!=
null
?
value
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
key
!=
null
?
key
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
valueID
!=
null
?
valueID
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
username
!=
null
?
username
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
userID
!=
null
?
userID
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
values
!=
null
?
values
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
keys
!=
null
?
keys
.
hashCode
()
:
0
);
return
result
;
}
}
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormDataContainer.java
View file @
86e24d85
...
...
@@ -75,4 +75,20 @@ public class AsFormDataContainer {
}
this
.
data
.
add
(
data
);
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
AsFormDataContainer
that
=
(
AsFormDataContainer
)
o
;
return
!(
data
!=
null
?
!
data
.
equals
(
that
.
data
)
:
that
.
data
!=
null
);
}
@Override
public
int
hashCode
()
{
return
data
!=
null
?
data
.
hashCode
()
:
0
;
}
}
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormWrapper.java
View file @
86e24d85
...
...
@@ -57,4 +57,31 @@ public class AsFormWrapper extends AsFormDataContainer {
this
.
version
=
version
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
if
(!
super
.
equals
(
o
))
return
false
;
AsFormWrapper
that
=
(
AsFormWrapper
)
o
;
if
(
nodeUUID
!=
null
?
!
nodeUUID
.
equals
(
that
.
nodeUUID
)
:
that
.
nodeUUID
!=
null
)
return
false
;
if
(
uuid
!=
null
?
!
uuid
.
equals
(
that
.
uuid
)
:
that
.
uuid
!=
null
)
return
false
;
if
(
form
!=
null
?
!
form
.
equals
(
that
.
form
)
:
that
.
form
!=
null
)
return
false
;
if
(
modified
!=
null
?
!
modified
.
equals
(
that
.
modified
)
:
that
.
modified
!=
null
)
return
false
;
boolean
b
=
!(
version
!=
null
?
!
version
.
equals
(
that
.
version
)
:
that
.
version
!=
null
);
return
b
&&
super
.
equals
(
o
);
}
@Override
public
int
hashCode
()
{
int
result
=
super
.
hashCode
();
result
=
31
*
result
+
(
nodeUUID
!=
null
?
nodeUUID
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
uuid
!=
null
?
uuid
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
form
!=
null
?
form
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
modified
!=
null
?
modified
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
version
!=
null
?
version
.
hashCode
()
:
0
);
return
result
;
}
}
src/main/java/kz/arta/synergy/api/pojo/Registry.java
0 → 100644
View file @
86e24d85
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
/**
* @author raimbek
* @since 28.01.2017
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
Registry
{
private
String
columnCount
;
private
String
name
;
private
String
formId
;
private
String
code
;
private
String
registryID
;
public
String
getColumnCount
()
{
return
columnCount
;
}
public
void
setColumnCount
(
String
columnCount
)
{
this
.
columnCount
=
columnCount
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getFormId
()
{
return
formId
;
}
public
void
setFormId
(
String
formId
)
{
this
.
formId
=
formId
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getRegistryID
()
{
return
registryID
;
}
public
void
setRegistryID
(
String
registryID
)
{
this
.
registryID
=
registryID
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyUser.java
View file @
86e24d85
...
...
@@ -164,4 +164,49 @@ public class SynergyUser {
public
void
setPrivateFolder
(
String
privateFolder
)
{
this
.
privateFolder
=
privateFolder
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
SynergyUser
that
=
(
SynergyUser
)
o
;
if
(
userid
!=
null
?
!
userid
.
equals
(
that
.
userid
)
:
that
.
userid
!=
null
)
return
false
;
if
(
lastname
!=
null
?
!
lastname
.
equals
(
that
.
lastname
)
:
that
.
lastname
!=
null
)
return
false
;
if
(
firstname
!=
null
?
!
firstname
.
equals
(
that
.
firstname
)
:
that
.
firstname
!=
null
)
return
false
;
if
(
patronymic
!=
null
?
!
patronymic
.
equals
(
that
.
patronymic
)
:
that
.
patronymic
!=
null
)
return
false
;
if
(
mail
!=
null
?
!
mail
.
equals
(
that
.
mail
)
:
that
.
mail
!=
null
)
return
false
;
if
(
jid
!=
null
?
!
jid
.
equals
(
that
.
jid
)
:
that
.
jid
!=
null
)
return
false
;
if
(
code
!=
null
?
!
code
.
equals
(
that
.
code
)
:
that
.
code
!=
null
)
return
false
;
if
(
access
!=
null
?
!
access
.
equals
(
that
.
access
)
:
that
.
access
!=
null
)
return
false
;
if
(
admin
!=
null
?
!
admin
.
equals
(
that
.
admin
)
:
that
.
admin
!=
null
)
return
false
;
if
(
configurator
!=
null
?
!
configurator
.
equals
(
that
.
configurator
)
:
that
.
configurator
!=
null
)
return
false
;
if
(
modified
!=
null
?
!
modified
.
equals
(
that
.
modified
)
:
that
.
modified
!=
null
)
return
false
;
if
(
positions
!=
null
?
!
positions
.
equals
(
that
.
positions
)
:
that
.
positions
!=
null
)
return
false
;
if
(
login
!=
null
?
!
login
.
equals
(
that
.
login
)
:
that
.
login
!=
null
)
return
false
;
if
(
password
!=
null
?
!
password
.
equals
(
that
.
password
)
:
that
.
password
!=
null
)
return
false
;
return
!(
privateFolder
!=
null
?
!
privateFolder
.
equals
(
that
.
privateFolder
)
:
that
.
privateFolder
!=
null
);
}
@Override
public
int
hashCode
()
{
int
result
=
userid
!=
null
?
userid
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
lastname
!=
null
?
lastname
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
firstname
!=
null
?
firstname
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
patronymic
!=
null
?
patronymic
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
mail
!=
null
?
mail
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
jid
!=
null
?
jid
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
code
!=
null
?
code
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
access
!=
null
?
access
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
admin
!=
null
?
admin
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
configurator
!=
null
?
configurator
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
modified
!=
null
?
modified
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
positions
!=
null
?
positions
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
login
!=
null
?
login
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
password
!=
null
?
password
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
privateFolder
!=
null
?
privateFolder
.
hashCode
()
:
0
);
return
result
;
}
}
src/main/java/kz/arta/synergy/api/services/PositionsService.java
View file @
86e24d85
...
...
@@ -65,4 +65,11 @@ public class PositionsService {
.
queryParam
(
"userID"
,
userId
);
return
restHttpQuery
.
doQuery
(
query
);
}
public
String
deletePosition
(
String
positionId
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/positions/delete"
)
.
queryParam
(
"positionID"
,
positionId
);
return
restHttpQuery
.
doQuery
(
query
);
}
}
src/main/java/kz/arta/synergy/api/services/RegistryService.java
View file @
86e24d85
...
...
@@ -5,6 +5,7 @@ import kz.arta.synergy.api.Query;
import
kz.arta.synergy.api.QueryContext
;
import
kz.arta.synergy.api.RestHttpQuery
;
import
kz.arta.synergy.api.asforms.pojo.RegistryRecord
;
import
kz.arta.synergy.api.pojo.Registry
;
import
java.io.IOException
;
...
...
@@ -39,4 +40,18 @@ public class RegistryService {
.
queryParam
(
"dataUUID"
,
dataUUID
);
return
restHttpQuery
.
doQuery
(
query
);
}
public
String
deleteRecord
(
String
dataUUID
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/registry/delete_doc"
)
.
queryParam
(
"dataUUID"
,
dataUUID
);
return
restHttpQuery
.
doQuery
(
query
);
}
public
Registry
getRegistry
(
String
code
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/registry/info"
)
.
queryParam
(
"code"
,
code
);
return
JsonUtils
.
read
(
restHttpQuery
.
doQuery
(
query
),
Registry
.
class
);
}
}
src/main/java/kz/arta/synergy/api/services/UserService.java
View file @
86e24d85
...
...
@@ -43,4 +43,11 @@ public class UserService {
String
result
=
restHttpQuery
.
doQuery
(
Query
.
newInstance
().
url
(
"/rest/api/filecabinet/user/"
+
userID
));
return
JsonUtils
.
read
(
result
,
SynergyUser
.
class
);
}
public
String
deleteUser
(
String
id
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/filecabinet/user/delete"
)
.
queryParam
(
"userID"
,
id
);
return
restHttpQuery
.
doQuery
(
query
);
}
}
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