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
ce8307b2
Commit
ce8307b2
authored
Nov 17, 2016
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
перенесены вызовы api synergy работ
parent
0a0e4cba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
269 additions
and
0 deletions
+269
-0
src/main/java/kz/arta/synergy/api/RestHttpQuery.java
src/main/java/kz/arta/synergy/api/RestHttpQuery.java
+4
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
...main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
+33
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyNotification.java
...in/java/kz/arta/synergy/api/pojo/SynergyNotification.java
+68
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyWork.java
src/main/java/kz/arta/synergy/api/pojo/SynergyWork.java
+117
-0
src/main/java/kz/arta/synergy/api/services/WorkflowService.java
...in/java/kz/arta/synergy/api/services/WorkflowService.java
+47
-0
No files found.
src/main/java/kz/arta/synergy/api/RestHttpQuery.java
View file @
ce8307b2
...
@@ -64,6 +64,10 @@ public class RestHttpQuery {
...
@@ -64,6 +64,10 @@ public class RestHttpQuery {
return
readStringReturn
(
conn
);
return
readStringReturn
(
conn
);
}
}
public
String
doQuery
(
String
url
)
throws
IOException
{
return
doQuery
(
Query
.
newInstance
().
url
(
url
));
}
public
byte
[]
doQueryAndReturnBytes
(
Query
query
)
throws
IOException
{
public
byte
[]
doQueryAndReturnBytes
(
Query
query
)
throws
IOException
{
HttpURLConnection
conn
=
doQueryAndReturnConnection
(
query
);
HttpURLConnection
conn
=
doQueryAndReturnConnection
(
query
);
InputStream
is
=
conn
.
getInputStream
();
InputStream
is
=
conn
.
getInputStream
();
...
...
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
0 → 100644
View file @
ce8307b2
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
/**
* @author raimbek
* @since 08.08.2016
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyDepartment
{
private
String
departmentID
;
private
String
parentDepartmentID
;
public
SynergyDepartment
()
{
}
public
String
getDepartmentID
()
{
return
departmentID
;
}
public
void
setDepartmentID
(
String
departmentID
)
{
this
.
departmentID
=
departmentID
;
}
public
String
getParentDepartmentID
()
{
return
parentDepartmentID
;
}
public
void
setParentDepartmentID
(
String
parentDepartmentID
)
{
this
.
parentDepartmentID
=
parentDepartmentID
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyNotification.java
0 → 100644
View file @
ce8307b2
package
kz.arta.synergy.api.pojo
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author raimbek
* @since 10.08.2016
*/
public
class
SynergyNotification
{
private
String
header
;
private
String
message
;
private
List
<
String
>
users
=
new
ArrayList
<
String
>();
private
List
<
String
>
groups
=
new
ArrayList
<
String
>();
private
List
<
String
>
emails
=
new
ArrayList
<
String
>();
private
List
<
String
>
logins
=
new
ArrayList
<
String
>();
public
SynergyNotification
()
{
}
public
List
<
String
>
getUsers
()
{
return
users
;
}
public
void
setUsers
(
List
<
String
>
users
)
{
this
.
users
=
users
;
}
public
List
<
String
>
getGroups
()
{
return
groups
;
}
public
void
setGroups
(
List
<
String
>
groups
)
{
this
.
groups
=
groups
;
}
public
List
<
String
>
getEmails
()
{
return
emails
;
}
public
void
setEmails
(
List
<
String
>
emails
)
{
this
.
emails
=
emails
;
}
public
String
getHeader
()
{
return
header
;
}
public
void
setHeader
(
String
header
)
{
this
.
header
=
header
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
List
<
String
>
getLogins
()
{
return
logins
;
}
public
void
setLogins
(
List
<
String
>
logins
)
{
this
.
logins
=
logins
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyWork.java
0 → 100644
View file @
ce8307b2
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author raimbek
* @since 10.08.2016
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyWork
{
private
String
name
;
private
String
startDate
;
private
String
finishDate
;
private
String
priority
;
private
String
authorID
;
private
String
resUserID
;
private
String
typeID
;
private
String
actionID
;
private
String
finished
;
private
String
itemID
;
private
List
<
SynergyWork
>
subProcesses
=
new
ArrayList
<
SynergyWork
>();
public
SynergyWork
()
{
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getStartDate
()
{
return
startDate
;
}
public
void
setStartDate
(
String
startDate
)
{
this
.
startDate
=
startDate
;
}
public
String
getFinishDate
()
{
return
finishDate
;
}
public
void
setFinishDate
(
String
finishDate
)
{
this
.
finishDate
=
finishDate
;
}
public
String
getPriority
()
{
return
priority
;
}
public
void
setPriority
(
String
priority
)
{
this
.
priority
=
priority
;
}
public
String
getAuthorID
()
{
return
authorID
;
}
public
void
setAuthorID
(
String
authorID
)
{
this
.
authorID
=
authorID
;
}
public
String
getResUserID
()
{
return
resUserID
;
}
public
void
setResUserID
(
String
resUserID
)
{
this
.
resUserID
=
resUserID
;
}
public
String
getTypeID
()
{
return
typeID
;
}
public
void
setTypeID
(
String
typeID
)
{
this
.
typeID
=
typeID
;
}
public
String
getActionID
()
{
return
actionID
;
}
public
void
setActionID
(
String
actionID
)
{
this
.
actionID
=
actionID
;
}
public
String
getFinished
()
{
return
finished
;
}
public
void
setFinished
(
String
finished
)
{
this
.
finished
=
finished
;
}
public
List
<
SynergyWork
>
getSubProcesses
()
{
return
subProcesses
;
}
public
void
setSubProcesses
(
List
<
SynergyWork
>
subProcesses
)
{
this
.
subProcesses
=
subProcesses
;
}
public
String
getItemID
()
{
return
itemID
;
}
public
void
setItemID
(
String
itemID
)
{
this
.
itemID
=
itemID
;
}
}
src/main/java/kz/arta/synergy/api/services/WorkflowService.java
0 → 100644
View file @
ce8307b2
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.SynergyWork
;
import
java.io.IOException
;
/**
* @author raimbek
* @since 14.11.2016
*/
public
class
WorkflowService
{
private
final
RestHttpQuery
restHttpQuery
;
private
WorkflowService
(
QueryContext
context
)
{
this
.
restHttpQuery
=
new
RestHttpQuery
(
context
);
}
public
static
WorkflowService
newInstance
(
QueryContext
queryContext
)
{
return
new
WorkflowService
(
queryContext
);
}
public
String
createWork
(
SynergyWork
work
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
methodPost
()
.
url
(
"/rest/api/workflow/work/create"
)
.
formParam
(
"name"
,
work
.
getName
())
.
formParam
(
"startDate"
,
work
.
getStartDate
())
.
formParam
(
"finishDate"
,
work
.
getFinishDate
())
.
formParam
(
"priority"
,
work
.
getPriority
())
.
formParam
(
"authorID"
,
work
.
getAuthorID
())
.
formParam
(
"resUserID"
,
work
.
getResUserID
());
return
restHttpQuery
.
doQuery
(
query
);
}
public
String
getWorkDocumentId
(
String
workId
)
throws
IOException
{
return
JsonUtils
.
getValueByKey
(
restHttpQuery
.
doQuery
(
"/rest/api/workflow/work/"
+
workId
+
"/document"
),
"documentID"
);
}
public
String
deleteWork
(
String
workId
)
throws
IOException
{
return
restHttpQuery
.
doQuery
(
"/rest/api/workflow/work/delete?workID="
+
workId
);
}
}
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