NodeDto.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.its.op.model.dto;
  2. import com.its.op.model.entity.Node;
  3. import com.its.op.model.enums.CodeRepository;
  4. import lombok.*;
  5. import java.io.Serializable;
  6. public class NodeDto implements Serializable {
  7. @Getter
  8. public static class Info {
  9. private final Long NODE_ID; // N NUMBER(10) N 노드ID
  10. private final String NODE_TYPE; // N VARCHAR2(3) Y 노드유형
  11. private final String NODE_NAME; // N VARCHAR2(100) Y 교차로명칭
  12. private final String TURN_P; // N VARCHAR2(1) Y 회전제한유무
  13. private final String RMRK; // N VARCHAR2(50) Y 비고
  14. private final Double X_CRDN; // N NUMBER(11,8) Y X 좌표
  15. private final Double Y_CRDN; // N NUMBER(10,8) Y Y 좌표
  16. private final String NODE_TYPE_DESC;
  17. private final String TURN_P_DESC;
  18. public Info(Node entity) {
  19. this.NODE_ID = entity.getNODE_ID();
  20. this.NODE_TYPE = entity.getNODE_TYPE();
  21. this.NODE_NAME = entity.getNODE_NAME();
  22. this.TURN_P = entity.getTURN_P();
  23. this.RMRK = entity.getRMRK();
  24. this.X_CRDN = entity.getX_CRDN();
  25. this.Y_CRDN = entity.getY_CRDN();
  26. this.NODE_TYPE_DESC = CodeRepository.getCodeDesc(CodeRepository.NODE_TYPE, this.NODE_TYPE);
  27. if (this.TURN_P.equals("0"))
  28. this.TURN_P_DESC = "[0] 무";
  29. else
  30. if (this.TURN_P.equals("1"))
  31. this.TURN_P_DESC = "[1] 유";
  32. else
  33. this.TURN_P_DESC = "[" + TURN_P + "] ?";
  34. }
  35. }
  36. @Getter
  37. @Setter
  38. @ToString
  39. @NoArgsConstructor(access = AccessLevel.PROTECTED)
  40. public static class NameUpdateReq {
  41. private String NODE_NAME;
  42. @Builder
  43. public NameUpdateReq(String NODE_NAME) {
  44. this.NODE_NAME = NODE_NAME;
  45. }
  46. }
  47. }