Commit 86e24d85 authored by Raimbek Egemberdiev's avatar Raimbek Egemberdiev

new types and services

parent 0b50b254
......@@ -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;
}
}
......@@ -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;
}
}
......@@ -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;
}
}
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;
}
}
......@@ -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;
}
}
......@@ -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);
}
}
......@@ -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);
}
}
......@@ -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);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment