feat:Add file transfer function
[usecase-ui/server.git] / server / src / main / java / org / onap / usecaseui / server / bean / intent / IntentModel.java
1 /*
2  * Copyright (C) 2021 CTC, Inc. and others. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.usecaseui.server.bean.intent;
17
18 import java.io.Serializable;
19 import javax.persistence.Column;
20 import javax.persistence.Entity;
21 import javax.persistence.GeneratedValue;
22 import javax.persistence.GenerationType;
23 import javax.persistence.Id;
24 import javax.persistence.Table;
25
26 @Entity
27 @Table(name="intent_model")
28 public class IntentModel implements Serializable {
29
30     @Id
31     @GeneratedValue(strategy=GenerationType.IDENTITY)
32     @Column(name = "id")
33     private int id;
34
35     @Column(name = "model_name")
36     private String modelName;
37
38     @Column(name = "file_path")
39     private String filePath;
40
41     @Column(name = "create_time")
42     private String createTime;
43
44     @Column(name = "size")
45     private Float size;
46
47     @Column(name = "active")
48     private Integer active;
49
50     @Column(name = "model_type")
51     private Integer modelType;
52
53     public IntentModel() {
54
55     }
56
57     public int getId() {
58         return id;
59     }
60
61     public void setId(int id) {
62         this.id = id;
63     }
64
65     public String getModelName() {
66         return modelName;
67     }
68
69     public void setModelName(String modelName) {
70         this.modelName = modelName;
71     }
72
73     public String getFilePath() {
74         return filePath;
75     }
76
77     public void setFilePath(String filePath) {
78         this.filePath = filePath;
79     }
80
81     public String getCreateTime() {
82         return createTime;
83     }
84
85     public void setCreateTime(String createTime) {
86         this.createTime = createTime;
87     }
88
89     public Float getSize() {
90         return size;
91     }
92
93     public void setSize(Float size) {
94         this.size = size;
95     }
96
97     public Integer getActive() {
98         return active;
99     }
100
101     public void setActive(Integer active) {
102         this.active = active;
103     }
104
105     public String getModelType() {
106         if (this.modelType == 1) {
107             return "ccvpn";
108         }
109         else {
110             return "5gs";
111         }
112     }
113
114     public void setModelType(String modelType) {
115         if ("ccvpn".equals(modelType)) {
116             this.modelType = 1;
117         }
118         else {
119             this.modelType = 0;
120         }
121     }
122 }