This commit is contained in:
parent
84ceae28c4
commit
d903be76b2
15 changed files with 853 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.account;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.account.Account;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.account.AccountBackendGetAll;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/accounting/accounts")
|
||||
public class AccountController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public AccountController(IStateLoader stateLoader) {
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all accounts.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = AccountBackendGetAll.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public AccountBackendGetAll getAll() {
|
||||
Collection<Account> all = stateLoader.getAll(IMDGDistributedNames.Map_Account, Account.class);
|
||||
AccountBackendGetAll response = new AccountBackendGetAll();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.company;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.profile.ProfileDocument;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.company.ProfileDocumentBackendGetAll;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/profile-documents")
|
||||
public class ProfileDocumentController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public ProfileDocumentController(IStateLoader stateLoader) {
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all ProfileDocuments.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = ProfileDocumentBackendGetAll.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public ProfileDocumentBackendGetAll getAll() {
|
||||
Collection<ProfileDocument> all = stateLoader.getAll(IMDGDistributedNames.Map_ProfileDocument, ProfileDocument.class);
|
||||
ProfileDocumentBackendGetAll response = new ProfileDocumentBackendGetAll();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.user;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.user.User;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.user.UserBackendGetAll;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/users")
|
||||
public class UserController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public UserController(IStateLoader stateLoader) {
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all users.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = UserBackendGetAll.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public UserBackendGetAll getAll() {
|
||||
Collection<User> all = stateLoader.getAll(IMDGDistributedNames.Map_User, User.class);
|
||||
var response = new UserBackendGetAll();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.user;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.user.UserRoleSession;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.user.UserRoleSessionBackendGetAll;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/user-role-sessions")
|
||||
public class UserRoleSessionController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public UserRoleSessionController(IStateLoader stateLoader) {
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all user role sessions.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = UserRoleSessionBackendGetAll.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public UserRoleSessionBackendGetAll getAll() {
|
||||
Collection<UserRoleSession> all = stateLoader.getAll(IMDGDistributedNames.Map_UserRoleSession, UserRoleSession.class);
|
||||
var response = new UserRoleSessionBackendGetAll();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.user;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.user.UserSettings;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.user.UserSettingsBackendGetAll;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/user-settings")
|
||||
public class UserSettingsSessionController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public UserSettingsSessionController(IStateLoader stateLoader) {
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all user role sessions.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = UserSettingsBackendGetAll.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public UserSettingsBackendGetAll getAll() {
|
||||
Collection<UserSettings> all = stateLoader.getAll(IMDGDistributedNames.Map_UserSettings, UserSettings.class);
|
||||
var response = new UserSettingsBackendGetAll();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.clearing.classes.statics.data.account.Account;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(description = "Ответ при получении объектов Account.")
|
||||
public class AccountBackendGetAll extends BasicSpcexResponse {
|
||||
|
||||
@JsonProperty
|
||||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private AccountBackendPayload payload = new AccountBackendPayload();
|
||||
|
||||
private static class AccountBackendPayload {
|
||||
private List<AccountBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<AccountBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<AccountBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public AccountBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(AccountBackendPayload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public void fromEntity(Collection<Account> accounts) {
|
||||
var payload = this.getPayload();
|
||||
for (var account : accounts) {
|
||||
var singleItem = new AccountBackendGetFields();
|
||||
singleItem.setId(account.getId());
|
||||
singleItem.setAccount(account.getAccount());
|
||||
singleItem.setAccountType(account.getAccountType());
|
||||
singleItem.setRelationId(account.getRelationId());
|
||||
singleItem.setStatus(account.getStatus());
|
||||
singleItem.setProcessingSign(account.getProcessingSign());
|
||||
singleItem.setCreated(account.getCreated());
|
||||
singleItem.setUpdated(account.getUpdated());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import ru.spcex.clearing.platform.messaging.domain.json.serialize.InstantSerializer;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public class AccountBackendGetFields {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private String account;
|
||||
@JsonProperty
|
||||
private String accountType;
|
||||
@JsonProperty
|
||||
private Long relationId;
|
||||
@JsonProperty
|
||||
private String status;
|
||||
@JsonProperty
|
||||
private String processingSign;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant created;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant updated;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountType() {
|
||||
return accountType;
|
||||
}
|
||||
|
||||
public void setAccountType(String accountType) {
|
||||
this.accountType = accountType;
|
||||
}
|
||||
|
||||
public Long getRelationId() {
|
||||
return relationId;
|
||||
}
|
||||
|
||||
public void setRelationId(Long relationId) {
|
||||
this.relationId = relationId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getProcessingSign() {
|
||||
return processingSign;
|
||||
}
|
||||
|
||||
public void setProcessingSign(String processingSign) {
|
||||
this.processingSign = processingSign;
|
||||
}
|
||||
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public Instant getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(Instant updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.company;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.clearing.classes.statics.data.profile.ProfileDocument;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(description = "Ответ при получении объектов ProfileDocument.")
|
||||
public class ProfileDocumentBackendGetAll extends BasicSpcexResponse {
|
||||
|
||||
@JsonProperty
|
||||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private ProfileDocumentBackendPayload payload = new ProfileDocumentBackendPayload();
|
||||
|
||||
private static class ProfileDocumentBackendPayload {
|
||||
private List<ProfileDocumentBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<ProfileDocumentBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ProfileDocumentBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public ProfileDocumentBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(ProfileDocumentBackendPayload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public void fromEntity(Collection<ProfileDocument> profileDocuments) {
|
||||
var payload = this.getPayload();
|
||||
for (var profileDocument : profileDocuments) {
|
||||
var singleItem = new ProfileDocumentBackendGetFields();
|
||||
singleItem.setId(profileDocument.getId());
|
||||
singleItem.setCompanyId(profileDocument.getCompanyId());
|
||||
singleItem.setDocumentType(profileDocument.getDocumentType());
|
||||
singleItem.setIssueDate(profileDocument.getIssueDate());
|
||||
singleItem.setIssuePlace(profileDocument.getIssuePlace());
|
||||
singleItem.setIssuer(profileDocument.getIssuer());
|
||||
singleItem.setIssuerCode(profileDocument.getIssuerCode());
|
||||
singleItem.setName(profileDocument.getName());
|
||||
singleItem.setNumber(profileDocument.getNumber());
|
||||
singleItem.setPlace(profileDocument.getPlace());
|
||||
singleItem.setValidFromDate(profileDocument.getValidFromDate());
|
||||
singleItem.setValidToDate(profileDocument.getValidToDate());
|
||||
singleItem.setLink(profileDocument.getLink());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.company;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import ru.spcex.clearing.platform.messaging.domain.json.serialize.InstantSerializer;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public class ProfileDocumentBackendGetFields {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private Long companyId;
|
||||
@JsonProperty
|
||||
private String documentType;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant issueDate;
|
||||
@JsonProperty
|
||||
private String issuePlace;
|
||||
@JsonProperty
|
||||
private String issuer;
|
||||
@JsonProperty
|
||||
private String issuerCode;
|
||||
@JsonProperty
|
||||
private String name;
|
||||
@JsonProperty
|
||||
private String number;
|
||||
@JsonProperty
|
||||
private String place;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant validFromDate;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant validToDate;
|
||||
@JsonProperty
|
||||
private String link;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getDocumentType() {
|
||||
return documentType;
|
||||
}
|
||||
|
||||
public void setDocumentType(String documentType) {
|
||||
this.documentType = documentType;
|
||||
}
|
||||
|
||||
public Instant getIssueDate() {
|
||||
return issueDate;
|
||||
}
|
||||
|
||||
public void setIssueDate(Instant issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
}
|
||||
|
||||
public String getIssuePlace() {
|
||||
return issuePlace;
|
||||
}
|
||||
|
||||
public void setIssuePlace(String issuePlace) {
|
||||
this.issuePlace = issuePlace;
|
||||
}
|
||||
|
||||
public String getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
|
||||
public void setIssuer(String issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
|
||||
public String getIssuerCode() {
|
||||
return issuerCode;
|
||||
}
|
||||
|
||||
public void setIssuerCode(String issuerCode) {
|
||||
this.issuerCode = issuerCode;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getPlace() {
|
||||
return place;
|
||||
}
|
||||
|
||||
public void setPlace(String place) {
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public Instant getValidFromDate() {
|
||||
return validFromDate;
|
||||
}
|
||||
|
||||
public void setValidFromDate(Instant validFromDate) {
|
||||
this.validFromDate = validFromDate;
|
||||
}
|
||||
|
||||
public Instant getValidToDate() {
|
||||
return validToDate;
|
||||
}
|
||||
|
||||
public void setValidToDate(Instant validToDate) {
|
||||
this.validToDate = validToDate;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.clearing.classes.statics.data.user.User;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(description = "Ответ при получении объектов User.")
|
||||
public class UserBackendGetAll extends BasicSpcexResponse {
|
||||
|
||||
@JsonProperty
|
||||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private UserBackendPayload payload = new UserBackendPayload();
|
||||
|
||||
private static class UserBackendPayload {
|
||||
private List<UserBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<UserBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<UserBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public UserBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(UserBackendPayload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public void fromEntity(Collection<User> users) {
|
||||
var payload = this.getPayload();
|
||||
for (var user : users) {
|
||||
var singleItem = new UserBackendGetFields();
|
||||
singleItem.setId(user.getId());
|
||||
singleItem.setIdentifier(user.getIdentifier());
|
||||
singleItem.setCreated(user.getCreated());
|
||||
singleItem.setUpdated(user.getUpdated());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import ru.spcex.clearing.platform.messaging.domain.json.serialize.InstantSerializer;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public class UserBackendGetFields {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private String identifier;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant created;
|
||||
@JsonProperty
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant updated;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(String identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public Instant getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(Instant updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.clearing.classes.statics.data.user.UserRoleSession;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(description = "Ответ при получении объектов UserRoleSession.")
|
||||
public class UserRoleSessionBackendGetAll extends BasicSpcexResponse {
|
||||
|
||||
@JsonProperty
|
||||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private UserRoleSessionBackendPayload payload = new UserRoleSessionBackendPayload();
|
||||
|
||||
private static class UserRoleSessionBackendPayload {
|
||||
private List<UserRoleSessionsBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<UserRoleSessionsBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<UserRoleSessionsBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public UserRoleSessionBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(UserRoleSessionBackendPayload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public void fromEntity(Collection<UserRoleSession> userRoleSessions) {
|
||||
var payload = this.getPayload();
|
||||
for (var userRoleSession : userRoleSessions) {
|
||||
var singleItem = new UserRoleSessionsBackendGetFields();
|
||||
singleItem.setId(userRoleSession.getId());
|
||||
singleItem.setUserId(userRoleSession.getUserId());
|
||||
singleItem.setUserRole(userRoleSession.getUserRole());
|
||||
singleItem.setCompanyId(userRoleSession.getCompanyId());
|
||||
singleItem.setStatus(userRoleSession.getStatus());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class UserRoleSessionsBackendGetFields {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private Long userId;
|
||||
@JsonProperty
|
||||
private String userRole;
|
||||
@JsonProperty
|
||||
private Long companyId;
|
||||
@JsonProperty
|
||||
private String status;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserRole() {
|
||||
return userRole;
|
||||
}
|
||||
|
||||
public void setUserRole(String userRole) {
|
||||
this.userRole = userRole;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.clearing.classes.statics.data.user.UserSettings;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(description = "Ответ при получении объектов UserSetting.")
|
||||
public class UserSettingsBackendGetAll extends BasicSpcexResponse {
|
||||
|
||||
@JsonProperty
|
||||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private UserSettingBackendPayload payload = new UserSettingBackendPayload();
|
||||
|
||||
private static class UserSettingBackendPayload {
|
||||
private List<UserSettingsBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<UserSettingsBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<UserSettingsBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public UserSettingBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(UserSettingBackendPayload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public void fromEntity(Collection<UserSettings> userSettings) {
|
||||
var payload = this.getPayload();
|
||||
for (var userSetting : userSettings) {
|
||||
var singleItem = new UserSettingsBackendGetFields();
|
||||
singleItem.setId(userSetting.getId());
|
||||
singleItem.setUserId(userSetting.getUserId());
|
||||
singleItem.setVersion(userSetting.getVersion());
|
||||
singleItem.setJson(userSetting.getJson());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package ru.spcex.clearing.backendapi.controller.response.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class UserSettingsBackendGetFields {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private Long userId;
|
||||
@JsonProperty
|
||||
private String version;
|
||||
@JsonProperty
|
||||
private String json;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getJson() {
|
||||
return json;
|
||||
}
|
||||
|
||||
public void setJson(String json) {
|
||||
this.json = json;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue