X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-service-api%2Fsrc%2Fmain%2Fjava%2Forg%2Foran%2Fotf%2Fcommon%2Fmodel%2FUser.java;fp=otf-service-api%2Fsrc%2Fmain%2Fjava%2Forg%2Foran%2Fotf%2Fcommon%2Fmodel%2FUser.java;h=2c56b85e6257e5deaff8f3c7a897856428c65642;hp=0000000000000000000000000000000000000000;hb=14f6f95c84a4a1fa8774190db4a03fd0214ec55f;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b diff --git a/otf-service-api/src/main/java/org/oran/otf/common/model/User.java b/otf-service-api/src/main/java/org/oran/otf/common/model/User.java new file mode 100644 index 0000000..2c56b85 --- /dev/null +++ b/otf-service-api/src/main/java/org/oran/otf/common/model/User.java @@ -0,0 +1,142 @@ +/* Copyright (c) 2019 AT&T Intellectual Property. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +##############################################################################*/ + + +package org.oran.otf.common.model; + +import org.oran.otf.common.model.local.UserGroup; +import org.oran.otf.common.utility.gson.Convert; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import org.bson.types.ObjectId; +import org.springframework.data.mongodb.core.mapping.Document; + +@Document(collection = "users") +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + + private ObjectId _id; + private List permissions; + private String firstName; + private String lastName; + private String email; + private String password; + private List groups; + private Date createdAt; + private Date updatedAt; + + //Added User for testing + public User(){}; + + public User( + ObjectId _id, + List permissions, + String firstName, + String lastName, + String email, + String password, + List groups, + Date createdAt, + Date updatedAt) { + this._id = _id; + this.permissions = permissions; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.groups = groups; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public ObjectId get_id() { + return _id; + } + + public void set_id(ObjectId _id) { + this._id = _id; + } + + public List getPermissions() { + return permissions; + } + + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public String toString() { + return Convert.objectToJson(this); + } +}