Skip to content

Commit

Permalink
Revert "Removed unneeded classes"
Browse files Browse the repository at this point in the history
This reverts commit 42041df.
  • Loading branch information
mamartinezmejia committed Nov 9, 2022
1 parent 42041df commit 38b55d8
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package ca.bc.gov.app.m.postgres.client.controller;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import java.util.List;

import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import ca.bc.gov.app.core.configuration.PostgresPersistenceConfiguration;
import ca.bc.gov.app.m.postgres.client.entity.ClientStatusCodeEntity;
import ca.bc.gov.app.m.postgres.client.service.ClientService;
import io.swagger.annotations.Api;

@Api(tags = PostgresPersistenceConfiguration.POSTGRES_API_TAG)
Expand All @@ -15,5 +24,12 @@ public class ClientController {

public static final Logger logger = LoggerFactory.getLogger(ClientController.class);

@Inject
private ClientService clientService;

@RequestMapping(value = "/findAllClientStatusCodes", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
public List<ClientStatusCodeEntity> findAllClientStatusCodes() {
return clientService.findAllClientStatusCodes();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package ca.bc.gov.app.m.postgres.client.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import ca.bc.gov.app.core.configuration.PostgresPersistenceConfiguration;
import ca.bc.gov.app.core.entity.AbstractEntity;
import ca.bc.gov.app.core.misc.scope.ScopeConstant;

@Entity
@Table(name = "CLIENT_STATUS_CODE", schema = PostgresPersistenceConfiguration.POSTGRES_ATTRIBUTE_SCHEMA)
@Component(ClientStatusCodeEntity.BEAN_NAME)
@Scope(ScopeConstant.PROTOTYPE)
public class ClientStatusCodeEntity implements AbstractEntity {

private static final long serialVersionUID = 4341025008217142732L;

public static final String BEAN_NAME = "clientStatusCodeEntity";

public static final String ACTIVE = "ACT";

@Id
@Column(name = "CLIENT_STATUS_CODE")
private String clientStatusCode;

@Column(name = "DESCRIPTION")
private String description;

@Column(name = "EFFECTIVE_DATE")
private Date effectiveDate;

@Column(name = "EXPIRY_DATE")
private Date expiryDate;

@Column(name = "CREATE_TIMESTAMP")
private Date createTimestamp;

@Column(name = "UPDATE_TIMESTAMP")
private Date updateTimestamp;

@Column(name = "CREATE_USER")
private String createUser;

@Column(name = "UPDATE_USER")
private String updateUser;

public String getClientStatusCode() {
return clientStatusCode;
}

public void setClientStatusCode(String clientStatusCode) {
this.clientStatusCode = clientStatusCode;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Date getEffectiveDate() {
return effectiveDate;
}

public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}

public Date getExpiryDate() {
return expiryDate;
}

public void setExpiryDate(Date expiryDate) {
this.expiryDate = expiryDate;
}

public Date getCreateTimestamp() {
return createTimestamp;
}

public void setCreateTimestamp(Date createTimestamp) {
this.createTimestamp = createTimestamp;
}

public Date getUpdateTimestamp() {
return updateTimestamp;
}

public void setUpdateTimestamp(Date updateTimestamp) {
this.updateTimestamp = updateTimestamp;
}

public String getCreateUser() {
return createUser;
}

public void setCreateUser(String createUser) {
this.createUser = createUser;
}

public String getUpdateUser() {
return updateUser;
}

public void setUpdateUser(String updateUser) {
this.updateUser = updateUser;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import org.springframework.stereotype.Repository;

import ca.bc.gov.app.core.repository.CoreRepository;
import ca.bc.gov.app.m.postgres.client.entity.ClientTypeCodeEntity;
import ca.bc.gov.app.m.postgres.client.entity.ClientStatusCodeEntity;

@Repository
public interface ClientTypeCodeRepository extends CoreRepository<ClientTypeCodeEntity> {

public interface ClientStatusCodeRepository extends CoreRepository<ClientStatusCodeEntity> {
}

0 comments on commit 38b55d8

Please sign in to comment.