CLS-256, CLS-259 немного поменялось API по meta

This commit is contained in:
AKurakin 2023-04-04 21:50:31 +03:00
parent a2cc3945f6
commit 4ffbefbbe0
4 changed files with 34 additions and 56 deletions

View file

@ -67,4 +67,15 @@ public class CompanyController extends AbstractQueueController {
@RequestBody CompanyNewAction companyNewAction) throws ExecutionException, InterruptedException { @RequestBody CompanyNewAction companyNewAction) throws ExecutionException, InterruptedException {
return processRequest(Consts.DESTINATION_COMPANY_NEW, companyNewAction); return processRequest(Consts.DESTINATION_COMPANY_NEW, companyNewAction);
} }
// @ApiOperation(value = "update company.")
// @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
// @RequestMapping(method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
// @ResponseBody
// public CudResponse add(
// @ApiParam(value = "Параметры команды в JSON формате.", required = true)
// @RequestBody CompanyNewAction companyNewAction) throws ExecutionException, InterruptedException {
// return processRequest(Consts.DESTINATION_COMPANY_NEW, companyNewAction);
// }
} }

View file

@ -14,24 +14,26 @@ public class CompanyNewAction implements IAction<CompanyNewRequest> {
@ApiModelProperty(value = "Полное наименование Компании", example = "OOO Full Company Name") @ApiModelProperty(value = "Полное наименование Компании", example = "OOO Full Company Name")
@JsonProperty @JsonProperty
private String fullName; private String fullName;
@ApiModelProperty(value = "Код участника торгов", example = "TRADINGCODE")
@ApiModelProperty(value = "Тип реквизита", example = "TRDC")
@JsonProperty @JsonProperty
private String tradingCode; private String companySymbol;
@ApiModelProperty(value = "Код участника клиринга", example = "CLEARINGCODE") @ApiModelProperty(value = "Значение реквизита", example = "COMPANYSYMBOL_VALUE-123")
@JsonProperty @JsonProperty
private String clearingCode; private String companySymbolValue;
@ApiModelProperty(value = "Регистрационный код участника", example = "REGISTRATIONCODE") @ApiModelProperty(value = "Наименование статуса", example = "ACTV")
@JsonProperty @JsonProperty
private String registrationCode; private String workflowStatus;
@Override @Override
public CompanyNewRequest toRequest() { public CompanyNewRequest toRequest() {
CompanyNewRequest request = new CompanyNewRequest(); CompanyNewRequest request = new CompanyNewRequest();
request.setShortName(this.shortName); request.setShortName(this.shortName);
request.setFullName(this.fullName); request.setFullName(this.fullName);
request.setTradingCode(this.tradingCode); request.setCompanySymbol(this.companySymbol);
request.setClearingCode(this.clearingCode); request.setCompanySymbolValue(this.companySymbolValue);
request.setRegistrationCode(this.registrationCode); request.setWorkflowStatus(this.workflowStatus);
return request; return request;
} }
@ -57,27 +59,27 @@ public class CompanyNewAction implements IAction<CompanyNewRequest> {
this.fullName = fullName; this.fullName = fullName;
} }
public String getTradingCode() { public String getCompanySymbol() {
return tradingCode; return companySymbol;
} }
public void setTradingCode(String tradingCode) { public void setCompanySymbol(String companySymbol) {
this.tradingCode = tradingCode; this.companySymbol = companySymbol;
} }
public String getClearingCode() { public String getCompanySymbolValue() {
return clearingCode; return companySymbolValue;
} }
public void setClearingCode(String clearingCode) { public void setCompanySymbolValue(String companySymbolValue) {
this.clearingCode = clearingCode; this.companySymbolValue = companySymbolValue;
} }
public String getRegistrationCode() { public String getWorkflowStatus() {
return registrationCode; return workflowStatus;
} }
public void setRegistrationCode(String registrationCode) { public void setWorkflowStatus(String workflowStatus) {
this.registrationCode = registrationCode; this.workflowStatus = workflowStatus;
} }
} }

View file

@ -52,9 +52,6 @@ public class CompanyService extends QueueConsumer implements InitializingBean {
private Function<CompanyNewRequest, IValidator> companyUpdateRequestValidator; private Function<CompanyNewRequest, IValidator> companyUpdateRequestValidator;
private Function<CommonDeleteRequest, IValidator> companyDeleteRequestValidator; private Function<CommonDeleteRequest, IValidator> companyDeleteRequestValidator;
// Синхронизация обновлений
public final Object lockCompany = new Object(); // Company, CompanySymbol,
@Autowired @Autowired
public CompanyService(Consumer<String, Object> kafkaQueue, Producer<String, Object> kafkaProducer, public CompanyService(Consumer<String, Object> kafkaQueue, Producer<String, Object> kafkaProducer,
ImdgProvider imdgProvider, ImdgProvider imdgProvider,

View file

@ -15,14 +15,6 @@ public class CompanyNewRequest {
@JsonProperty @JsonProperty
private String workflowStatus; private String workflowStatus;
//todo deprecated 3 field:
@JsonProperty
private String tradingCode;
@JsonProperty
private String clearingCode;
@JsonProperty
private String registrationCode;
// for update, todo разобраться, это тот же тип запроса или надо отдельный на update сделать? // for update, todo разобраться, это тот же тип запроса или надо отдельный на update сделать?
@JsonProperty @JsonProperty
private Long id; private Long id;
@ -43,30 +35,6 @@ public class CompanyNewRequest {
this.fullName = fullName; this.fullName = fullName;
} }
public String getTradingCode() {
return tradingCode;
}
public void setTradingCode(String tradingCode) {
this.tradingCode = tradingCode;
}
public String getClearingCode() {
return clearingCode;
}
public void setClearingCode(String clearingCode) {
this.clearingCode = clearingCode;
}
public String getRegistrationCode() {
return registrationCode;
}
public void setRegistrationCode(String registrationCode) {
this.registrationCode = registrationCode;
}
public String getCompanySymbol() { public String getCompanySymbol() {
return companySymbol; return companySymbol;
} }