瀏覽代碼

Project updated with JDL

Lauren Green 5 年之前
父節點
當前提交
770acb1549
共有 100 個檔案被更改,包括 5089 行新增0 行删除
  1. 23
    0
      .jhipster/Cohort.json
  2. 31
    0
      .jhipster/Employer.json
  3. 54
    0
      .jhipster/Post.json
  4. 31
    0
      .jhipster/Privacy.json
  5. 68
    0
      .jhipster/UserProfile.json
  6. 77
    0
      jhipster-jdl.jh
  7. 95
    0
      src/main/java/rocks/zipcode/io/domain/Cohort.java
  8. 129
    0
      src/main/java/rocks/zipcode/io/domain/Employer.java
  9. 164
    0
      src/main/java/rocks/zipcode/io/domain/Post.java
  10. 129
    0
      src/main/java/rocks/zipcode/io/domain/Privacy.java
  11. 179
    0
      src/main/java/rocks/zipcode/io/domain/UserProfile.java
  12. 15
    0
      src/main/java/rocks/zipcode/io/repository/CohortRepository.java
  13. 15
    0
      src/main/java/rocks/zipcode/io/repository/EmployerRepository.java
  14. 19
    0
      src/main/java/rocks/zipcode/io/repository/PostRepository.java
  15. 15
    0
      src/main/java/rocks/zipcode/io/repository/PrivacyRepository.java
  16. 15
    0
      src/main/java/rocks/zipcode/io/repository/UserProfileRepository.java
  17. 119
    0
      src/main/java/rocks/zipcode/io/web/rest/CohortResource.java
  18. 119
    0
      src/main/java/rocks/zipcode/io/web/rest/EmployerResource.java
  19. 119
    0
      src/main/java/rocks/zipcode/io/web/rest/PostResource.java
  20. 119
    0
      src/main/java/rocks/zipcode/io/web/rest/PrivacyResource.java
  21. 119
    0
      src/main/java/rocks/zipcode/io/web/rest/UserProfileResource.java
  22. 60
    0
      src/main/resources/config/liquibase/changelog/20181217184612_added_entity_UserProfile.xml
  23. 42
    0
      src/main/resources/config/liquibase/changelog/20181217184612_added_entity_constraints_UserProfile.xml
  24. 38
    0
      src/main/resources/config/liquibase/changelog/20181217184613_added_entity_Cohort.xml
  25. 46
    0
      src/main/resources/config/liquibase/changelog/20181217184614_added_entity_Employer.xml
  26. 54
    0
      src/main/resources/config/liquibase/changelog/20181217184615_added_entity_Post.xml
  27. 30
    0
      src/main/resources/config/liquibase/changelog/20181217184615_added_entity_constraints_Post.xml
  28. 46
    0
      src/main/resources/config/liquibase/changelog/20181217184616_added_entity_Privacy.xml
  29. 7
    0
      src/main/resources/config/liquibase/master.xml
  30. 19
    0
      src/main/webapp/app/entities/cohort/cohort-delete-dialog.component.html
  31. 65
    0
      src/main/webapp/app/entities/cohort/cohort-delete-dialog.component.ts
  32. 31
    0
      src/main/webapp/app/entities/cohort/cohort-detail.component.html
  33. 24
    0
      src/main/webapp/app/entities/cohort/cohort-detail.component.ts
  34. 34
    0
      src/main/webapp/app/entities/cohort/cohort-update.component.html
  35. 51
    0
      src/main/webapp/app/entities/cohort/cohort-update.component.ts
  36. 56
    0
      src/main/webapp/app/entities/cohort/cohort.component.html
  37. 58
    0
      src/main/webapp/app/entities/cohort/cohort.component.ts
  38. 23
    0
      src/main/webapp/app/entities/cohort/cohort.module.ts
  39. 93
    0
      src/main/webapp/app/entities/cohort/cohort.route.ts
  40. 38
    0
      src/main/webapp/app/entities/cohort/cohort.service.ts
  41. 6
    0
      src/main/webapp/app/entities/cohort/index.ts
  42. 19
    0
      src/main/webapp/app/entities/employer/employer-delete-dialog.component.html
  43. 65
    0
      src/main/webapp/app/entities/employer/employer-delete-dialog.component.ts
  44. 39
    0
      src/main/webapp/app/entities/employer/employer-detail.component.html
  45. 24
    0
      src/main/webapp/app/entities/employer/employer-detail.component.ts
  46. 44
    0
      src/main/webapp/app/entities/employer/employer-update.component.html
  47. 51
    0
      src/main/webapp/app/entities/employer/employer-update.component.ts
  48. 60
    0
      src/main/webapp/app/entities/employer/employer.component.html
  49. 58
    0
      src/main/webapp/app/entities/employer/employer.component.ts
  50. 29
    0
      src/main/webapp/app/entities/employer/employer.module.ts
  51. 93
    0
      src/main/webapp/app/entities/employer/employer.route.ts
  52. 38
    0
      src/main/webapp/app/entities/employer/employer.service.ts
  53. 6
    0
      src/main/webapp/app/entities/employer/index.ts
  54. 10
    0
      src/main/webapp/app/entities/entity.module.ts
  55. 6
    0
      src/main/webapp/app/entities/post/index.ts
  56. 19
    0
      src/main/webapp/app/entities/post/post-delete-dialog.component.html
  57. 65
    0
      src/main/webapp/app/entities/post/post-delete-dialog.component.ts
  58. 53
    0
      src/main/webapp/app/entities/post/post-detail.component.html
  59. 24
    0
      src/main/webapp/app/entities/post/post-detail.component.ts
  60. 70
    0
      src/main/webapp/app/entities/post/post-update.component.html
  61. 100
    0
      src/main/webapp/app/entities/post/post-update.component.ts
  62. 74
    0
      src/main/webapp/app/entities/post/post.component.html
  63. 58
    0
      src/main/webapp/app/entities/post/post.component.ts
  64. 24
    0
      src/main/webapp/app/entities/post/post.module.ts
  65. 93
    0
      src/main/webapp/app/entities/post/post.route.ts
  66. 74
    0
      src/main/webapp/app/entities/post/post.service.ts
  67. 6
    0
      src/main/webapp/app/entities/privacy/index.ts
  68. 19
    0
      src/main/webapp/app/entities/privacy/privacy-delete-dialog.component.html
  69. 65
    0
      src/main/webapp/app/entities/privacy/privacy-delete-dialog.component.ts
  70. 39
    0
      src/main/webapp/app/entities/privacy/privacy-detail.component.html
  71. 24
    0
      src/main/webapp/app/entities/privacy/privacy-detail.component.ts
  72. 44
    0
      src/main/webapp/app/entities/privacy/privacy-update.component.html
  73. 51
    0
      src/main/webapp/app/entities/privacy/privacy-update.component.ts
  74. 60
    0
      src/main/webapp/app/entities/privacy/privacy.component.html
  75. 58
    0
      src/main/webapp/app/entities/privacy/privacy.component.ts
  76. 29
    0
      src/main/webapp/app/entities/privacy/privacy.module.ts
  77. 93
    0
      src/main/webapp/app/entities/privacy/privacy.route.ts
  78. 38
    0
      src/main/webapp/app/entities/privacy/privacy.service.ts
  79. 6
    0
      src/main/webapp/app/entities/user-profile/index.ts
  80. 19
    0
      src/main/webapp/app/entities/user-profile/user-profile-delete-dialog.component.html
  81. 72
    0
      src/main/webapp/app/entities/user-profile/user-profile-delete-dialog.component.ts
  82. 67
    0
      src/main/webapp/app/entities/user-profile/user-profile-detail.component.html
  83. 24
    0
      src/main/webapp/app/entities/user-profile/user-profile-detail.component.ts
  84. 79
    0
      src/main/webapp/app/entities/user-profile/user-profile-update.component.html
  85. 138
    0
      src/main/webapp/app/entities/user-profile/user-profile-update.component.ts
  86. 88
    0
      src/main/webapp/app/entities/user-profile/user-profile.component.html
  87. 58
    0
      src/main/webapp/app/entities/user-profile/user-profile.component.ts
  88. 30
    0
      src/main/webapp/app/entities/user-profile/user-profile.module.ts
  89. 93
    0
      src/main/webapp/app/entities/user-profile/user-profile.route.ts
  90. 38
    0
      src/main/webapp/app/entities/user-profile/user-profile.service.ts
  91. 30
    0
      src/main/webapp/app/layouts/navbar/navbar.component.html
  92. 9
    0
      src/main/webapp/app/shared/model/cohort.model.ts
  93. 11
    0
      src/main/webapp/app/shared/model/employer.model.ts
  94. 27
    0
      src/main/webapp/app/shared/model/post.model.ts
  95. 21
    0
      src/main/webapp/app/shared/model/privacy.model.ts
  96. 31
    0
      src/main/webapp/app/shared/model/user-profile.model.ts
  97. 22
    0
      src/main/webapp/i18n/en/cohort.json
  98. 24
    0
      src/main/webapp/i18n/en/employer.json
  99. 5
    0
      src/main/webapp/i18n/en/global.json
  100. 0
    0
      src/main/webapp/i18n/en/post.json

+ 23
- 0
.jhipster/Cohort.json 查看文件

@@ -0,0 +1,23 @@
1
+{
2
+    "name": "Cohort",
3
+    "fields": [
4
+        {
5
+            "fieldName": "cohortId",
6
+            "fieldType": "Double"
7
+        },
8
+        {
9
+            "fieldName": "gradDate",
10
+            "fieldType": "String"
11
+        }
12
+    ],
13
+    "relationships": [],
14
+    "changelogDate": "20181217184613",
15
+    "entityTableName": "cohort",
16
+    "dto": "no",
17
+    "pagination": "no",
18
+    "service": "no",
19
+    "jpaMetamodelFiltering": false,
20
+    "fluentMethods": true,
21
+    "clientRootFolder": "",
22
+    "applications": "*"
23
+}

+ 31
- 0
.jhipster/Employer.json 查看文件

@@ -0,0 +1,31 @@
1
+{
2
+    "name": "Employer",
3
+    "fields": [
4
+        {
5
+            "fieldName": "employerId",
6
+            "fieldType": "Long"
7
+        },
8
+        {
9
+            "fieldName": "companyName",
10
+            "fieldType": "String"
11
+        },
12
+        {
13
+            "fieldName": "city",
14
+            "fieldType": "String"
15
+        },
16
+        {
17
+            "fieldName": "state",
18
+            "fieldType": "String"
19
+        }
20
+    ],
21
+    "relationships": [],
22
+    "changelogDate": "20181217184614",
23
+    "entityTableName": "employer",
24
+    "dto": "no",
25
+    "pagination": "no",
26
+    "service": "no",
27
+    "jpaMetamodelFiltering": false,
28
+    "fluentMethods": true,
29
+    "clientRootFolder": "",
30
+    "applications": "*"
31
+}

+ 54
- 0
.jhipster/Post.json 查看文件

@@ -0,0 +1,54 @@
1
+{
2
+    "name": "Post",
3
+    "fields": [
4
+        {
5
+            "fieldName": "postId",
6
+            "fieldType": "Long"
7
+        },
8
+        {
9
+            "fieldName": "timestamp",
10
+            "fieldType": "LocalDate"
11
+        },
12
+        {
13
+            "fieldName": "content",
14
+            "fieldType": "String"
15
+        },
16
+        {
17
+            "fieldName": "likes",
18
+            "fieldType": "String"
19
+        }
20
+    ],
21
+    "relationships": [
22
+        {
23
+            "relationshipType": "one-to-one",
24
+            "relationshipName": "poster",
25
+            "otherEntityName": "user",
26
+            "otherEntityField": "id",
27
+            "ownerSide": true,
28
+            "otherEntityRelationshipName": "post"
29
+        },
30
+        {
31
+            "relationshipType": "one-to-one",
32
+            "relationshipName": "privacySetting",
33
+            "otherEntityName": "privacy",
34
+            "otherEntityField": "id",
35
+            "ownerSide": true,
36
+            "otherEntityRelationshipName": "post"
37
+        },
38
+        {
39
+            "relationshipType": "many-to-one",
40
+            "relationshipName": "poster",
41
+            "otherEntityName": "user",
42
+            "otherEntityField": "id"
43
+        }
44
+    ],
45
+    "changelogDate": "20181217184615",
46
+    "entityTableName": "post",
47
+    "dto": "no",
48
+    "pagination": "no",
49
+    "service": "no",
50
+    "jpaMetamodelFiltering": false,
51
+    "fluentMethods": true,
52
+    "clientRootFolder": "",
53
+    "applications": "*"
54
+}

+ 31
- 0
.jhipster/Privacy.json 查看文件

@@ -0,0 +1,31 @@
1
+{
2
+    "name": "Privacy",
3
+    "fields": [
4
+        {
5
+            "fieldName": "privacyId",
6
+            "fieldType": "Long"
7
+        },
8
+        {
9
+            "fieldName": "publicView",
10
+            "fieldType": "Boolean"
11
+        },
12
+        {
13
+            "fieldName": "cohortView",
14
+            "fieldType": "Boolean"
15
+        },
16
+        {
17
+            "fieldName": "employerView",
18
+            "fieldType": "Boolean"
19
+        }
20
+    ],
21
+    "relationships": [],
22
+    "changelogDate": "20181217184616",
23
+    "entityTableName": "privacy",
24
+    "dto": "no",
25
+    "pagination": "no",
26
+    "service": "no",
27
+    "jpaMetamodelFiltering": false,
28
+    "fluentMethods": true,
29
+    "clientRootFolder": "",
30
+    "applications": "*"
31
+}

+ 68
- 0
.jhipster/UserProfile.json 查看文件

@@ -0,0 +1,68 @@
1
+{
2
+    "name": "UserProfile",
3
+    "fields": [
4
+        {
5
+            "fieldName": "profileId",
6
+            "fieldType": "Long"
7
+        },
8
+        {
9
+            "fieldName": "firstName",
10
+            "fieldType": "String"
11
+        },
12
+        {
13
+            "fieldName": "lastName",
14
+            "fieldType": "String"
15
+        },
16
+        {
17
+            "fieldName": "userStack",
18
+            "fieldType": "String"
19
+        }
20
+    ],
21
+    "relationships": [
22
+        {
23
+            "relationshipType": "one-to-one",
24
+            "relationshipName": "user",
25
+            "otherEntityName": "user",
26
+            "otherEntityField": "id",
27
+            "ownerSide": true,
28
+            "otherEntityRelationshipName": "userProfile"
29
+        },
30
+        {
31
+            "relationshipType": "one-to-one",
32
+            "relationshipName": "cohort",
33
+            "otherEntityName": "cohort",
34
+            "otherEntityField": "id",
35
+            "ownerSide": true,
36
+            "otherEntityRelationshipName": "userProfile"
37
+        },
38
+        {
39
+            "relationshipType": "one-to-one",
40
+            "relationshipName": "employer",
41
+            "otherEntityName": "employer",
42
+            "otherEntityField": "id",
43
+            "ownerSide": true,
44
+            "otherEntityRelationshipName": "userProfile"
45
+        },
46
+        {
47
+            "relationshipType": "many-to-one",
48
+            "relationshipName": "employer",
49
+            "otherEntityName": "employer",
50
+            "otherEntityField": "id"
51
+        },
52
+        {
53
+            "relationshipType": "many-to-one",
54
+            "relationshipName": "cohort",
55
+            "otherEntityName": "cohort",
56
+            "otherEntityField": "id"
57
+        }
58
+    ],
59
+    "changelogDate": "20181217184612",
60
+    "entityTableName": "user_profile",
61
+    "dto": "no",
62
+    "pagination": "no",
63
+    "service": "no",
64
+    "jpaMetamodelFiltering": false,
65
+    "fluentMethods": true,
66
+    "clientRootFolder": "",
67
+    "applications": "*"
68
+}

+ 77
- 0
jhipster-jdl.jh 查看文件

@@ -0,0 +1,77 @@
1
+entity User {
2
+	userId Long,
3
+}
4
+
5
+entity UserProfile {
6
+	profileId Long,
7
+    firstName String,
8
+    lastName String,
9
+    userStack String,
10
+}
11
+
12
+entity Cohort {
13
+	cohortId Double,
14
+    gradDate String
15
+}
16
+
17
+entity Employer {
18
+	employerId Long,
19
+    companyName String,
20
+    city String,
21
+    state String
22
+}
23
+
24
+entity Post {
25
+	postId Long,
26
+    timestamp LocalDate,
27
+    content String,
28
+    likes String,
29
+}
30
+
31
+entity Privacy {
32
+	privacyId Long,
33
+	publicView Boolean,
34
+    cohortView Boolean,
35
+    employerView Boolean
36
+}
37
+
38
+
39
+relationship ManyToOne {
40
+	UserProfile{employer} to Employer
41
+}
42
+
43
+relationship ManyToOne {
44
+    Post{poster} to User
45
+}
46
+
47
+relationship ManyToOne {
48
+    UserProfile{cohort} to Cohort
49
+}
50
+
51
+relationship OneToOne {
52
+	UserProfile{user} to User
53
+}
54
+
55
+relationship OneToOne {
56
+    Post{poster} to User
57
+}
58
+
59
+relationship OneToOne {
60
+	UserProfile{cohort} to Cohort
61
+}
62
+
63
+relationship OneToOne {
64
+	UserProfile{employer} to Employer
65
+}
66
+
67
+relationship OneToOne {
68
+	Post{privacySetting} to Privacy
69
+}
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+

+ 95
- 0
src/main/java/rocks/zipcode/io/domain/Cohort.java 查看文件

@@ -0,0 +1,95 @@
1
+package rocks.zipcode.io.domain;
2
+
3
+import org.hibernate.annotations.Cache;
4
+import org.hibernate.annotations.CacheConcurrencyStrategy;
5
+
6
+import javax.persistence.*;
7
+
8
+import java.io.Serializable;
9
+import java.util.Objects;
10
+
11
+/**
12
+ * A Cohort.
13
+ */
14
+@Entity
15
+@Table(name = "cohort")
16
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
17
+public class Cohort implements Serializable {
18
+
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    @Id
22
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
+    private Long id;
24
+
25
+    @Column(name = "cohort_id")
26
+    private Double cohortId;
27
+
28
+    @Column(name = "grad_date")
29
+    private String gradDate;
30
+
31
+    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
32
+    public Long getId() {
33
+        return id;
34
+    }
35
+
36
+    public void setId(Long id) {
37
+        this.id = id;
38
+    }
39
+
40
+    public Double getCohortId() {
41
+        return cohortId;
42
+    }
43
+
44
+    public Cohort cohortId(Double cohortId) {
45
+        this.cohortId = cohortId;
46
+        return this;
47
+    }
48
+
49
+    public void setCohortId(Double cohortId) {
50
+        this.cohortId = cohortId;
51
+    }
52
+
53
+    public String getGradDate() {
54
+        return gradDate;
55
+    }
56
+
57
+    public Cohort gradDate(String gradDate) {
58
+        this.gradDate = gradDate;
59
+        return this;
60
+    }
61
+
62
+    public void setGradDate(String gradDate) {
63
+        this.gradDate = gradDate;
64
+    }
65
+    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
66
+
67
+    @Override
68
+    public boolean equals(Object o) {
69
+        if (this == o) {
70
+            return true;
71
+        }
72
+        if (o == null || getClass() != o.getClass()) {
73
+            return false;
74
+        }
75
+        Cohort cohort = (Cohort) o;
76
+        if (cohort.getId() == null || getId() == null) {
77
+            return false;
78
+        }
79
+        return Objects.equals(getId(), cohort.getId());
80
+    }
81
+
82
+    @Override
83
+    public int hashCode() {
84
+        return Objects.hashCode(getId());
85
+    }
86
+
87
+    @Override
88
+    public String toString() {
89
+        return "Cohort{" +
90
+            "id=" + getId() +
91
+            ", cohortId=" + getCohortId() +
92
+            ", gradDate='" + getGradDate() + "'" +
93
+            "}";
94
+    }
95
+}

+ 129
- 0
src/main/java/rocks/zipcode/io/domain/Employer.java 查看文件

@@ -0,0 +1,129 @@
1
+package rocks.zipcode.io.domain;
2
+
3
+import org.hibernate.annotations.Cache;
4
+import org.hibernate.annotations.CacheConcurrencyStrategy;
5
+
6
+import javax.persistence.*;
7
+
8
+import java.io.Serializable;
9
+import java.util.Objects;
10
+
11
+/**
12
+ * A Employer.
13
+ */
14
+@Entity
15
+@Table(name = "employer")
16
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
17
+public class Employer implements Serializable {
18
+
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    @Id
22
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
+    private Long id;
24
+
25
+    @Column(name = "employer_id")
26
+    private Long employerId;
27
+
28
+    @Column(name = "company_name")
29
+    private String companyName;
30
+
31
+    @Column(name = "city")
32
+    private String city;
33
+
34
+    @Column(name = "state")
35
+    private String state;
36
+
37
+    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
38
+    public Long getId() {
39
+        return id;
40
+    }
41
+
42
+    public void setId(Long id) {
43
+        this.id = id;
44
+    }
45
+
46
+    public Long getEmployerId() {
47
+        return employerId;
48
+    }
49
+
50
+    public Employer employerId(Long employerId) {
51
+        this.employerId = employerId;
52
+        return this;
53
+    }
54
+
55
+    public void setEmployerId(Long employerId) {
56
+        this.employerId = employerId;
57
+    }
58
+
59
+    public String getCompanyName() {
60
+        return companyName;
61
+    }
62
+
63
+    public Employer companyName(String companyName) {
64
+        this.companyName = companyName;
65
+        return this;
66
+    }
67
+
68
+    public void setCompanyName(String companyName) {
69
+        this.companyName = companyName;
70
+    }
71
+
72
+    public String getCity() {
73
+        return city;
74
+    }
75
+
76
+    public Employer city(String city) {
77
+        this.city = city;
78
+        return this;
79
+    }
80
+
81
+    public void setCity(String city) {
82
+        this.city = city;
83
+    }
84
+
85
+    public String getState() {
86
+        return state;
87
+    }
88
+
89
+    public Employer state(String state) {
90
+        this.state = state;
91
+        return this;
92
+    }
93
+
94
+    public void setState(String state) {
95
+        this.state = state;
96
+    }
97
+    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
98
+
99
+    @Override
100
+    public boolean equals(Object o) {
101
+        if (this == o) {
102
+            return true;
103
+        }
104
+        if (o == null || getClass() != o.getClass()) {
105
+            return false;
106
+        }
107
+        Employer employer = (Employer) o;
108
+        if (employer.getId() == null || getId() == null) {
109
+            return false;
110
+        }
111
+        return Objects.equals(getId(), employer.getId());
112
+    }
113
+
114
+    @Override
115
+    public int hashCode() {
116
+        return Objects.hashCode(getId());
117
+    }
118
+
119
+    @Override
120
+    public String toString() {
121
+        return "Employer{" +
122
+            "id=" + getId() +
123
+            ", employerId=" + getEmployerId() +
124
+            ", companyName='" + getCompanyName() + "'" +
125
+            ", city='" + getCity() + "'" +
126
+            ", state='" + getState() + "'" +
127
+            "}";
128
+    }
129
+}

+ 164
- 0
src/main/java/rocks/zipcode/io/domain/Post.java 查看文件

@@ -0,0 +1,164 @@
1
+package rocks.zipcode.io.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4
+import org.hibernate.annotations.Cache;
5
+import org.hibernate.annotations.CacheConcurrencyStrategy;
6
+
7
+import javax.persistence.*;
8
+
9
+import java.io.Serializable;
10
+import java.time.LocalDate;
11
+import java.util.Objects;
12
+
13
+/**
14
+ * A Post.
15
+ */
16
+@Entity
17
+@Table(name = "post")
18
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
19
+public class Post implements Serializable {
20
+
21
+    private static final long serialVersionUID = 1L;
22
+
23
+    @Id
24
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
25
+    private Long id;
26
+
27
+    @Column(name = "post_id")
28
+    private Long postId;
29
+
30
+    @Column(name = "jhi_timestamp")
31
+    private LocalDate timestamp;
32
+
33
+    @Column(name = "content")
34
+    private String content;
35
+
36
+    @Column(name = "likes")
37
+    private String likes;
38
+
39
+    @OneToOne    @JoinColumn(unique = true)
40
+    private Privacy privacySetting;
41
+
42
+    @ManyToOne
43
+    @JsonIgnoreProperties("")
44
+    private User poster;
45
+
46
+    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
47
+    public Long getId() {
48
+        return id;
49
+    }
50
+
51
+    public void setId(Long id) {
52
+        this.id = id;
53
+    }
54
+
55
+    public Long getPostId() {
56
+        return postId;
57
+    }
58
+
59
+    public Post postId(Long postId) {
60
+        this.postId = postId;
61
+        return this;
62
+    }
63
+
64
+    public void setPostId(Long postId) {
65
+        this.postId = postId;
66
+    }
67
+
68
+    public LocalDate getTimestamp() {
69
+        return timestamp;
70
+    }
71
+
72
+    public Post timestamp(LocalDate timestamp) {
73
+        this.timestamp = timestamp;
74
+        return this;
75
+    }
76
+
77
+    public void setTimestamp(LocalDate timestamp) {
78
+        this.timestamp = timestamp;
79
+    }
80
+
81
+    public String getContent() {
82
+        return content;
83
+    }
84
+
85
+    public Post content(String content) {
86
+        this.content = content;
87
+        return this;
88
+    }
89
+
90
+    public void setContent(String content) {
91
+        this.content = content;
92
+    }
93
+
94
+    public String getLikes() {
95
+        return likes;
96
+    }
97
+
98
+    public Post likes(String likes) {
99
+        this.likes = likes;
100
+        return this;
101
+    }
102
+
103
+    public void setLikes(String likes) {
104
+        this.likes = likes;
105
+    }
106
+
107
+    public User getPoster() {
108
+        return poster;
109
+    }
110
+
111
+    public Post poster(User user) {
112
+        this.poster = user;
113
+        return this;
114
+    }
115
+
116
+    public void setPoster(User user) {
117
+        this.poster = user;
118
+    }
119
+
120
+    public Privacy getPrivacySetting() {
121
+        return privacySetting;
122
+    }
123
+
124
+    public Post privacySetting(Privacy privacy) {
125
+        this.privacySetting = privacy;
126
+        return this;
127
+    }
128
+
129
+    public void setPrivacySetting(Privacy privacy) {
130
+        this.privacySetting = privacy;
131
+    }
132
+
133
+
134
+    @Override
135
+    public boolean equals(Object o) {
136
+        if (this == o) {
137
+            return true;
138
+        }
139
+        if (o == null || getClass() != o.getClass()) {
140
+            return false;
141
+        }
142
+        Post post = (Post) o;
143
+        if (post.getId() == null || getId() == null) {
144
+            return false;
145
+        }
146
+        return Objects.equals(getId(), post.getId());
147
+    }
148
+
149
+    @Override
150
+    public int hashCode() {
151
+        return Objects.hashCode(getId());
152
+    }
153
+
154
+    @Override
155
+    public String toString() {
156
+        return "Post{" +
157
+            "id=" + getId() +
158
+            ", postId=" + getPostId() +
159
+            ", timestamp='" + getTimestamp() + "'" +
160
+            ", content='" + getContent() + "'" +
161
+            ", likes='" + getLikes() + "'" +
162
+            "}";
163
+    }
164
+}

+ 129
- 0
src/main/java/rocks/zipcode/io/domain/Privacy.java 查看文件

@@ -0,0 +1,129 @@
1
+package rocks.zipcode.io.domain;
2
+
3
+import org.hibernate.annotations.Cache;
4
+import org.hibernate.annotations.CacheConcurrencyStrategy;
5
+
6
+import javax.persistence.*;
7
+
8
+import java.io.Serializable;
9
+import java.util.Objects;
10
+
11
+/**
12
+ * A Privacy.
13
+ */
14
+@Entity
15
+@Table(name = "privacy")
16
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
17
+public class Privacy implements Serializable {
18
+
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    @Id
22
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
+    private Long id;
24
+
25
+    @Column(name = "privacy_id")
26
+    private Long privacyId;
27
+
28
+    @Column(name = "public_view")
29
+    private Boolean publicView;
30
+
31
+    @Column(name = "cohort_view")
32
+    private Boolean cohortView;
33
+
34
+    @Column(name = "employer_view")
35
+    private Boolean employerView;
36
+
37
+    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
38
+    public Long getId() {
39
+        return id;
40
+    }
41
+
42
+    public void setId(Long id) {
43
+        this.id = id;
44
+    }
45
+
46
+    public Long getPrivacyId() {
47
+        return privacyId;
48
+    }
49
+
50
+    public Privacy privacyId(Long privacyId) {
51
+        this.privacyId = privacyId;
52
+        return this;
53
+    }
54
+
55
+    public void setPrivacyId(Long privacyId) {
56
+        this.privacyId = privacyId;
57
+    }
58
+
59
+    public Boolean isPublicView() {
60
+        return publicView;
61
+    }
62
+
63
+    public Privacy publicView(Boolean publicView) {
64
+        this.publicView = publicView;
65
+        return this;
66
+    }
67
+
68
+    public void setPublicView(Boolean publicView) {
69
+        this.publicView = publicView;
70
+    }
71
+
72
+    public Boolean isCohortView() {
73
+        return cohortView;
74
+    }
75
+
76
+    public Privacy cohortView(Boolean cohortView) {
77
+        this.cohortView = cohortView;
78
+        return this;
79
+    }
80
+
81
+    public void setCohortView(Boolean cohortView) {
82
+        this.cohortView = cohortView;
83
+    }
84
+
85
+    public Boolean isEmployerView() {
86
+        return employerView;
87
+    }
88
+
89
+    public Privacy employerView(Boolean employerView) {
90
+        this.employerView = employerView;
91
+        return this;
92
+    }
93
+
94
+    public void setEmployerView(Boolean employerView) {
95
+        this.employerView = employerView;
96
+    }
97
+    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
98
+
99
+    @Override
100
+    public boolean equals(Object o) {
101
+        if (this == o) {
102
+            return true;
103
+        }
104
+        if (o == null || getClass() != o.getClass()) {
105
+            return false;
106
+        }
107
+        Privacy privacy = (Privacy) o;
108
+        if (privacy.getId() == null || getId() == null) {
109
+            return false;
110
+        }
111
+        return Objects.equals(getId(), privacy.getId());
112
+    }
113
+
114
+    @Override
115
+    public int hashCode() {
116
+        return Objects.hashCode(getId());
117
+    }
118
+
119
+    @Override
120
+    public String toString() {
121
+        return "Privacy{" +
122
+            "id=" + getId() +
123
+            ", privacyId=" + getPrivacyId() +
124
+            ", publicView='" + isPublicView() + "'" +
125
+            ", cohortView='" + isCohortView() + "'" +
126
+            ", employerView='" + isEmployerView() + "'" +
127
+            "}";
128
+    }
129
+}

+ 179
- 0
src/main/java/rocks/zipcode/io/domain/UserProfile.java 查看文件

@@ -0,0 +1,179 @@
1
+package rocks.zipcode.io.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4
+import org.hibernate.annotations.Cache;
5
+import org.hibernate.annotations.CacheConcurrencyStrategy;
6
+
7
+import javax.persistence.*;
8
+
9
+import java.io.Serializable;
10
+import java.util.Objects;
11
+
12
+/**
13
+ * A UserProfile.
14
+ */
15
+@Entity
16
+@Table(name = "user_profile")
17
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
18
+public class UserProfile implements Serializable {
19
+
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    @Id
23
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
24
+    private Long id;
25
+
26
+    @Column(name = "profile_id")
27
+    private Long profileId;
28
+
29
+    @Column(name = "first_name")
30
+    private String firstName;
31
+
32
+    @Column(name = "last_name")
33
+    private String lastName;
34
+
35
+    @Column(name = "user_stack")
36
+    private String userStack;
37
+
38
+    @OneToOne    @JoinColumn(unique = true)
39
+    private User user;
40
+
41
+    @ManyToOne
42
+    @JsonIgnoreProperties("")
43
+    private Employer employer;
44
+
45
+    @ManyToOne
46
+    @JsonIgnoreProperties("")
47
+    private Cohort cohort;
48
+
49
+    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
50
+    public Long getId() {
51
+        return id;
52
+    }
53
+
54
+    public void setId(Long id) {
55
+        this.id = id;
56
+    }
57
+
58
+    public Long getProfileId() {
59
+        return profileId;
60
+    }
61
+
62
+    public UserProfile profileId(Long profileId) {
63
+        this.profileId = profileId;
64
+        return this;
65
+    }
66
+
67
+    public void setProfileId(Long profileId) {
68
+        this.profileId = profileId;
69
+    }
70
+
71
+    public String getFirstName() {
72
+        return firstName;
73
+    }
74
+
75
+    public UserProfile firstName(String firstName) {
76
+        this.firstName = firstName;
77
+        return this;
78
+    }
79
+
80
+    public void setFirstName(String firstName) {
81
+        this.firstName = firstName;
82
+    }
83
+
84
+    public String getLastName() {
85
+        return lastName;
86
+    }
87
+
88
+    public UserProfile lastName(String lastName) {
89
+        this.lastName = lastName;
90
+        return this;
91
+    }
92
+
93
+    public void setLastName(String lastName) {
94
+        this.lastName = lastName;
95
+    }
96
+
97
+    public String getUserStack() {
98
+        return userStack;
99
+    }
100
+
101
+    public UserProfile userStack(String userStack) {
102
+        this.userStack = userStack;
103
+        return this;
104
+    }
105
+
106
+    public void setUserStack(String userStack) {
107
+        this.userStack = userStack;
108
+    }
109
+
110
+    public User getUser() {
111
+        return user;
112
+    }
113
+
114
+    public UserProfile user(User user) {
115
+        this.user = user;
116
+        return this;
117
+    }
118
+
119
+    public void setUser(User user) {
120
+        this.user = user;
121
+    }
122
+
123
+    public Cohort getCohort() {
124
+        return cohort;
125
+    }
126
+
127
+    public UserProfile cohort(Cohort cohort) {
128
+        this.cohort = cohort;
129
+        return this;
130
+    }
131
+
132
+    public void setCohort(Cohort cohort) {
133
+        this.cohort = cohort;
134
+    }
135
+
136
+    public void setEmployer(Employer employer) {
137
+        this.employer = employer;
138
+    }
139
+
140
+    public Employer getEmployer() {
141
+        return employer;
142
+    }
143
+
144
+    public UserProfile employer(Employer employer) {
145
+        this.employer = employer;
146
+        return this;
147
+    }
148
+
149
+    @Override
150
+    public boolean equals(Object o) {
151
+        if (this == o) {
152
+            return true;
153
+        }
154
+        if (o == null || getClass() != o.getClass()) {
155
+            return false;
156
+        }
157
+        UserProfile userProfile = (UserProfile) o;
158
+        if (userProfile.getId() == null || getId() == null) {
159
+            return false;
160
+        }
161
+        return Objects.equals(getId(), userProfile.getId());
162
+    }
163
+
164
+    @Override
165
+    public int hashCode() {
166
+        return Objects.hashCode(getId());
167
+    }
168
+
169
+    @Override
170
+    public String toString() {
171
+        return "UserProfile{" +
172
+            "id=" + getId() +
173
+            ", profileId=" + getProfileId() +
174
+            ", firstName='" + getFirstName() + "'" +
175
+            ", lastName='" + getLastName() + "'" +
176
+            ", userStack='" + getUserStack() + "'" +
177
+            "}";
178
+    }
179
+}

+ 15
- 0
src/main/java/rocks/zipcode/io/repository/CohortRepository.java 查看文件

@@ -0,0 +1,15 @@
1
+package rocks.zipcode.io.repository;
2
+
3
+import rocks.zipcode.io.domain.Cohort;
4
+import org.springframework.data.jpa.repository.*;
5
+import org.springframework.stereotype.Repository;
6
+
7
+
8
+/**
9
+ * Spring Data  repository for the Cohort entity.
10
+ */
11
+@SuppressWarnings("unused")
12
+@Repository
13
+public interface CohortRepository extends JpaRepository<Cohort, Long> {
14
+
15
+}

+ 15
- 0
src/main/java/rocks/zipcode/io/repository/EmployerRepository.java 查看文件

@@ -0,0 +1,15 @@
1
+package rocks.zipcode.io.repository;
2
+
3
+import rocks.zipcode.io.domain.Employer;
4
+import org.springframework.data.jpa.repository.*;
5
+import org.springframework.stereotype.Repository;
6
+
7
+
8
+/**
9
+ * Spring Data  repository for the Employer entity.
10
+ */
11
+@SuppressWarnings("unused")
12
+@Repository
13
+public interface EmployerRepository extends JpaRepository<Employer, Long> {
14
+
15
+}

+ 19
- 0
src/main/java/rocks/zipcode/io/repository/PostRepository.java 查看文件

@@ -0,0 +1,19 @@
1
+package rocks.zipcode.io.repository;
2
+
3
+import rocks.zipcode.io.domain.Post;
4
+import org.springframework.data.jpa.repository.*;
5
+import org.springframework.stereotype.Repository;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * Spring Data  repository for the Post entity.
11
+ */
12
+@SuppressWarnings("unused")
13
+@Repository
14
+public interface PostRepository extends JpaRepository<Post, Long> {
15
+
16
+    @Query("select post from Post post where post.poster.login = ?#{principal.username}")
17
+    List<Post> findByPosterIsCurrentUser();
18
+
19
+}

+ 15
- 0
src/main/java/rocks/zipcode/io/repository/PrivacyRepository.java 查看文件

@@ -0,0 +1,15 @@
1
+package rocks.zipcode.io.repository;
2
+
3
+import rocks.zipcode.io.domain.Privacy;
4
+import org.springframework.data.jpa.repository.*;
5
+import org.springframework.stereotype.Repository;
6
+
7
+
8
+/**
9
+ * Spring Data  repository for the Privacy entity.
10
+ */
11
+@SuppressWarnings("unused")
12
+@Repository
13
+public interface PrivacyRepository extends JpaRepository<Privacy, Long> {
14
+
15
+}

+ 15
- 0
src/main/java/rocks/zipcode/io/repository/UserProfileRepository.java 查看文件

@@ -0,0 +1,15 @@
1
+package rocks.zipcode.io.repository;
2
+
3
+import rocks.zipcode.io.domain.UserProfile;
4
+import org.springframework.data.jpa.repository.*;
5
+import org.springframework.stereotype.Repository;
6
+
7
+
8
+/**
9
+ * Spring Data  repository for the UserProfile entity.
10
+ */
11
+@SuppressWarnings("unused")
12
+@Repository
13
+public interface UserProfileRepository extends JpaRepository<UserProfile, Long> {
14
+
15
+}

+ 119
- 0
src/main/java/rocks/zipcode/io/web/rest/CohortResource.java 查看文件

@@ -0,0 +1,119 @@
1
+package rocks.zipcode.io.web.rest;
2
+
3
+import com.codahale.metrics.annotation.Timed;
4
+import rocks.zipcode.io.domain.Cohort;
5
+import rocks.zipcode.io.repository.CohortRepository;
6
+import rocks.zipcode.io.web.rest.errors.BadRequestAlertException;
7
+import rocks.zipcode.io.web.rest.util.HeaderUtil;
8
+import io.github.jhipster.web.util.ResponseUtil;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.http.ResponseEntity;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.net.URI;
15
+import java.net.URISyntaxException;
16
+
17
+import java.util.List;
18
+import java.util.Optional;
19
+
20
+/**
21
+ * REST controller for managing Cohort.
22
+ */
23
+@RestController
24
+@RequestMapping("/api")
25
+public class CohortResource {
26
+
27
+    private final Logger log = LoggerFactory.getLogger(CohortResource.class);
28
+
29
+    private static final String ENTITY_NAME = "cohort";
30
+
31
+    private final CohortRepository cohortRepository;
32
+
33
+    public CohortResource(CohortRepository cohortRepository) {
34
+        this.cohortRepository = cohortRepository;
35
+    }
36
+
37
+    /**
38
+     * POST  /cohorts : Create a new cohort.
39
+     *
40
+     * @param cohort the cohort to create
41
+     * @return the ResponseEntity with status 201 (Created) and with body the new cohort, or with status 400 (Bad Request) if the cohort has already an ID
42
+     * @throws URISyntaxException if the Location URI syntax is incorrect
43
+     */
44
+    @PostMapping("/cohorts")
45
+    @Timed
46
+    public ResponseEntity<Cohort> createCohort(@RequestBody Cohort cohort) throws URISyntaxException {
47
+        log.debug("REST request to save Cohort : {}", cohort);
48
+        if (cohort.getId() != null) {
49
+            throw new BadRequestAlertException("A new cohort cannot already have an ID", ENTITY_NAME, "idexists");
50
+        }
51
+        Cohort result = cohortRepository.save(cohort);
52
+        return ResponseEntity.created(new URI("/api/cohorts/" + result.getId()))
53
+            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
54
+            .body(result);
55
+    }
56
+
57
+    /**
58
+     * PUT  /cohorts : Updates an existing cohort.
59
+     *
60
+     * @param cohort the cohort to update
61
+     * @return the ResponseEntity with status 200 (OK) and with body the updated cohort,
62
+     * or with status 400 (Bad Request) if the cohort is not valid,
63
+     * or with status 500 (Internal Server Error) if the cohort couldn't be updated
64
+     * @throws URISyntaxException if the Location URI syntax is incorrect
65
+     */
66
+    @PutMapping("/cohorts")
67
+    @Timed
68
+    public ResponseEntity<Cohort> updateCohort(@RequestBody Cohort cohort) throws URISyntaxException {
69
+        log.debug("REST request to update Cohort : {}", cohort);
70
+        if (cohort.getId() == null) {
71
+            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
72
+        }
73
+        Cohort result = cohortRepository.save(cohort);
74
+        return ResponseEntity.ok()
75
+            .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, cohort.getId().toString()))
76
+            .body(result);
77
+    }
78
+
79
+    /**
80
+     * GET  /cohorts : get all the cohorts.
81
+     *
82
+     * @return the ResponseEntity with status 200 (OK) and the list of cohorts in body
83
+     */
84
+    @GetMapping("/cohorts")
85
+    @Timed
86
+    public List<Cohort> getAllCohorts() {
87
+        log.debug("REST request to get all Cohorts");
88
+        return cohortRepository.findAll();
89
+    }
90
+
91
+    /**
92
+     * GET  /cohorts/:id : get the "id" cohort.
93
+     *
94
+     * @param id the id of the cohort to retrieve
95
+     * @return the ResponseEntity with status 200 (OK) and with body the cohort, or with status 404 (Not Found)
96
+     */
97
+    @GetMapping("/cohorts/{id}")
98
+    @Timed
99
+    public ResponseEntity<Cohort> getCohort(@PathVariable Long id) {
100
+        log.debug("REST request to get Cohort : {}", id);
101
+        Optional<Cohort> cohort = cohortRepository.findById(id);
102
+        return ResponseUtil.wrapOrNotFound(cohort);
103
+    }
104
+
105
+    /**
106
+     * DELETE  /cohorts/:id : delete the "id" cohort.
107
+     *
108
+     * @param id the id of the cohort to delete
109
+     * @return the ResponseEntity with status 200 (OK)
110
+     */
111
+    @DeleteMapping("/cohorts/{id}")
112
+    @Timed
113
+    public ResponseEntity<Void> deleteCohort(@PathVariable Long id) {
114
+        log.debug("REST request to delete Cohort : {}", id);
115
+
116
+        cohortRepository.deleteById(id);
117
+        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
118
+    }
119
+}

+ 119
- 0
src/main/java/rocks/zipcode/io/web/rest/EmployerResource.java 查看文件

@@ -0,0 +1,119 @@
1
+package rocks.zipcode.io.web.rest;
2
+
3
+import com.codahale.metrics.annotation.Timed;
4
+import rocks.zipcode.io.domain.Employer;
5
+import rocks.zipcode.io.repository.EmployerRepository;
6
+import rocks.zipcode.io.web.rest.errors.BadRequestAlertException;
7
+import rocks.zipcode.io.web.rest.util.HeaderUtil;
8
+import io.github.jhipster.web.util.ResponseUtil;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.http.ResponseEntity;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.net.URI;
15
+import java.net.URISyntaxException;
16
+
17
+import java.util.List;
18
+import java.util.Optional;
19
+
20
+/**
21
+ * REST controller for managing Employer.
22
+ */
23
+@RestController
24
+@RequestMapping("/api")
25
+public class EmployerResource {
26
+
27
+    private final Logger log = LoggerFactory.getLogger(EmployerResource.class);
28
+
29
+    private static final String ENTITY_NAME = "employer";
30
+
31
+    private final EmployerRepository employerRepository;
32
+
33
+    public EmployerResource(EmployerRepository employerRepository) {
34
+        this.employerRepository = employerRepository;
35
+    }
36
+
37
+    /**
38
+     * POST  /employers : Create a new employer.
39
+     *
40
+     * @param employer the employer to create
41
+     * @return the ResponseEntity with status 201 (Created) and with body the new employer, or with status 400 (Bad Request) if the employer has already an ID
42
+     * @throws URISyntaxException if the Location URI syntax is incorrect
43
+     */
44
+    @PostMapping("/employers")
45
+    @Timed
46
+    public ResponseEntity<Employer> createEmployer(@RequestBody Employer employer) throws URISyntaxException {
47
+        log.debug("REST request to save Employer : {}", employer);
48
+        if (employer.getId() != null) {
49
+            throw new BadRequestAlertException("A new employer cannot already have an ID", ENTITY_NAME, "idexists");
50
+        }
51
+        Employer result = employerRepository.save(employer);
52
+        return ResponseEntity.created(new URI("/api/employers/" + result.getId()))
53
+            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
54
+            .body(result);
55
+    }
56
+
57
+    /**
58
+     * PUT  /employers : Updates an existing employer.
59
+     *
60
+     * @param employer the employer to update
61
+     * @return the ResponseEntity with status 200 (OK) and with body the updated employer,
62
+     * or with status 400 (Bad Request) if the employer is not valid,
63
+     * or with status 500 (Internal Server Error) if the employer couldn't be updated
64
+     * @throws URISyntaxException if the Location URI syntax is incorrect
65
+     */
66
+    @PutMapping("/employers")
67
+    @Timed
68
+    public ResponseEntity<Employer> updateEmployer(@RequestBody Employer employer) throws URISyntaxException {
69
+        log.debug("REST request to update Employer : {}", employer);
70
+        if (employer.getId() == null) {
71
+            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
72
+        }
73
+        Employer result = employerRepository.save(employer);
74
+        return ResponseEntity.ok()
75
+            .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, employer.getId().toString()))
76
+            .body(result);
77
+    }
78
+
79
+    /**
80
+     * GET  /employers : get all the employers.
81
+     *
82
+     * @return the ResponseEntity with status 200 (OK) and the list of employers in body
83
+     */
84
+    @GetMapping("/employers")
85
+    @Timed
86
+    public List<Employer> getAllEmployers() {
87
+        log.debug("REST request to get all Employers");
88
+        return employerRepository.findAll();
89
+    }
90
+
91
+    /**
92
+     * GET  /employers/:id : get the "id" employer.
93
+     *
94
+     * @param id the id of the employer to retrieve
95
+     * @return the ResponseEntity with status 200 (OK) and with body the employer, or with status 404 (Not Found)
96
+     */
97
+    @GetMapping("/employers/{id}")
98
+    @Timed
99
+    public ResponseEntity<Employer> getEmployer(@PathVariable Long id) {
100
+        log.debug("REST request to get Employer : {}", id);
101
+        Optional<Employer> employer = employerRepository.findById(id);
102
+        return ResponseUtil.wrapOrNotFound(employer);
103
+    }
104
+
105
+    /**
106
+     * DELETE  /employers/:id : delete the "id" employer.
107
+     *
108
+     * @param id the id of the employer to delete
109
+     * @return the ResponseEntity with status 200 (OK)
110
+     */
111
+    @DeleteMapping("/employers/{id}")
112
+    @Timed
113
+    public ResponseEntity<Void> deleteEmployer(@PathVariable Long id) {
114
+        log.debug("REST request to delete Employer : {}", id);
115
+
116
+        employerRepository.deleteById(id);
117
+        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
118
+    }
119
+}

+ 119
- 0
src/main/java/rocks/zipcode/io/web/rest/PostResource.java 查看文件

@@ -0,0 +1,119 @@
1
+package rocks.zipcode.io.web.rest;
2
+
3
+import com.codahale.metrics.annotation.Timed;
4
+import rocks.zipcode.io.domain.Post;
5
+import rocks.zipcode.io.repository.PostRepository;
6
+import rocks.zipcode.io.web.rest.errors.BadRequestAlertException;
7
+import rocks.zipcode.io.web.rest.util.HeaderUtil;
8
+import io.github.jhipster.web.util.ResponseUtil;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.http.ResponseEntity;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.net.URI;
15
+import java.net.URISyntaxException;
16
+
17
+import java.util.List;
18
+import java.util.Optional;
19
+
20
+/**
21
+ * REST controller for managing Post.
22
+ */
23
+@RestController
24
+@RequestMapping("/api")
25
+public class PostResource {
26
+
27
+    private final Logger log = LoggerFactory.getLogger(PostResource.class);
28
+
29
+    private static final String ENTITY_NAME = "post";
30
+
31
+    private final PostRepository postRepository;
32
+
33
+    public PostResource(PostRepository postRepository) {
34
+        this.postRepository = postRepository;
35
+    }
36
+
37
+    /**
38
+     * POST  /posts : Create a new post.
39
+     *
40
+     * @param post the post to create
41
+     * @return the ResponseEntity with status 201 (Created) and with body the new post, or with status 400 (Bad Request) if the post has already an ID
42
+     * @throws URISyntaxException if the Location URI syntax is incorrect
43
+     */
44
+    @PostMapping("/posts")
45
+    @Timed
46
+    public ResponseEntity<Post> createPost(@RequestBody Post post) throws URISyntaxException {
47
+        log.debug("REST request to save Post : {}", post);
48
+        if (post.getId() != null) {
49
+            throw new BadRequestAlertException("A new post cannot already have an ID", ENTITY_NAME, "idexists");
50
+        }
51
+        Post result = postRepository.save(post);
52
+        return ResponseEntity.created(new URI("/api/posts/" + result.getId()))
53
+            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
54
+            .body(result);
55
+    }
56
+
57
+    /**
58
+     * PUT  /posts : Updates an existing post.
59
+     *
60
+     * @param post the post to update
61
+     * @return the ResponseEntity with status 200 (OK) and with body the updated post,
62
+     * or with status 400 (Bad Request) if the post is not valid,
63
+     * or with status 500 (Internal Server Error) if the post couldn't be updated
64
+     * @throws URISyntaxException if the Location URI syntax is incorrect
65
+     */
66
+    @PutMapping("/posts")
67
+    @Timed
68
+    public ResponseEntity<Post> updatePost(@RequestBody Post post) throws URISyntaxException {
69
+        log.debug("REST request to update Post : {}", post);
70
+        if (post.getId() == null) {
71
+            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
72
+        }
73
+        Post result = postRepository.save(post);
74
+        return ResponseEntity.ok()
75
+            .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, post.getId().toString()))
76
+            .body(result);
77
+    }
78
+
79
+    /**
80
+     * GET  /posts : get all the posts.
81
+     *
82
+     * @return the ResponseEntity with status 200 (OK) and the list of posts in body
83
+     */
84
+    @GetMapping("/posts")
85
+    @Timed
86
+    public List<Post> getAllPosts() {
87
+        log.debug("REST request to get all Posts");
88
+        return postRepository.findAll();
89
+    }
90
+
91
+    /**
92
+     * GET  /posts/:id : get the "id" post.
93
+     *
94
+     * @param id the id of the post to retrieve
95
+     * @return the ResponseEntity with status 200 (OK) and with body the post, or with status 404 (Not Found)
96
+     */
97
+    @GetMapping("/posts/{id}")
98
+    @Timed
99
+    public ResponseEntity<Post> getPost(@PathVariable Long id) {
100
+        log.debug("REST request to get Post : {}", id);
101
+        Optional<Post> post = postRepository.findById(id);
102
+        return ResponseUtil.wrapOrNotFound(post);
103
+    }
104
+
105
+    /**
106
+     * DELETE  /posts/:id : delete the "id" post.
107
+     *
108
+     * @param id the id of the post to delete
109
+     * @return the ResponseEntity with status 200 (OK)
110
+     */
111
+    @DeleteMapping("/posts/{id}")
112
+    @Timed
113
+    public ResponseEntity<Void> deletePost(@PathVariable Long id) {
114
+        log.debug("REST request to delete Post : {}", id);
115
+
116
+        postRepository.deleteById(id);
117
+        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
118
+    }
119
+}

+ 119
- 0
src/main/java/rocks/zipcode/io/web/rest/PrivacyResource.java 查看文件

@@ -0,0 +1,119 @@
1
+package rocks.zipcode.io.web.rest;
2
+
3
+import com.codahale.metrics.annotation.Timed;
4
+import rocks.zipcode.io.domain.Privacy;
5
+import rocks.zipcode.io.repository.PrivacyRepository;
6
+import rocks.zipcode.io.web.rest.errors.BadRequestAlertException;
7
+import rocks.zipcode.io.web.rest.util.HeaderUtil;
8
+import io.github.jhipster.web.util.ResponseUtil;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.http.ResponseEntity;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.net.URI;
15
+import java.net.URISyntaxException;
16
+
17
+import java.util.List;
18
+import java.util.Optional;
19
+
20
+/**
21
+ * REST controller for managing Privacy.
22
+ */
23
+@RestController
24
+@RequestMapping("/api")
25
+public class PrivacyResource {
26
+
27
+    private final Logger log = LoggerFactory.getLogger(PrivacyResource.class);
28
+
29
+    private static final String ENTITY_NAME = "privacy";
30
+
31
+    private final PrivacyRepository privacyRepository;
32
+
33
+    public PrivacyResource(PrivacyRepository privacyRepository) {
34
+        this.privacyRepository = privacyRepository;
35
+    }
36
+
37
+    /**
38
+     * POST  /privacies : Create a new privacy.
39
+     *
40
+     * @param privacy the privacy to create
41
+     * @return the ResponseEntity with status 201 (Created) and with body the new privacy, or with status 400 (Bad Request) if the privacy has already an ID
42
+     * @throws URISyntaxException if the Location URI syntax is incorrect
43
+     */
44
+    @PostMapping("/privacies")
45
+    @Timed
46
+    public ResponseEntity<Privacy> createPrivacy(@RequestBody Privacy privacy) throws URISyntaxException {
47
+        log.debug("REST request to save Privacy : {}", privacy);
48
+        if (privacy.getId() != null) {
49
+            throw new BadRequestAlertException("A new privacy cannot already have an ID", ENTITY_NAME, "idexists");
50
+        }
51
+        Privacy result = privacyRepository.save(privacy);
52
+        return ResponseEntity.created(new URI("/api/privacies/" + result.getId()))
53
+            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
54
+            .body(result);
55
+    }
56
+
57
+    /**
58
+     * PUT  /privacies : Updates an existing privacy.
59
+     *
60
+     * @param privacy the privacy to update
61
+     * @return the ResponseEntity with status 200 (OK) and with body the updated privacy,
62
+     * or with status 400 (Bad Request) if the privacy is not valid,
63
+     * or with status 500 (Internal Server Error) if the privacy couldn't be updated
64
+     * @throws URISyntaxException if the Location URI syntax is incorrect
65
+     */
66
+    @PutMapping("/privacies")
67
+    @Timed
68
+    public ResponseEntity<Privacy> updatePrivacy(@RequestBody Privacy privacy) throws URISyntaxException {
69
+        log.debug("REST request to update Privacy : {}", privacy);
70
+        if (privacy.getId() == null) {
71
+            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
72
+        }
73
+        Privacy result = privacyRepository.save(privacy);
74
+        return ResponseEntity.ok()
75
+            .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, privacy.getId().toString()))
76
+            .body(result);
77
+    }
78
+
79
+    /**
80
+     * GET  /privacies : get all the privacies.
81
+     *
82
+     * @return the ResponseEntity with status 200 (OK) and the list of privacies in body
83
+     */
84
+    @GetMapping("/privacies")
85
+    @Timed
86
+    public List<Privacy> getAllPrivacies() {
87
+        log.debug("REST request to get all Privacies");
88
+        return privacyRepository.findAll();
89
+    }
90
+
91
+    /**
92
+     * GET  /privacies/:id : get the "id" privacy.
93
+     *
94
+     * @param id the id of the privacy to retrieve
95
+     * @return the ResponseEntity with status 200 (OK) and with body the privacy, or with status 404 (Not Found)
96
+     */
97
+    @GetMapping("/privacies/{id}")
98
+    @Timed
99
+    public ResponseEntity<Privacy> getPrivacy(@PathVariable Long id) {
100
+        log.debug("REST request to get Privacy : {}", id);
101
+        Optional<Privacy> privacy = privacyRepository.findById(id);
102
+        return ResponseUtil.wrapOrNotFound(privacy);
103
+    }
104
+
105
+    /**
106
+     * DELETE  /privacies/:id : delete the "id" privacy.
107
+     *
108
+     * @param id the id of the privacy to delete
109
+     * @return the ResponseEntity with status 200 (OK)
110
+     */
111
+    @DeleteMapping("/privacies/{id}")
112
+    @Timed
113
+    public ResponseEntity<Void> deletePrivacy(@PathVariable Long id) {
114
+        log.debug("REST request to delete Privacy : {}", id);
115
+
116
+        privacyRepository.deleteById(id);
117
+        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
118
+    }
119
+}

+ 119
- 0
src/main/java/rocks/zipcode/io/web/rest/UserProfileResource.java 查看文件

@@ -0,0 +1,119 @@
1
+package rocks.zipcode.io.web.rest;
2
+
3
+import com.codahale.metrics.annotation.Timed;
4
+import rocks.zipcode.io.domain.UserProfile;
5
+import rocks.zipcode.io.repository.UserProfileRepository;
6
+import rocks.zipcode.io.web.rest.errors.BadRequestAlertException;
7
+import rocks.zipcode.io.web.rest.util.HeaderUtil;
8
+import io.github.jhipster.web.util.ResponseUtil;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.http.ResponseEntity;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+import java.net.URI;
15
+import java.net.URISyntaxException;
16
+
17
+import java.util.List;
18
+import java.util.Optional;
19
+
20
+/**
21
+ * REST controller for managing UserProfile.
22
+ */
23
+@RestController
24
+@RequestMapping("/api")
25
+public class UserProfileResource {
26
+
27
+    private final Logger log = LoggerFactory.getLogger(UserProfileResource.class);
28
+
29
+    private static final String ENTITY_NAME = "userProfile";
30
+
31
+    private final UserProfileRepository userProfileRepository;
32
+
33
+    public UserProfileResource(UserProfileRepository userProfileRepository) {
34
+        this.userProfileRepository = userProfileRepository;
35
+    }
36
+
37
+    /**
38
+     * POST  /user-profiles : Create a new userProfile.
39
+     *
40
+     * @param userProfile the userProfile to create
41
+     * @return the ResponseEntity with status 201 (Created) and with body the new userProfile, or with status 400 (Bad Request) if the userProfile has already an ID
42
+     * @throws URISyntaxException if the Location URI syntax is incorrect
43
+     */
44
+    @PostMapping("/user-profiles")
45
+    @Timed
46
+    public ResponseEntity<UserProfile> createUserProfile(@RequestBody UserProfile userProfile) throws URISyntaxException {
47
+        log.debug("REST request to save UserProfile : {}", userProfile);
48
+        if (userProfile.getId() != null) {
49
+            throw new BadRequestAlertException("A new userProfile cannot already have an ID", ENTITY_NAME, "idexists");
50
+        }
51
+        UserProfile result = userProfileRepository.save(userProfile);
52
+        return ResponseEntity.created(new URI("/api/user-profiles/" + result.getId()))
53
+            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
54
+            .body(result);
55
+    }
56
+
57
+    /**
58
+     * PUT  /user-profiles : Updates an existing userProfile.
59
+     *
60
+     * @param userProfile the userProfile to update
61
+     * @return the ResponseEntity with status 200 (OK) and with body the updated userProfile,
62
+     * or with status 400 (Bad Request) if the userProfile is not valid,
63
+     * or with status 500 (Internal Server Error) if the userProfile couldn't be updated
64
+     * @throws URISyntaxException if the Location URI syntax is incorrect
65
+     */
66
+    @PutMapping("/user-profiles")
67
+    @Timed
68
+    public ResponseEntity<UserProfile> updateUserProfile(@RequestBody UserProfile userProfile) throws URISyntaxException {
69
+        log.debug("REST request to update UserProfile : {}", userProfile);
70
+        if (userProfile.getId() == null) {
71
+            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
72
+        }
73
+        UserProfile result = userProfileRepository.save(userProfile);
74
+        return ResponseEntity.ok()
75
+            .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, userProfile.getId().toString()))
76
+            .body(result);
77
+    }
78
+
79
+    /**
80
+     * GET  /user-profiles : get all the userProfiles.
81
+     *
82
+     * @return the ResponseEntity with status 200 (OK) and the list of userProfiles in body
83
+     */
84
+    @GetMapping("/user-profiles")
85
+    @Timed
86
+    public List<UserProfile> getAllUserProfiles() {
87
+        log.debug("REST request to get all UserProfiles");
88
+        return userProfileRepository.findAll();
89
+    }
90
+
91
+    /**
92
+     * GET  /user-profiles/:id : get the "id" userProfile.
93
+     *
94
+     * @param id the id of the userProfile to retrieve
95
+     * @return the ResponseEntity with status 200 (OK) and with body the userProfile, or with status 404 (Not Found)
96
+     */
97
+    @GetMapping("/user-profiles/{id}")
98
+    @Timed
99
+    public ResponseEntity<UserProfile> getUserProfile(@PathVariable Long id) {
100
+        log.debug("REST request to get UserProfile : {}", id);
101
+        Optional<UserProfile> userProfile = userProfileRepository.findById(id);
102
+        return ResponseUtil.wrapOrNotFound(userProfile);
103
+    }
104
+
105
+    /**
106
+     * DELETE  /user-profiles/:id : delete the "id" userProfile.
107
+     *
108
+     * @param id the id of the userProfile to delete
109
+     * @return the ResponseEntity with status 200 (OK)
110
+     */
111
+    @DeleteMapping("/user-profiles/{id}")
112
+    @Timed
113
+    public ResponseEntity<Void> deleteUserProfile(@PathVariable Long id) {
114
+        log.debug("REST request to delete UserProfile : {}", id);
115
+
116
+        userProfileRepository.deleteById(id);
117
+        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
118
+    }
119
+}

+ 60
- 0
src/main/resources/config/liquibase/changelog/20181217184612_added_entity_UserProfile.xml 查看文件

@@ -0,0 +1,60 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
5
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
7
+                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
8
+
9
+    <property name="now" value="now()" dbms="h2"/>
10
+
11
+    <property name="now" value="now()" dbms="mysql"/>
12
+    <property name="autoIncrement" value="true"/>
13
+
14
+    <property name="floatType" value="float4" dbms="postgresql, h2"/>
15
+    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
16
+
17
+    <!--
18
+        Added the entity UserProfile.
19
+    -->
20
+    <changeSet id="20181217184612-1" author="jhipster">
21
+        <createTable tableName="user_profile">
22
+            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
23
+                <constraints primaryKey="true" nullable="false"/>
24
+            </column>
25
+            <column name="profile_id" type="bigint">
26
+                <constraints nullable="true" />
27
+            </column>
28
+
29
+            <column name="first_name" type="varchar(255)">
30
+                <constraints nullable="true" />
31
+            </column>
32
+
33
+            <column name="last_name" type="varchar(255)">
34
+                <constraints nullable="true" />
35
+            </column>
36
+
37
+            <column name="user_stack" type="varchar(255)">
38
+                <constraints nullable="true" />
39
+            </column>
40
+            <column name="user_id" type="bigint">
41
+                <constraints unique="true" nullable="true" uniqueConstraintName="ux_user_profile_user_id" />
42
+            </column>            <column name="cohort_id" type="bigint">
43
+                <constraints unique="true" nullable="true" uniqueConstraintName="ux_user_profile_cohort_id" />
44
+            </column>            <column name="employer_id" type="bigint">
45
+                <constraints unique="true" nullable="true" uniqueConstraintName="ux_user_profile_employer_id" />
46
+            </column>
47
+            <column name="employer_id" type="bigint">
48
+                <constraints nullable="true" />
49
+            </column>
50
+
51
+            <column name="cohort_id" type="bigint">
52
+                <constraints nullable="true" />
53
+            </column>
54
+
55
+            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
56
+        </createTable>
57
+        
58
+    </changeSet>
59
+    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
60
+</databaseChangeLog>

+ 42
- 0
src/main/resources/config/liquibase/changelog/20181217184612_added_entity_constraints_UserProfile.xml 查看文件

@@ -0,0 +1,42 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6
+    <!--
7
+        Added the constraints for entity UserProfile.
8
+    -->
9
+    <changeSet id="20181217184612-2" author="jhipster">
10
+        
11
+        <addForeignKeyConstraint baseColumnNames="user_id"
12
+                                 baseTableName="user_profile"
13
+                                 constraintName="fk_user_profile_user_id"
14
+                                 referencedColumnNames="id"
15
+                                 referencedTableName="jhi_user"/>
16
+
17
+        <addForeignKeyConstraint baseColumnNames="cohort_id"
18
+                                 baseTableName="user_profile"
19
+                                 constraintName="fk_user_profile_cohort_id"
20
+                                 referencedColumnNames="id"
21
+                                 referencedTableName="cohort"/>
22
+
23
+        <addForeignKeyConstraint baseColumnNames="employer_id"
24
+                                 baseTableName="user_profile"
25
+                                 constraintName="fk_user_profile_employer_id"
26
+                                 referencedColumnNames="id"
27
+                                 referencedTableName="employer"/>
28
+
29
+        <addForeignKeyConstraint baseColumnNames="employer_id"
30
+                                 baseTableName="user_profile"
31
+                                 constraintName="fk_user_profile_employer_id"
32
+                                 referencedColumnNames="id"
33
+                                 referencedTableName="employer"/>
34
+
35
+        <addForeignKeyConstraint baseColumnNames="cohort_id"
36
+                                 baseTableName="user_profile"
37
+                                 constraintName="fk_user_profile_cohort_id"
38
+                                 referencedColumnNames="id"
39
+                                 referencedTableName="cohort"/>
40
+
41
+    </changeSet>
42
+</databaseChangeLog>

+ 38
- 0
src/main/resources/config/liquibase/changelog/20181217184613_added_entity_Cohort.xml 查看文件

@@ -0,0 +1,38 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
5
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
7
+                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
8
+
9
+    <property name="now" value="now()" dbms="h2"/>
10
+
11
+    <property name="now" value="now()" dbms="mysql"/>
12
+    <property name="autoIncrement" value="true"/>
13
+
14
+    <property name="floatType" value="float4" dbms="postgresql, h2"/>
15
+    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
16
+
17
+    <!--
18
+        Added the entity Cohort.
19
+    -->
20
+    <changeSet id="20181217184613-1" author="jhipster">
21
+        <createTable tableName="cohort">
22
+            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
23
+                <constraints primaryKey="true" nullable="false"/>
24
+            </column>
25
+            <column name="cohort_id" type="double">
26
+                <constraints nullable="true" />
27
+            </column>
28
+
29
+            <column name="grad_date" type="varchar(255)">
30
+                <constraints nullable="true" />
31
+            </column>
32
+
33
+            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
34
+        </createTable>
35
+        
36
+    </changeSet>
37
+    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
38
+</databaseChangeLog>

+ 46
- 0
src/main/resources/config/liquibase/changelog/20181217184614_added_entity_Employer.xml 查看文件

@@ -0,0 +1,46 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
5
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
7
+                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
8
+
9
+    <property name="now" value="now()" dbms="h2"/>
10
+
11
+    <property name="now" value="now()" dbms="mysql"/>
12
+    <property name="autoIncrement" value="true"/>
13
+
14
+    <property name="floatType" value="float4" dbms="postgresql, h2"/>
15
+    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
16
+
17
+    <!--
18
+        Added the entity Employer.
19
+    -->
20
+    <changeSet id="20181217184614-1" author="jhipster">
21
+        <createTable tableName="employer">
22
+            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
23
+                <constraints primaryKey="true" nullable="false"/>
24
+            </column>
25
+            <column name="employer_id" type="bigint">
26
+                <constraints nullable="true" />
27
+            </column>
28
+
29
+            <column name="company_name" type="varchar(255)">
30
+                <constraints nullable="true" />
31
+            </column>
32
+
33
+            <column name="city" type="varchar(255)">
34
+                <constraints nullable="true" />
35
+            </column>
36
+
37
+            <column name="state" type="varchar(255)">
38
+                <constraints nullable="true" />
39
+            </column>
40
+
41
+            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
42
+        </createTable>
43
+        
44
+    </changeSet>
45
+    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
46
+</databaseChangeLog>

+ 54
- 0
src/main/resources/config/liquibase/changelog/20181217184615_added_entity_Post.xml 查看文件

@@ -0,0 +1,54 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
5
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
7
+                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
8
+
9
+    <property name="now" value="now()" dbms="h2"/>
10
+
11
+    <property name="now" value="now()" dbms="mysql"/>
12
+    <property name="autoIncrement" value="true"/>
13
+
14
+    <property name="floatType" value="float4" dbms="postgresql, h2"/>
15
+    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
16
+
17
+    <!--
18
+        Added the entity Post.
19
+    -->
20
+    <changeSet id="20181217184615-1" author="jhipster">
21
+        <createTable tableName="post">
22
+            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
23
+                <constraints primaryKey="true" nullable="false"/>
24
+            </column>
25
+            <column name="post_id" type="bigint">
26
+                <constraints nullable="true" />
27
+            </column>
28
+
29
+            <column name="jhi_timestamp" type="date">
30
+                <constraints nullable="true" />
31
+            </column>
32
+
33
+            <column name="content" type="varchar(255)">
34
+                <constraints nullable="true" />
35
+            </column>
36
+
37
+            <column name="likes" type="varchar(255)">
38
+                <constraints nullable="true" />
39
+            </column>
40
+            <column name="poster_id" type="bigint">
41
+                <constraints unique="true" nullable="true" uniqueConstraintName="ux_post_poster_id" />
42
+            </column>            <column name="privacy_setting_id" type="bigint">
43
+                <constraints unique="true" nullable="true" uniqueConstraintName="ux_post_privacy_setting_id" />
44
+            </column>
45
+            <column name="poster_id" type="bigint">
46
+                <constraints nullable="true" />
47
+            </column>
48
+
49
+            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
50
+        </createTable>
51
+        
52
+    </changeSet>
53
+    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
54
+</databaseChangeLog>

+ 30
- 0
src/main/resources/config/liquibase/changelog/20181217184615_added_entity_constraints_Post.xml 查看文件

@@ -0,0 +1,30 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6
+    <!--
7
+        Added the constraints for entity Post.
8
+    -->
9
+    <changeSet id="20181217184615-2" author="jhipster">
10
+        
11
+        <addForeignKeyConstraint baseColumnNames="poster_id"
12
+                                 baseTableName="post"
13
+                                 constraintName="fk_post_poster_id"
14
+                                 referencedColumnNames="id"
15
+                                 referencedTableName="jhi_user"/>
16
+
17
+        <addForeignKeyConstraint baseColumnNames="privacy_setting_id"
18
+                                 baseTableName="post"
19
+                                 constraintName="fk_post_privacy_setting_id"
20
+                                 referencedColumnNames="id"
21
+                                 referencedTableName="privacy"/>
22
+
23
+        <addForeignKeyConstraint baseColumnNames="poster_id"
24
+                                 baseTableName="post"
25
+                                 constraintName="fk_post_poster_id"
26
+                                 referencedColumnNames="id"
27
+                                 referencedTableName="jhi_user"/>
28
+
29
+    </changeSet>
30
+</databaseChangeLog>

+ 46
- 0
src/main/resources/config/liquibase/changelog/20181217184616_added_entity_Privacy.xml 查看文件

@@ -0,0 +1,46 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<databaseChangeLog
3
+    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4
+    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
5
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
7
+                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
8
+
9
+    <property name="now" value="now()" dbms="h2"/>
10
+
11
+    <property name="now" value="now()" dbms="mysql"/>
12
+    <property name="autoIncrement" value="true"/>
13
+
14
+    <property name="floatType" value="float4" dbms="postgresql, h2"/>
15
+    <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
16
+
17
+    <!--
18
+        Added the entity Privacy.
19
+    -->
20
+    <changeSet id="20181217184616-1" author="jhipster">
21
+        <createTable tableName="privacy">
22
+            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
23
+                <constraints primaryKey="true" nullable="false"/>
24
+            </column>
25
+            <column name="privacy_id" type="bigint">
26
+                <constraints nullable="true" />
27
+            </column>
28
+
29
+            <column name="public_view" type="bit">
30
+                <constraints nullable="true" />
31
+            </column>
32
+
33
+            <column name="cohort_view" type="bit">
34
+                <constraints nullable="true" />
35
+            </column>
36
+
37
+            <column name="employer_view" type="bit">
38
+                <constraints nullable="true" />
39
+            </column>
40
+
41
+            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
42
+        </createTable>
43
+        
44
+    </changeSet>
45
+    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
46
+</databaseChangeLog>

+ 7
- 0
src/main/resources/config/liquibase/master.xml 查看文件

@@ -5,6 +5,13 @@
5 5
     xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6 6
 
7 7
     <include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
8
+    <include file="config/liquibase/changelog/20181217184612_added_entity_UserProfile.xml" relativeToChangelogFile="false"/>
9
+    <include file="config/liquibase/changelog/20181217184613_added_entity_Cohort.xml" relativeToChangelogFile="false"/>
10
+    <include file="config/liquibase/changelog/20181217184614_added_entity_Employer.xml" relativeToChangelogFile="false"/>
11
+    <include file="config/liquibase/changelog/20181217184615_added_entity_Post.xml" relativeToChangelogFile="false"/>
12
+    <include file="config/liquibase/changelog/20181217184616_added_entity_Privacy.xml" relativeToChangelogFile="false"/>
8 13
     <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
14
+    <include file="config/liquibase/changelog/20181217184612_added_entity_constraints_UserProfile.xml" relativeToChangelogFile="false"/>
15
+    <include file="config/liquibase/changelog/20181217184615_added_entity_constraints_Post.xml" relativeToChangelogFile="false"/>
9 16
     <!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
10 17
 </databaseChangeLog>

+ 19
- 0
src/main/webapp/app/entities/cohort/cohort-delete-dialog.component.html 查看文件

@@ -0,0 +1,19 @@
1
+<form name="deleteForm" (ngSubmit)="confirmDelete(cohort.id)">
2
+    <div class="modal-header">
3
+        <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
4
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
5
+                (click)="clear()">&times;</button>
6
+    </div>
7
+    <div class="modal-body">
8
+        <jhi-alert-error></jhi-alert-error>
9
+        <p id="jhi-delete-cohort-heading" jhiTranslate="zipConnectApp.cohort.delete.question" translateValues="{id: '{{cohort.id}}'}">Are you sure you want to delete this Cohort?</p>
10
+    </div>
11
+    <div class="modal-footer">
12
+        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
13
+            <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
14
+        </button>
15
+        <button id="jhi-confirm-delete-cohort" type="submit" class="btn btn-danger">
16
+            <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
17
+        </button>
18
+    </div>
19
+</form>

+ 65
- 0
src/main/webapp/app/entities/cohort/cohort-delete-dialog.component.ts 查看文件

@@ -0,0 +1,65 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { ActivatedRoute, Router } from '@angular/router';
3
+
4
+import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5
+import { JhiEventManager } from 'ng-jhipster';
6
+
7
+import { ICohort } from 'app/shared/model/cohort.model';
8
+import { CohortService } from './cohort.service';
9
+
10
+@Component({
11
+    selector: 'jhi-cohort-delete-dialog',
12
+    templateUrl: './cohort-delete-dialog.component.html'
13
+})
14
+export class CohortDeleteDialogComponent {
15
+    cohort: ICohort;
16
+
17
+    constructor(private cohortService: CohortService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {}
18
+
19
+    clear() {
20
+        this.activeModal.dismiss('cancel');
21
+    }
22
+
23
+    confirmDelete(id: number) {
24
+        this.cohortService.delete(id).subscribe(response => {
25
+            this.eventManager.broadcast({
26
+                name: 'cohortListModification',
27
+                content: 'Deleted an cohort'
28
+            });
29
+            this.activeModal.dismiss(true);
30
+        });
31
+    }
32
+}
33
+
34
+@Component({
35
+    selector: 'jhi-cohort-delete-popup',
36
+    template: ''
37
+})
38
+export class CohortDeletePopupComponent implements OnInit, OnDestroy {
39
+    private ngbModalRef: NgbModalRef;
40
+
41
+    constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {}
42
+
43
+    ngOnInit() {
44
+        this.activatedRoute.data.subscribe(({ cohort }) => {
45
+            setTimeout(() => {
46
+                this.ngbModalRef = this.modalService.open(CohortDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
47
+                this.ngbModalRef.componentInstance.cohort = cohort;
48
+                this.ngbModalRef.result.then(
49
+                    result => {
50
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
51
+                        this.ngbModalRef = null;
52
+                    },
53
+                    reason => {
54
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
55
+                        this.ngbModalRef = null;
56
+                    }
57
+                );
58
+            }, 0);
59
+        });
60
+    }
61
+
62
+    ngOnDestroy() {
63
+        this.ngbModalRef = null;
64
+    }
65
+}

+ 31
- 0
src/main/webapp/app/entities/cohort/cohort-detail.component.html 查看文件

@@ -0,0 +1,31 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <div *ngIf="cohort">
4
+            <h2><span jhiTranslate="zipConnectApp.cohort.detail.title">Cohort</span> {{cohort.id}}</h2>
5
+            <hr>
6
+            <jhi-alert-error></jhi-alert-error>
7
+            <dl class="row-md jh-entity-details">
8
+                <dt><span jhiTranslate="zipConnectApp.cohort.cohortId">Cohort Id</span></dt>
9
+                <dd>
10
+                    <span>{{cohort.cohortId}}</span>
11
+                </dd>
12
+                <dt><span jhiTranslate="zipConnectApp.cohort.gradDate">Grad Date</span></dt>
13
+                <dd>
14
+                    <span>{{cohort.gradDate}}</span>
15
+                </dd>
16
+            </dl>
17
+
18
+            <button type="submit"
19
+                    (click)="previousState()"
20
+                    class="btn btn-info">
21
+                <fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
22
+            </button>
23
+
24
+            <button type="button"
25
+                    [routerLink]="['/cohort', cohort.id, 'edit']"
26
+                    class="btn btn-primary">
27
+                <fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
28
+            </button>
29
+        </div>
30
+    </div>
31
+</div>

+ 24
- 0
src/main/webapp/app/entities/cohort/cohort-detail.component.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+
4
+import { ICohort } from 'app/shared/model/cohort.model';
5
+
6
+@Component({
7
+    selector: 'jhi-cohort-detail',
8
+    templateUrl: './cohort-detail.component.html'
9
+})
10
+export class CohortDetailComponent implements OnInit {
11
+    cohort: ICohort;
12
+
13
+    constructor(private activatedRoute: ActivatedRoute) {}
14
+
15
+    ngOnInit() {
16
+        this.activatedRoute.data.subscribe(({ cohort }) => {
17
+            this.cohort = cohort;
18
+        });
19
+    }
20
+
21
+    previousState() {
22
+        window.history.back();
23
+    }
24
+}

+ 34
- 0
src/main/webapp/app/entities/cohort/cohort-update.component.html 查看文件

@@ -0,0 +1,34 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
4
+            <h2 id="jhi-cohort-heading" jhiTranslate="zipConnectApp.cohort.home.createOrEditLabel">Create or edit a Cohort</h2>
5
+            <div>
6
+                <jhi-alert-error></jhi-alert-error>
7
+                <div class="form-group" [hidden]="!cohort.id">
8
+                    <label for="id" jhiTranslate="global.field.id">ID</label>
9
+                    <input type="text" class="form-control" id="id" name="id"
10
+                        [(ngModel)]="cohort.id" readonly />
11
+                </div>
12
+                <div class="form-group">
13
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.cohort.cohortId" for="field_cohortId">Cohort Id</label>
14
+                    <input type="number" class="form-control" name="cohortId" id="field_cohortId"
15
+                        [(ngModel)]="cohort.cohortId" />
16
+                </div>
17
+                <div class="form-group">
18
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.cohort.gradDate" for="field_gradDate">Grad Date</label>
19
+                    <input type="text" class="form-control" name="gradDate" id="field_gradDate"
20
+                        [(ngModel)]="cohort.gradDate" />
21
+                </div>
22
+
23
+            </div>
24
+            <div>
25
+                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
26
+                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
27
+                </button>
28
+                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
29
+                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
30
+                </button>
31
+            </div>
32
+        </form>
33
+    </div>
34
+</div>

+ 51
- 0
src/main/webapp/app/entities/cohort/cohort-update.component.ts 查看文件

@@ -0,0 +1,51 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
4
+import { Observable } from 'rxjs';
5
+
6
+import { ICohort } from 'app/shared/model/cohort.model';
7
+import { CohortService } from './cohort.service';
8
+
9
+@Component({
10
+    selector: 'jhi-cohort-update',
11
+    templateUrl: './cohort-update.component.html'
12
+})
13
+export class CohortUpdateComponent implements OnInit {
14
+    cohort: ICohort;
15
+    isSaving: boolean;
16
+
17
+    constructor(private cohortService: CohortService, private activatedRoute: ActivatedRoute) {}
18
+
19
+    ngOnInit() {
20
+        this.isSaving = false;
21
+        this.activatedRoute.data.subscribe(({ cohort }) => {
22
+            this.cohort = cohort;
23
+        });
24
+    }
25
+
26
+    previousState() {
27
+        window.history.back();
28
+    }
29
+
30
+    save() {
31
+        this.isSaving = true;
32
+        if (this.cohort.id !== undefined) {
33
+            this.subscribeToSaveResponse(this.cohortService.update(this.cohort));
34
+        } else {
35
+            this.subscribeToSaveResponse(this.cohortService.create(this.cohort));
36
+        }
37
+    }
38
+
39
+    private subscribeToSaveResponse(result: Observable<HttpResponse<ICohort>>) {
40
+        result.subscribe((res: HttpResponse<ICohort>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
41
+    }
42
+
43
+    private onSaveSuccess() {
44
+        this.isSaving = false;
45
+        this.previousState();
46
+    }
47
+
48
+    private onSaveError() {
49
+        this.isSaving = false;
50
+    }
51
+}

+ 56
- 0
src/main/webapp/app/entities/cohort/cohort.component.html 查看文件

@@ -0,0 +1,56 @@
1
+<div>
2
+    <h2 id="page-heading">
3
+        <span jhiTranslate="zipConnectApp.cohort.home.title">Cohorts</span>
4
+        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-cohort" [routerLink]="['/cohort/new']">
5
+            <fa-icon [icon]="'plus'"></fa-icon>
6
+            <span  jhiTranslate="zipConnectApp.cohort.home.createLabel">
7
+            Create new Cohort
8
+            </span>
9
+        </button>
10
+    </h2>
11
+    <jhi-alert></jhi-alert>
12
+    <br/>
13
+    <div class="table-responsive" *ngIf="cohorts">
14
+        <table class="table table-striped">
15
+            <thead>
16
+            <tr>
17
+            <th><span jhiTranslate="global.field.id">ID</span></th>
18
+            <th><span jhiTranslate="zipConnectApp.cohort.cohortId">Cohort Id</span></th>
19
+            <th><span jhiTranslate="zipConnectApp.cohort.gradDate">Grad Date</span></th>
20
+            <th></th>
21
+            </tr>
22
+            </thead>
23
+            <tbody>
24
+            <tr *ngFor="let cohort of cohorts ;trackBy: trackId">
25
+                <td><a [routerLink]="['/cohort', cohort.id, 'view' ]">{{cohort.id}}</a></td>
26
+                <td>{{cohort.cohortId}}</td>
27
+                <td>{{cohort.gradDate}}</td>
28
+                <td class="text-right">
29
+                    <div class="btn-group flex-btn-group-container">
30
+                        <button type="submit"
31
+                                [routerLink]="['/cohort', cohort.id, 'view' ]"
32
+                                class="btn btn-info btn-sm">
33
+                            <fa-icon [icon]="'eye'"></fa-icon>
34
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
35
+                        </button>
36
+                        <button type="submit"
37
+                                [routerLink]="['/cohort', cohort.id, 'edit']"
38
+                                class="btn btn-primary btn-sm">
39
+                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
40
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
41
+                        </button>
42
+                        <button type="submit"
43
+                                [routerLink]="['/', { outlets: { popup: 'cohort/'+ cohort.id + '/delete'} }]"
44
+                                replaceUrl="true"
45
+                                queryParamsHandling="merge"
46
+                                class="btn btn-danger btn-sm">
47
+                            <fa-icon [icon]="'times'"></fa-icon>
48
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
49
+                        </button>
50
+                    </div>
51
+                </td>
52
+            </tr>
53
+            </tbody>
54
+        </table>
55
+    </div>
56
+</div>

+ 58
- 0
src/main/webapp/app/entities/cohort/cohort.component.ts 查看文件

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
3
+import { Subscription } from 'rxjs';
4
+import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
5
+
6
+import { ICohort } from 'app/shared/model/cohort.model';
7
+import { Principal } from 'app/core';
8
+import { CohortService } from './cohort.service';
9
+
10
+@Component({
11
+    selector: 'jhi-cohort',
12
+    templateUrl: './cohort.component.html'
13
+})
14
+export class CohortComponent implements OnInit, OnDestroy {
15
+    cohorts: ICohort[];
16
+    currentAccount: any;
17
+    eventSubscriber: Subscription;
18
+
19
+    constructor(
20
+        private cohortService: CohortService,
21
+        private jhiAlertService: JhiAlertService,
22
+        private eventManager: JhiEventManager,
23
+        private principal: Principal
24
+    ) {}
25
+
26
+    loadAll() {
27
+        this.cohortService.query().subscribe(
28
+            (res: HttpResponse<ICohort[]>) => {
29
+                this.cohorts = res.body;
30
+            },
31
+            (res: HttpErrorResponse) => this.onError(res.message)
32
+        );
33
+    }
34
+
35
+    ngOnInit() {
36
+        this.loadAll();
37
+        this.principal.identity().then(account => {
38
+            this.currentAccount = account;
39
+        });
40
+        this.registerChangeInCohorts();
41
+    }
42
+
43
+    ngOnDestroy() {
44
+        this.eventManager.destroy(this.eventSubscriber);
45
+    }
46
+
47
+    trackId(index: number, item: ICohort) {
48
+        return item.id;
49
+    }
50
+
51
+    registerChangeInCohorts() {
52
+        this.eventSubscriber = this.eventManager.subscribe('cohortListModification', response => this.loadAll());
53
+    }
54
+
55
+    private onError(errorMessage: string) {
56
+        this.jhiAlertService.error(errorMessage, null, null);
57
+    }
58
+}

+ 23
- 0
src/main/webapp/app/entities/cohort/cohort.module.ts 查看文件

@@ -0,0 +1,23 @@
1
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+import { RouterModule } from '@angular/router';
3
+
4
+import { ZipConnectSharedModule } from 'app/shared';
5
+import {
6
+    CohortComponent,
7
+    CohortDetailComponent,
8
+    CohortUpdateComponent,
9
+    CohortDeletePopupComponent,
10
+    CohortDeleteDialogComponent,
11
+    cohortRoute,
12
+    cohortPopupRoute
13
+} from './';
14
+
15
+const ENTITY_STATES = [...cohortRoute, ...cohortPopupRoute];
16
+
17
+@NgModule({
18
+    imports: [ZipConnectSharedModule, RouterModule.forChild(ENTITY_STATES)],
19
+    declarations: [CohortComponent, CohortDetailComponent, CohortUpdateComponent, CohortDeleteDialogComponent, CohortDeletePopupComponent],
20
+    entryComponents: [CohortComponent, CohortUpdateComponent, CohortDeleteDialogComponent, CohortDeletePopupComponent],
21
+    schemas: [CUSTOM_ELEMENTS_SCHEMA]
22
+})
23
+export class ZipConnectCohortModule {}

+ 93
- 0
src/main/webapp/app/entities/cohort/cohort.route.ts 查看文件

@@ -0,0 +1,93 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpResponse } from '@angular/common/http';
3
+import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
4
+import { UserRouteAccessService } from 'app/core';
5
+import { Observable, of } from 'rxjs';
6
+import { filter, map } from 'rxjs/operators';
7
+import { Cohort } from 'app/shared/model/cohort.model';
8
+import { CohortService } from './cohort.service';
9
+import { CohortComponent } from './cohort.component';
10
+import { CohortDetailComponent } from './cohort-detail.component';
11
+import { CohortUpdateComponent } from './cohort-update.component';
12
+import { CohortDeletePopupComponent } from './cohort-delete-dialog.component';
13
+import { ICohort } from 'app/shared/model/cohort.model';
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class CohortResolve implements Resolve<ICohort> {
17
+    constructor(private service: CohortService) {}
18
+
19
+    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Cohort> {
20
+        const id = route.params['id'] ? route.params['id'] : null;
21
+        if (id) {
22
+            return this.service.find(id).pipe(
23
+                filter((response: HttpResponse<Cohort>) => response.ok),
24
+                map((cohort: HttpResponse<Cohort>) => cohort.body)
25
+            );
26
+        }
27
+        return of(new Cohort());
28
+    }
29
+}
30
+
31
+export const cohortRoute: Routes = [
32
+    {
33
+        path: 'cohort',
34
+        component: CohortComponent,
35
+        data: {
36
+            authorities: ['ROLE_USER'],
37
+            pageTitle: 'zipConnectApp.cohort.home.title'
38
+        },
39
+        canActivate: [UserRouteAccessService]
40
+    },
41
+    {
42
+        path: 'cohort/:id/view',
43
+        component: CohortDetailComponent,
44
+        resolve: {
45
+            cohort: CohortResolve
46
+        },
47
+        data: {
48
+            authorities: ['ROLE_USER'],
49
+            pageTitle: 'zipConnectApp.cohort.home.title'
50
+        },
51
+        canActivate: [UserRouteAccessService]
52
+    },
53
+    {
54
+        path: 'cohort/new',
55
+        component: CohortUpdateComponent,
56
+        resolve: {
57
+            cohort: CohortResolve
58
+        },
59
+        data: {
60
+            authorities: ['ROLE_USER'],
61
+            pageTitle: 'zipConnectApp.cohort.home.title'
62
+        },
63
+        canActivate: [UserRouteAccessService]
64
+    },
65
+    {
66
+        path: 'cohort/:id/edit',
67
+        component: CohortUpdateComponent,
68
+        resolve: {
69
+            cohort: CohortResolve
70
+        },
71
+        data: {
72
+            authorities: ['ROLE_USER'],
73
+            pageTitle: 'zipConnectApp.cohort.home.title'
74
+        },
75
+        canActivate: [UserRouteAccessService]
76
+    }
77
+];
78
+
79
+export const cohortPopupRoute: Routes = [
80
+    {
81
+        path: 'cohort/:id/delete',
82
+        component: CohortDeletePopupComponent,
83
+        resolve: {
84
+            cohort: CohortResolve
85
+        },
86
+        data: {
87
+            authorities: ['ROLE_USER'],
88
+            pageTitle: 'zipConnectApp.cohort.home.title'
89
+        },
90
+        canActivate: [UserRouteAccessService],
91
+        outlet: 'popup'
92
+    }
93
+];

+ 38
- 0
src/main/webapp/app/entities/cohort/cohort.service.ts 查看文件

@@ -0,0 +1,38 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpClient, HttpResponse } from '@angular/common/http';
3
+import { Observable } from 'rxjs';
4
+
5
+import { SERVER_API_URL } from 'app/app.constants';
6
+import { createRequestOption } from 'app/shared';
7
+import { ICohort } from 'app/shared/model/cohort.model';
8
+
9
+type EntityResponseType = HttpResponse<ICohort>;
10
+type EntityArrayResponseType = HttpResponse<ICohort[]>;
11
+
12
+@Injectable({ providedIn: 'root' })
13
+export class CohortService {
14
+    public resourceUrl = SERVER_API_URL + 'api/cohorts';
15
+
16
+    constructor(private http: HttpClient) {}
17
+
18
+    create(cohort: ICohort): Observable<EntityResponseType> {
19
+        return this.http.post<ICohort>(this.resourceUrl, cohort, { observe: 'response' });
20
+    }
21
+
22
+    update(cohort: ICohort): Observable<EntityResponseType> {
23
+        return this.http.put<ICohort>(this.resourceUrl, cohort, { observe: 'response' });
24
+    }
25
+
26
+    find(id: number): Observable<EntityResponseType> {
27
+        return this.http.get<ICohort>(`${this.resourceUrl}/${id}`, { observe: 'response' });
28
+    }
29
+
30
+    query(req?: any): Observable<EntityArrayResponseType> {
31
+        const options = createRequestOption(req);
32
+        return this.http.get<ICohort[]>(this.resourceUrl, { params: options, observe: 'response' });
33
+    }
34
+
35
+    delete(id: number): Observable<HttpResponse<any>> {
36
+        return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
37
+    }
38
+}

+ 6
- 0
src/main/webapp/app/entities/cohort/index.ts 查看文件

@@ -0,0 +1,6 @@
1
+export * from './cohort.service';
2
+export * from './cohort-update.component';
3
+export * from './cohort-delete-dialog.component';
4
+export * from './cohort-detail.component';
5
+export * from './cohort.component';
6
+export * from './cohort.route';

+ 19
- 0
src/main/webapp/app/entities/employer/employer-delete-dialog.component.html 查看文件

@@ -0,0 +1,19 @@
1
+<form name="deleteForm" (ngSubmit)="confirmDelete(employer.id)">
2
+    <div class="modal-header">
3
+        <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
4
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
5
+                (click)="clear()">&times;</button>
6
+    </div>
7
+    <div class="modal-body">
8
+        <jhi-alert-error></jhi-alert-error>
9
+        <p id="jhi-delete-employer-heading" jhiTranslate="zipConnectApp.employer.delete.question" translateValues="{id: '{{employer.id}}'}">Are you sure you want to delete this Employer?</p>
10
+    </div>
11
+    <div class="modal-footer">
12
+        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
13
+            <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
14
+        </button>
15
+        <button id="jhi-confirm-delete-employer" type="submit" class="btn btn-danger">
16
+            <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
17
+        </button>
18
+    </div>
19
+</form>

+ 65
- 0
src/main/webapp/app/entities/employer/employer-delete-dialog.component.ts 查看文件

@@ -0,0 +1,65 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { ActivatedRoute, Router } from '@angular/router';
3
+
4
+import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5
+import { JhiEventManager } from 'ng-jhipster';
6
+
7
+import { IEmployer } from 'app/shared/model/employer.model';
8
+import { EmployerService } from './employer.service';
9
+
10
+@Component({
11
+    selector: 'jhi-employer-delete-dialog',
12
+    templateUrl: './employer-delete-dialog.component.html'
13
+})
14
+export class EmployerDeleteDialogComponent {
15
+    employer: IEmployer;
16
+
17
+    constructor(private employerService: EmployerService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {}
18
+
19
+    clear() {
20
+        this.activeModal.dismiss('cancel');
21
+    }
22
+
23
+    confirmDelete(id: number) {
24
+        this.employerService.delete(id).subscribe(response => {
25
+            this.eventManager.broadcast({
26
+                name: 'employerListModification',
27
+                content: 'Deleted an employer'
28
+            });
29
+            this.activeModal.dismiss(true);
30
+        });
31
+    }
32
+}
33
+
34
+@Component({
35
+    selector: 'jhi-employer-delete-popup',
36
+    template: ''
37
+})
38
+export class EmployerDeletePopupComponent implements OnInit, OnDestroy {
39
+    private ngbModalRef: NgbModalRef;
40
+
41
+    constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {}
42
+
43
+    ngOnInit() {
44
+        this.activatedRoute.data.subscribe(({ employer }) => {
45
+            setTimeout(() => {
46
+                this.ngbModalRef = this.modalService.open(EmployerDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
47
+                this.ngbModalRef.componentInstance.employer = employer;
48
+                this.ngbModalRef.result.then(
49
+                    result => {
50
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
51
+                        this.ngbModalRef = null;
52
+                    },
53
+                    reason => {
54
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
55
+                        this.ngbModalRef = null;
56
+                    }
57
+                );
58
+            }, 0);
59
+        });
60
+    }
61
+
62
+    ngOnDestroy() {
63
+        this.ngbModalRef = null;
64
+    }
65
+}

+ 39
- 0
src/main/webapp/app/entities/employer/employer-detail.component.html 查看文件

@@ -0,0 +1,39 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <div *ngIf="employer">
4
+            <h2><span jhiTranslate="zipConnectApp.employer.detail.title">Employer</span> {{employer.id}}</h2>
5
+            <hr>
6
+            <jhi-alert-error></jhi-alert-error>
7
+            <dl class="row-md jh-entity-details">
8
+                <dt><span jhiTranslate="zipConnectApp.employer.employerId">Employer Id</span></dt>
9
+                <dd>
10
+                    <span>{{employer.employerId}}</span>
11
+                </dd>
12
+                <dt><span jhiTranslate="zipConnectApp.employer.companyName">Company Name</span></dt>
13
+                <dd>
14
+                    <span>{{employer.companyName}}</span>
15
+                </dd>
16
+                <dt><span jhiTranslate="zipConnectApp.employer.city">City</span></dt>
17
+                <dd>
18
+                    <span>{{employer.city}}</span>
19
+                </dd>
20
+                <dt><span jhiTranslate="zipConnectApp.employer.state">State</span></dt>
21
+                <dd>
22
+                    <span>{{employer.state}}</span>
23
+                </dd>
24
+            </dl>
25
+
26
+            <button type="submit"
27
+                    (click)="previousState()"
28
+                    class="btn btn-info">
29
+                <fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
30
+            </button>
31
+
32
+            <button type="button"
33
+                    [routerLink]="['/employer', employer.id, 'edit']"
34
+                    class="btn btn-primary">
35
+                <fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
36
+            </button>
37
+        </div>
38
+    </div>
39
+</div>

+ 24
- 0
src/main/webapp/app/entities/employer/employer-detail.component.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+
4
+import { IEmployer } from 'app/shared/model/employer.model';
5
+
6
+@Component({
7
+    selector: 'jhi-employer-detail',
8
+    templateUrl: './employer-detail.component.html'
9
+})
10
+export class EmployerDetailComponent implements OnInit {
11
+    employer: IEmployer;
12
+
13
+    constructor(private activatedRoute: ActivatedRoute) {}
14
+
15
+    ngOnInit() {
16
+        this.activatedRoute.data.subscribe(({ employer }) => {
17
+            this.employer = employer;
18
+        });
19
+    }
20
+
21
+    previousState() {
22
+        window.history.back();
23
+    }
24
+}

+ 44
- 0
src/main/webapp/app/entities/employer/employer-update.component.html 查看文件

@@ -0,0 +1,44 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
4
+            <h2 id="jhi-employer-heading" jhiTranslate="zipConnectApp.employer.home.createOrEditLabel">Create or edit a Employer</h2>
5
+            <div>
6
+                <jhi-alert-error></jhi-alert-error>
7
+                <div class="form-group" [hidden]="!employer.id">
8
+                    <label for="id" jhiTranslate="global.field.id">ID</label>
9
+                    <input type="text" class="form-control" id="id" name="id"
10
+                        [(ngModel)]="employer.id" readonly />
11
+                </div>
12
+                <div class="form-group">
13
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.employer.employerId" for="field_employerId">Employer Id</label>
14
+                    <input type="number" class="form-control" name="employerId" id="field_employerId"
15
+                        [(ngModel)]="employer.employerId" />
16
+                </div>
17
+                <div class="form-group">
18
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.employer.companyName" for="field_companyName">Company Name</label>
19
+                    <input type="text" class="form-control" name="companyName" id="field_companyName"
20
+                        [(ngModel)]="employer.companyName" />
21
+                </div>
22
+                <div class="form-group">
23
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.employer.city" for="field_city">City</label>
24
+                    <input type="text" class="form-control" name="city" id="field_city"
25
+                        [(ngModel)]="employer.city" />
26
+                </div>
27
+                <div class="form-group">
28
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.employer.state" for="field_state">State</label>
29
+                    <input type="text" class="form-control" name="state" id="field_state"
30
+                        [(ngModel)]="employer.state" />
31
+                </div>
32
+
33
+            </div>
34
+            <div>
35
+                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
36
+                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
37
+                </button>
38
+                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
39
+                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
40
+                </button>
41
+            </div>
42
+        </form>
43
+    </div>
44
+</div>

+ 51
- 0
src/main/webapp/app/entities/employer/employer-update.component.ts 查看文件

@@ -0,0 +1,51 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
4
+import { Observable } from 'rxjs';
5
+
6
+import { IEmployer } from 'app/shared/model/employer.model';
7
+import { EmployerService } from './employer.service';
8
+
9
+@Component({
10
+    selector: 'jhi-employer-update',
11
+    templateUrl: './employer-update.component.html'
12
+})
13
+export class EmployerUpdateComponent implements OnInit {
14
+    employer: IEmployer;
15
+    isSaving: boolean;
16
+
17
+    constructor(private employerService: EmployerService, private activatedRoute: ActivatedRoute) {}
18
+
19
+    ngOnInit() {
20
+        this.isSaving = false;
21
+        this.activatedRoute.data.subscribe(({ employer }) => {
22
+            this.employer = employer;
23
+        });
24
+    }
25
+
26
+    previousState() {
27
+        window.history.back();
28
+    }
29
+
30
+    save() {
31
+        this.isSaving = true;
32
+        if (this.employer.id !== undefined) {
33
+            this.subscribeToSaveResponse(this.employerService.update(this.employer));
34
+        } else {
35
+            this.subscribeToSaveResponse(this.employerService.create(this.employer));
36
+        }
37
+    }
38
+
39
+    private subscribeToSaveResponse(result: Observable<HttpResponse<IEmployer>>) {
40
+        result.subscribe((res: HttpResponse<IEmployer>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
41
+    }
42
+
43
+    private onSaveSuccess() {
44
+        this.isSaving = false;
45
+        this.previousState();
46
+    }
47
+
48
+    private onSaveError() {
49
+        this.isSaving = false;
50
+    }
51
+}

+ 60
- 0
src/main/webapp/app/entities/employer/employer.component.html 查看文件

@@ -0,0 +1,60 @@
1
+<div>
2
+    <h2 id="page-heading">
3
+        <span jhiTranslate="zipConnectApp.employer.home.title">Employers</span>
4
+        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-employer" [routerLink]="['/employer/new']">
5
+            <fa-icon [icon]="'plus'"></fa-icon>
6
+            <span  jhiTranslate="zipConnectApp.employer.home.createLabel">
7
+            Create new Employer
8
+            </span>
9
+        </button>
10
+    </h2>
11
+    <jhi-alert></jhi-alert>
12
+    <br/>
13
+    <div class="table-responsive" *ngIf="employers">
14
+        <table class="table table-striped">
15
+            <thead>
16
+            <tr>
17
+            <th><span jhiTranslate="global.field.id">ID</span></th>
18
+            <th><span jhiTranslate="zipConnectApp.employer.employerId">Employer Id</span></th>
19
+            <th><span jhiTranslate="zipConnectApp.employer.companyName">Company Name</span></th>
20
+            <th><span jhiTranslate="zipConnectApp.employer.city">City</span></th>
21
+            <th><span jhiTranslate="zipConnectApp.employer.state">State</span></th>
22
+            <th></th>
23
+            </tr>
24
+            </thead>
25
+            <tbody>
26
+            <tr *ngFor="let employer of employers ;trackBy: trackId">
27
+                <td><a [routerLink]="['/employer', employer.id, 'view' ]">{{employer.id}}</a></td>
28
+                <td>{{employer.employerId}}</td>
29
+                <td>{{employer.companyName}}</td>
30
+                <td>{{employer.city}}</td>
31
+                <td>{{employer.state}}</td>
32
+                <td class="text-right">
33
+                    <div class="btn-group flex-btn-group-container">
34
+                        <button type="submit"
35
+                                [routerLink]="['/employer', employer.id, 'view' ]"
36
+                                class="btn btn-info btn-sm">
37
+                            <fa-icon [icon]="'eye'"></fa-icon>
38
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
39
+                        </button>
40
+                        <button type="submit"
41
+                                [routerLink]="['/employer', employer.id, 'edit']"
42
+                                class="btn btn-primary btn-sm">
43
+                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
44
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
45
+                        </button>
46
+                        <button type="submit"
47
+                                [routerLink]="['/', { outlets: { popup: 'employer/'+ employer.id + '/delete'} }]"
48
+                                replaceUrl="true"
49
+                                queryParamsHandling="merge"
50
+                                class="btn btn-danger btn-sm">
51
+                            <fa-icon [icon]="'times'"></fa-icon>
52
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
53
+                        </button>
54
+                    </div>
55
+                </td>
56
+            </tr>
57
+            </tbody>
58
+        </table>
59
+    </div>
60
+</div>

+ 58
- 0
src/main/webapp/app/entities/employer/employer.component.ts 查看文件

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
3
+import { Subscription } from 'rxjs';
4
+import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
5
+
6
+import { IEmployer } from 'app/shared/model/employer.model';
7
+import { Principal } from 'app/core';
8
+import { EmployerService } from './employer.service';
9
+
10
+@Component({
11
+    selector: 'jhi-employer',
12
+    templateUrl: './employer.component.html'
13
+})
14
+export class EmployerComponent implements OnInit, OnDestroy {
15
+    employers: IEmployer[];
16
+    currentAccount: any;
17
+    eventSubscriber: Subscription;
18
+
19
+    constructor(
20
+        private employerService: EmployerService,
21
+        private jhiAlertService: JhiAlertService,
22
+        private eventManager: JhiEventManager,
23
+        private principal: Principal
24
+    ) {}
25
+
26
+    loadAll() {
27
+        this.employerService.query().subscribe(
28
+            (res: HttpResponse<IEmployer[]>) => {
29
+                this.employers = res.body;
30
+            },
31
+            (res: HttpErrorResponse) => this.onError(res.message)
32
+        );
33
+    }
34
+
35
+    ngOnInit() {
36
+        this.loadAll();
37
+        this.principal.identity().then(account => {
38
+            this.currentAccount = account;
39
+        });
40
+        this.registerChangeInEmployers();
41
+    }
42
+
43
+    ngOnDestroy() {
44
+        this.eventManager.destroy(this.eventSubscriber);
45
+    }
46
+
47
+    trackId(index: number, item: IEmployer) {
48
+        return item.id;
49
+    }
50
+
51
+    registerChangeInEmployers() {
52
+        this.eventSubscriber = this.eventManager.subscribe('employerListModification', response => this.loadAll());
53
+    }
54
+
55
+    private onError(errorMessage: string) {
56
+        this.jhiAlertService.error(errorMessage, null, null);
57
+    }
58
+}

+ 29
- 0
src/main/webapp/app/entities/employer/employer.module.ts 查看文件

@@ -0,0 +1,29 @@
1
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+import { RouterModule } from '@angular/router';
3
+
4
+import { ZipConnectSharedModule } from 'app/shared';
5
+import {
6
+    EmployerComponent,
7
+    EmployerDetailComponent,
8
+    EmployerUpdateComponent,
9
+    EmployerDeletePopupComponent,
10
+    EmployerDeleteDialogComponent,
11
+    employerRoute,
12
+    employerPopupRoute
13
+} from './';
14
+
15
+const ENTITY_STATES = [...employerRoute, ...employerPopupRoute];
16
+
17
+@NgModule({
18
+    imports: [ZipConnectSharedModule, RouterModule.forChild(ENTITY_STATES)],
19
+    declarations: [
20
+        EmployerComponent,
21
+        EmployerDetailComponent,
22
+        EmployerUpdateComponent,
23
+        EmployerDeleteDialogComponent,
24
+        EmployerDeletePopupComponent
25
+    ],
26
+    entryComponents: [EmployerComponent, EmployerUpdateComponent, EmployerDeleteDialogComponent, EmployerDeletePopupComponent],
27
+    schemas: [CUSTOM_ELEMENTS_SCHEMA]
28
+})
29
+export class ZipConnectEmployerModule {}

+ 93
- 0
src/main/webapp/app/entities/employer/employer.route.ts 查看文件

@@ -0,0 +1,93 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpResponse } from '@angular/common/http';
3
+import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
4
+import { UserRouteAccessService } from 'app/core';
5
+import { Observable, of } from 'rxjs';
6
+import { filter, map } from 'rxjs/operators';
7
+import { Employer } from 'app/shared/model/employer.model';
8
+import { EmployerService } from './employer.service';
9
+import { EmployerComponent } from './employer.component';
10
+import { EmployerDetailComponent } from './employer-detail.component';
11
+import { EmployerUpdateComponent } from './employer-update.component';
12
+import { EmployerDeletePopupComponent } from './employer-delete-dialog.component';
13
+import { IEmployer } from 'app/shared/model/employer.model';
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class EmployerResolve implements Resolve<IEmployer> {
17
+    constructor(private service: EmployerService) {}
18
+
19
+    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Employer> {
20
+        const id = route.params['id'] ? route.params['id'] : null;
21
+        if (id) {
22
+            return this.service.find(id).pipe(
23
+                filter((response: HttpResponse<Employer>) => response.ok),
24
+                map((employer: HttpResponse<Employer>) => employer.body)
25
+            );
26
+        }
27
+        return of(new Employer());
28
+    }
29
+}
30
+
31
+export const employerRoute: Routes = [
32
+    {
33
+        path: 'employer',
34
+        component: EmployerComponent,
35
+        data: {
36
+            authorities: ['ROLE_USER'],
37
+            pageTitle: 'zipConnectApp.employer.home.title'
38
+        },
39
+        canActivate: [UserRouteAccessService]
40
+    },
41
+    {
42
+        path: 'employer/:id/view',
43
+        component: EmployerDetailComponent,
44
+        resolve: {
45
+            employer: EmployerResolve
46
+        },
47
+        data: {
48
+            authorities: ['ROLE_USER'],
49
+            pageTitle: 'zipConnectApp.employer.home.title'
50
+        },
51
+        canActivate: [UserRouteAccessService]
52
+    },
53
+    {
54
+        path: 'employer/new',
55
+        component: EmployerUpdateComponent,
56
+        resolve: {
57
+            employer: EmployerResolve
58
+        },
59
+        data: {
60
+            authorities: ['ROLE_USER'],
61
+            pageTitle: 'zipConnectApp.employer.home.title'
62
+        },
63
+        canActivate: [UserRouteAccessService]
64
+    },
65
+    {
66
+        path: 'employer/:id/edit',
67
+        component: EmployerUpdateComponent,
68
+        resolve: {
69
+            employer: EmployerResolve
70
+        },
71
+        data: {
72
+            authorities: ['ROLE_USER'],
73
+            pageTitle: 'zipConnectApp.employer.home.title'
74
+        },
75
+        canActivate: [UserRouteAccessService]
76
+    }
77
+];
78
+
79
+export const employerPopupRoute: Routes = [
80
+    {
81
+        path: 'employer/:id/delete',
82
+        component: EmployerDeletePopupComponent,
83
+        resolve: {
84
+            employer: EmployerResolve
85
+        },
86
+        data: {
87
+            authorities: ['ROLE_USER'],
88
+            pageTitle: 'zipConnectApp.employer.home.title'
89
+        },
90
+        canActivate: [UserRouteAccessService],
91
+        outlet: 'popup'
92
+    }
93
+];

+ 38
- 0
src/main/webapp/app/entities/employer/employer.service.ts 查看文件

@@ -0,0 +1,38 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpClient, HttpResponse } from '@angular/common/http';
3
+import { Observable } from 'rxjs';
4
+
5
+import { SERVER_API_URL } from 'app/app.constants';
6
+import { createRequestOption } from 'app/shared';
7
+import { IEmployer } from 'app/shared/model/employer.model';
8
+
9
+type EntityResponseType = HttpResponse<IEmployer>;
10
+type EntityArrayResponseType = HttpResponse<IEmployer[]>;
11
+
12
+@Injectable({ providedIn: 'root' })
13
+export class EmployerService {
14
+    public resourceUrl = SERVER_API_URL + 'api/employers';
15
+
16
+    constructor(private http: HttpClient) {}
17
+
18
+    create(employer: IEmployer): Observable<EntityResponseType> {
19
+        return this.http.post<IEmployer>(this.resourceUrl, employer, { observe: 'response' });
20
+    }
21
+
22
+    update(employer: IEmployer): Observable<EntityResponseType> {
23
+        return this.http.put<IEmployer>(this.resourceUrl, employer, { observe: 'response' });
24
+    }
25
+
26
+    find(id: number): Observable<EntityResponseType> {
27
+        return this.http.get<IEmployer>(`${this.resourceUrl}/${id}`, { observe: 'response' });
28
+    }
29
+
30
+    query(req?: any): Observable<EntityArrayResponseType> {
31
+        const options = createRequestOption(req);
32
+        return this.http.get<IEmployer[]>(this.resourceUrl, { params: options, observe: 'response' });
33
+    }
34
+
35
+    delete(id: number): Observable<HttpResponse<any>> {
36
+        return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
37
+    }
38
+}

+ 6
- 0
src/main/webapp/app/entities/employer/index.ts 查看文件

@@ -0,0 +1,6 @@
1
+export * from './employer.service';
2
+export * from './employer-update.component';
3
+export * from './employer-delete-dialog.component';
4
+export * from './employer-detail.component';
5
+export * from './employer.component';
6
+export * from './employer.route';

+ 10
- 0
src/main/webapp/app/entities/entity.module.ts 查看文件

@@ -1,10 +1,20 @@
1 1
 import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 2
 
3
+import { ZipConnectUserProfileModule } from './user-profile/user-profile.module';
4
+import { ZipConnectCohortModule } from './cohort/cohort.module';
5
+import { ZipConnectEmployerModule } from './employer/employer.module';
6
+import { ZipConnectPostModule } from './post/post.module';
7
+import { ZipConnectPrivacyModule } from './privacy/privacy.module';
3 8
 /* jhipster-needle-add-entity-module-import - JHipster will add entity modules imports here */
4 9
 
5 10
 @NgModule({
6 11
     // prettier-ignore
7 12
     imports: [
13
+        ZipConnectUserProfileModule,
14
+        ZipConnectCohortModule,
15
+        ZipConnectEmployerModule,
16
+        ZipConnectPostModule,
17
+        ZipConnectPrivacyModule,
8 18
         /* jhipster-needle-add-entity-module - JHipster will add entity modules here */
9 19
     ],
10 20
     declarations: [],

+ 6
- 0
src/main/webapp/app/entities/post/index.ts 查看文件

@@ -0,0 +1,6 @@
1
+export * from './post.service';
2
+export * from './post-update.component';
3
+export * from './post-delete-dialog.component';
4
+export * from './post-detail.component';
5
+export * from './post.component';
6
+export * from './post.route';

+ 19
- 0
src/main/webapp/app/entities/post/post-delete-dialog.component.html 查看文件

@@ -0,0 +1,19 @@
1
+<form name="deleteForm" (ngSubmit)="confirmDelete(post.id)">
2
+    <div class="modal-header">
3
+        <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
4
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
5
+                (click)="clear()">&times;</button>
6
+    </div>
7
+    <div class="modal-body">
8
+        <jhi-alert-error></jhi-alert-error>
9
+        <p id="jhi-delete-post-heading" jhiTranslate="zipConnectApp.post.delete.question" translateValues="{id: '{{post.id}}'}">Are you sure you want to delete this Post?</p>
10
+    </div>
11
+    <div class="modal-footer">
12
+        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
13
+            <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
14
+        </button>
15
+        <button id="jhi-confirm-delete-post" type="submit" class="btn btn-danger">
16
+            <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
17
+        </button>
18
+    </div>
19
+</form>

+ 65
- 0
src/main/webapp/app/entities/post/post-delete-dialog.component.ts 查看文件

@@ -0,0 +1,65 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { ActivatedRoute, Router } from '@angular/router';
3
+
4
+import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5
+import { JhiEventManager } from 'ng-jhipster';
6
+
7
+import { IPost } from 'app/shared/model/post.model';
8
+import { PostService } from './post.service';
9
+
10
+@Component({
11
+    selector: 'jhi-post-delete-dialog',
12
+    templateUrl: './post-delete-dialog.component.html'
13
+})
14
+export class PostDeleteDialogComponent {
15
+    post: IPost;
16
+
17
+    constructor(private postService: PostService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {}
18
+
19
+    clear() {
20
+        this.activeModal.dismiss('cancel');
21
+    }
22
+
23
+    confirmDelete(id: number) {
24
+        this.postService.delete(id).subscribe(response => {
25
+            this.eventManager.broadcast({
26
+                name: 'postListModification',
27
+                content: 'Deleted an post'
28
+            });
29
+            this.activeModal.dismiss(true);
30
+        });
31
+    }
32
+}
33
+
34
+@Component({
35
+    selector: 'jhi-post-delete-popup',
36
+    template: ''
37
+})
38
+export class PostDeletePopupComponent implements OnInit, OnDestroy {
39
+    private ngbModalRef: NgbModalRef;
40
+
41
+    constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {}
42
+
43
+    ngOnInit() {
44
+        this.activatedRoute.data.subscribe(({ post }) => {
45
+            setTimeout(() => {
46
+                this.ngbModalRef = this.modalService.open(PostDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
47
+                this.ngbModalRef.componentInstance.post = post;
48
+                this.ngbModalRef.result.then(
49
+                    result => {
50
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
51
+                        this.ngbModalRef = null;
52
+                    },
53
+                    reason => {
54
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
55
+                        this.ngbModalRef = null;
56
+                    }
57
+                );
58
+            }, 0);
59
+        });
60
+    }
61
+
62
+    ngOnDestroy() {
63
+        this.ngbModalRef = null;
64
+    }
65
+}

+ 53
- 0
src/main/webapp/app/entities/post/post-detail.component.html 查看文件

@@ -0,0 +1,53 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <div *ngIf="post">
4
+            <h2><span jhiTranslate="zipConnectApp.post.detail.title">Post</span> {{post.id}}</h2>
5
+            <hr>
6
+            <jhi-alert-error></jhi-alert-error>
7
+            <dl class="row-md jh-entity-details">
8
+                <dt><span jhiTranslate="zipConnectApp.post.postId">Post Id</span></dt>
9
+                <dd>
10
+                    <span>{{post.postId}}</span>
11
+                </dd>
12
+                <dt><span jhiTranslate="zipConnectApp.post.timestamp">Timestamp</span></dt>
13
+                <dd>
14
+                    <span>{{post.timestamp}}</span>
15
+                </dd>
16
+                <dt><span jhiTranslate="zipConnectApp.post.content">Content</span></dt>
17
+                <dd>
18
+                    <span>{{post.content}}</span>
19
+                </dd>
20
+                <dt><span jhiTranslate="zipConnectApp.post.likes">Likes</span></dt>
21
+                <dd>
22
+                    <span>{{post.likes}}</span>
23
+                </dd>
24
+                <dt><span jhiTranslate="zipConnectApp.post.poster">Poster</span></dt>
25
+                <dd>
26
+                    {{post.poster?.id}}
27
+                </dd>
28
+                <dt><span jhiTranslate="zipConnectApp.post.privacySetting">Privacy Setting</span></dt>
29
+                <dd>
30
+                    <div *ngIf="post.privacySetting">
31
+                        <a [routerLink]="['/privacy', post.privacySetting?.id, 'view']">{{post.privacySetting?.id}}</a>
32
+                    </div>
33
+                </dd>
34
+                <dt><span jhiTranslate="zipConnectApp.post.poster">Poster</span></dt>
35
+                <dd>
36
+                    {{post.poster?.id}}
37
+                </dd>
38
+            </dl>
39
+
40
+            <button type="submit"
41
+                    (click)="previousState()"
42
+                    class="btn btn-info">
43
+                <fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
44
+            </button>
45
+
46
+            <button type="button"
47
+                    [routerLink]="['/post', post.id, 'edit']"
48
+                    class="btn btn-primary">
49
+                <fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
50
+            </button>
51
+        </div>
52
+    </div>
53
+</div>

+ 24
- 0
src/main/webapp/app/entities/post/post-detail.component.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+
4
+import { IPost } from 'app/shared/model/post.model';
5
+
6
+@Component({
7
+    selector: 'jhi-post-detail',
8
+    templateUrl: './post-detail.component.html'
9
+})
10
+export class PostDetailComponent implements OnInit {
11
+    post: IPost;
12
+
13
+    constructor(private activatedRoute: ActivatedRoute) {}
14
+
15
+    ngOnInit() {
16
+        this.activatedRoute.data.subscribe(({ post }) => {
17
+            this.post = post;
18
+        });
19
+    }
20
+
21
+    previousState() {
22
+        window.history.back();
23
+    }
24
+}

+ 70
- 0
src/main/webapp/app/entities/post/post-update.component.html 查看文件

@@ -0,0 +1,70 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
4
+            <h2 id="jhi-post-heading" jhiTranslate="zipConnectApp.post.home.createOrEditLabel">Create or edit a Post</h2>
5
+            <div>
6
+                <jhi-alert-error></jhi-alert-error>
7
+                <div class="form-group" [hidden]="!post.id">
8
+                    <label for="id" jhiTranslate="global.field.id">ID</label>
9
+                    <input type="text" class="form-control" id="id" name="id"
10
+                        [(ngModel)]="post.id" readonly />
11
+                </div>
12
+                <div class="form-group">
13
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.postId" for="field_postId">Post Id</label>
14
+                    <input type="number" class="form-control" name="postId" id="field_postId"
15
+                        [(ngModel)]="post.postId" />
16
+                </div>
17
+                <div class="form-group">
18
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.timestamp" for="field_timestamp">Timestamp</label>
19
+                    <div class="input-group">
20
+                        <input id="field_timestamp" type="text" class="form-control" name="timestamp" ngbDatepicker  #timestampDp="ngbDatepicker" [(ngModel)]="post.timestamp"
21
+                        />
22
+                        <span class="input-group-append">
23
+                            <button type="button" class="btn btn-secondary" (click)="timestampDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
24
+                        </span>
25
+                    </div>
26
+                </div>
27
+                <div class="form-group">
28
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.content" for="field_content">Content</label>
29
+                    <input type="text" class="form-control" name="content" id="field_content"
30
+                        [(ngModel)]="post.content" />
31
+                </div>
32
+                <div class="form-group">
33
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.likes" for="field_likes">Likes</label>
34
+                    <input type="text" class="form-control" name="likes" id="field_likes"
35
+                        [(ngModel)]="post.likes" />
36
+                </div>
37
+
38
+                <div class="form-group">
39
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.poster" for="field_poster">Poster</label>
40
+                    <select class="form-control" id="field_poster" name="poster" [(ngModel)]="post.poster" >
41
+                        <option [ngValue]="null"></option>
42
+                        <option [ngValue]="userOption.id === post.poster?.id ? post.poster : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.id}}</option>
43
+                    </select>
44
+                </div>
45
+                <div class="form-group">
46
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.privacySetting" for="field_privacySetting">Privacy Setting</label>
47
+                    <select class="form-control" id="field_privacySetting" name="privacySetting" [(ngModel)]="post.privacySetting">
48
+                        <option [ngValue]="null"></option>
49
+                        <option [ngValue]="privacyOption.id === post.privacySetting?.id ? post.privacySetting : privacyOption" *ngFor="let privacyOption of privacysettings; trackBy: trackPrivacyById">{{privacyOption.id}}</option>
50
+                    </select>
51
+                </div>
52
+                <div class="form-group">
53
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.post.poster" for="field_poster">Poster</label>
54
+                    <select class="form-control" id="field_poster" name="poster" [(ngModel)]="post.poster" >
55
+                        <option [ngValue]="null"></option>
56
+                        <option [ngValue]="userOption.id === post.poster?.id ? post.poster : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.id}}</option>
57
+                    </select>
58
+                </div>
59
+            </div>
60
+            <div>
61
+                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
62
+                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
63
+                </button>
64
+                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
65
+                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
66
+                </button>
67
+            </div>
68
+        </form>
69
+    </div>
70
+</div>

+ 100
- 0
src/main/webapp/app/entities/post/post-update.component.ts 查看文件

@@ -0,0 +1,100 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
4
+import { Observable } from 'rxjs';
5
+import * as moment from 'moment';
6
+import { JhiAlertService } from 'ng-jhipster';
7
+
8
+import { IPost } from 'app/shared/model/post.model';
9
+import { PostService } from './post.service';
10
+import { IUser, UserService } from 'app/core';
11
+import { IPrivacy } from 'app/shared/model/privacy.model';
12
+import { PrivacyService } from 'app/entities/privacy';
13
+
14
+@Component({
15
+    selector: 'jhi-post-update',
16
+    templateUrl: './post-update.component.html'
17
+})
18
+export class PostUpdateComponent implements OnInit {
19
+    post: IPost;
20
+    isSaving: boolean;
21
+
22
+    users: IUser[];
23
+
24
+    privacysettings: IPrivacy[];
25
+    timestampDp: any;
26
+
27
+    constructor(
28
+        private jhiAlertService: JhiAlertService,
29
+        private postService: PostService,
30
+        private userService: UserService,
31
+        private privacyService: PrivacyService,
32
+        private activatedRoute: ActivatedRoute
33
+    ) {}
34
+
35
+    ngOnInit() {
36
+        this.isSaving = false;
37
+        this.activatedRoute.data.subscribe(({ post }) => {
38
+            this.post = post;
39
+        });
40
+        this.userService.query().subscribe(
41
+            (res: HttpResponse<IUser[]>) => {
42
+                this.users = res.body;
43
+            },
44
+            (res: HttpErrorResponse) => this.onError(res.message)
45
+        );
46
+        this.privacyService.query({ filter: 'post-is-null' }).subscribe(
47
+            (res: HttpResponse<IPrivacy[]>) => {
48
+                if (!this.post.privacySetting || !this.post.privacySetting.id) {
49
+                    this.privacysettings = res.body;
50
+                } else {
51
+                    this.privacyService.find(this.post.privacySetting.id).subscribe(
52
+                        (subRes: HttpResponse<IPrivacy>) => {
53
+                            this.privacysettings = [subRes.body].concat(res.body);
54
+                        },
55
+                        (subRes: HttpErrorResponse) => this.onError(subRes.message)
56
+                    );
57
+                }
58
+            },
59
+            (res: HttpErrorResponse) => this.onError(res.message)
60
+        );
61
+    }
62
+
63
+    previousState() {
64
+        window.history.back();
65
+    }
66
+
67
+    save() {
68
+        this.isSaving = true;
69
+        if (this.post.id !== undefined) {
70
+            this.subscribeToSaveResponse(this.postService.update(this.post));
71
+        } else {
72
+            this.subscribeToSaveResponse(this.postService.create(this.post));
73
+        }
74
+    }
75
+
76
+    private subscribeToSaveResponse(result: Observable<HttpResponse<IPost>>) {
77
+        result.subscribe((res: HttpResponse<IPost>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
78
+    }
79
+
80
+    private onSaveSuccess() {
81
+        this.isSaving = false;
82
+        this.previousState();
83
+    }
84
+
85
+    private onSaveError() {
86
+        this.isSaving = false;
87
+    }
88
+
89
+    private onError(errorMessage: string) {
90
+        this.jhiAlertService.error(errorMessage, null, null);
91
+    }
92
+
93
+    trackUserById(index: number, item: IUser) {
94
+        return item.id;
95
+    }
96
+
97
+    trackPrivacyById(index: number, item: IPrivacy) {
98
+        return item.id;
99
+    }
100
+}

+ 74
- 0
src/main/webapp/app/entities/post/post.component.html 查看文件

@@ -0,0 +1,74 @@
1
+<div>
2
+    <h2 id="page-heading">
3
+        <span jhiTranslate="zipConnectApp.post.home.title">Posts</span>
4
+        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-post" [routerLink]="['/post/new']">
5
+            <fa-icon [icon]="'plus'"></fa-icon>
6
+            <span  jhiTranslate="zipConnectApp.post.home.createLabel">
7
+            Create new Post
8
+            </span>
9
+        </button>
10
+    </h2>
11
+    <jhi-alert></jhi-alert>
12
+    <br/>
13
+    <div class="table-responsive" *ngIf="posts">
14
+        <table class="table table-striped">
15
+            <thead>
16
+            <tr>
17
+            <th><span jhiTranslate="global.field.id">ID</span></th>
18
+            <th><span jhiTranslate="zipConnectApp.post.postId">Post Id</span></th>
19
+            <th><span jhiTranslate="zipConnectApp.post.timestamp">Timestamp</span></th>
20
+            <th><span jhiTranslate="zipConnectApp.post.content">Content</span></th>
21
+            <th><span jhiTranslate="zipConnectApp.post.likes">Likes</span></th>
22
+            <th><span jhiTranslate="zipConnectApp.post.poster">Poster</span></th>
23
+            <th><span jhiTranslate="zipConnectApp.post.privacySetting">Privacy Setting</span></th>
24
+            <th><span jhiTranslate="zipConnectApp.post.poster">Poster</span></th>
25
+            <th></th>
26
+            </tr>
27
+            </thead>
28
+            <tbody>
29
+            <tr *ngFor="let post of posts ;trackBy: trackId">
30
+                <td><a [routerLink]="['/post', post.id, 'view' ]">{{post.id}}</a></td>
31
+                <td>{{post.postId}}</td>
32
+                <td>{{post.timestamp | date:'mediumDate'}}</td>
33
+                <td>{{post.content}}</td>
34
+                <td>{{post.likes}}</td>
35
+                <td>
36
+                    {{post.poster?.id}}
37
+                </td>
38
+                <td>
39
+                    <div *ngIf="post.privacySetting">
40
+                        <a [routerLink]="['../privacy', post.privacySetting?.id, 'view' ]" >{{post.privacySetting?.id}}</a>
41
+                    </div>
42
+                </td>
43
+                <td>
44
+                    {{post.poster?.id}}
45
+                </td>
46
+                <td class="text-right">
47
+                    <div class="btn-group flex-btn-group-container">
48
+                        <button type="submit"
49
+                                [routerLink]="['/post', post.id, 'view' ]"
50
+                                class="btn btn-info btn-sm">
51
+                            <fa-icon [icon]="'eye'"></fa-icon>
52
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
53
+                        </button>
54
+                        <button type="submit"
55
+                                [routerLink]="['/post', post.id, 'edit']"
56
+                                class="btn btn-primary btn-sm">
57
+                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
58
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
59
+                        </button>
60
+                        <button type="submit"
61
+                                [routerLink]="['/', { outlets: { popup: 'post/'+ post.id + '/delete'} }]"
62
+                                replaceUrl="true"
63
+                                queryParamsHandling="merge"
64
+                                class="btn btn-danger btn-sm">
65
+                            <fa-icon [icon]="'times'"></fa-icon>
66
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
67
+                        </button>
68
+                    </div>
69
+                </td>
70
+            </tr>
71
+            </tbody>
72
+        </table>
73
+    </div>
74
+</div>

+ 58
- 0
src/main/webapp/app/entities/post/post.component.ts 查看文件

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
3
+import { Subscription } from 'rxjs';
4
+import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
5
+
6
+import { IPost } from 'app/shared/model/post.model';
7
+import { Principal } from 'app/core';
8
+import { PostService } from './post.service';
9
+
10
+@Component({
11
+    selector: 'jhi-post',
12
+    templateUrl: './post.component.html'
13
+})
14
+export class PostComponent implements OnInit, OnDestroy {
15
+    posts: IPost[];
16
+    currentAccount: any;
17
+    eventSubscriber: Subscription;
18
+
19
+    constructor(
20
+        private postService: PostService,
21
+        private jhiAlertService: JhiAlertService,
22
+        private eventManager: JhiEventManager,
23
+        private principal: Principal
24
+    ) {}
25
+
26
+    loadAll() {
27
+        this.postService.query().subscribe(
28
+            (res: HttpResponse<IPost[]>) => {
29
+                this.posts = res.body;
30
+            },
31
+            (res: HttpErrorResponse) => this.onError(res.message)
32
+        );
33
+    }
34
+
35
+    ngOnInit() {
36
+        this.loadAll();
37
+        this.principal.identity().then(account => {
38
+            this.currentAccount = account;
39
+        });
40
+        this.registerChangeInPosts();
41
+    }
42
+
43
+    ngOnDestroy() {
44
+        this.eventManager.destroy(this.eventSubscriber);
45
+    }
46
+
47
+    trackId(index: number, item: IPost) {
48
+        return item.id;
49
+    }
50
+
51
+    registerChangeInPosts() {
52
+        this.eventSubscriber = this.eventManager.subscribe('postListModification', response => this.loadAll());
53
+    }
54
+
55
+    private onError(errorMessage: string) {
56
+        this.jhiAlertService.error(errorMessage, null, null);
57
+    }
58
+}

+ 24
- 0
src/main/webapp/app/entities/post/post.module.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+import { RouterModule } from '@angular/router';
3
+
4
+import { ZipConnectSharedModule } from 'app/shared';
5
+import { ZipConnectAdminModule } from 'app/admin/admin.module';
6
+import {
7
+    PostComponent,
8
+    PostDetailComponent,
9
+    PostUpdateComponent,
10
+    PostDeletePopupComponent,
11
+    PostDeleteDialogComponent,
12
+    postRoute,
13
+    postPopupRoute
14
+} from './';
15
+
16
+const ENTITY_STATES = [...postRoute, ...postPopupRoute];
17
+
18
+@NgModule({
19
+    imports: [ZipConnectSharedModule, ZipConnectAdminModule, RouterModule.forChild(ENTITY_STATES)],
20
+    declarations: [PostComponent, PostDetailComponent, PostUpdateComponent, PostDeleteDialogComponent, PostDeletePopupComponent],
21
+    entryComponents: [PostComponent, PostUpdateComponent, PostDeleteDialogComponent, PostDeletePopupComponent],
22
+    schemas: [CUSTOM_ELEMENTS_SCHEMA]
23
+})
24
+export class ZipConnectPostModule {}

+ 93
- 0
src/main/webapp/app/entities/post/post.route.ts 查看文件

@@ -0,0 +1,93 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpResponse } from '@angular/common/http';
3
+import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
4
+import { UserRouteAccessService } from 'app/core';
5
+import { Observable, of } from 'rxjs';
6
+import { filter, map } from 'rxjs/operators';
7
+import { Post } from 'app/shared/model/post.model';
8
+import { PostService } from './post.service';
9
+import { PostComponent } from './post.component';
10
+import { PostDetailComponent } from './post-detail.component';
11
+import { PostUpdateComponent } from './post-update.component';
12
+import { PostDeletePopupComponent } from './post-delete-dialog.component';
13
+import { IPost } from 'app/shared/model/post.model';
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class PostResolve implements Resolve<IPost> {
17
+    constructor(private service: PostService) {}
18
+
19
+    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Post> {
20
+        const id = route.params['id'] ? route.params['id'] : null;
21
+        if (id) {
22
+            return this.service.find(id).pipe(
23
+                filter((response: HttpResponse<Post>) => response.ok),
24
+                map((post: HttpResponse<Post>) => post.body)
25
+            );
26
+        }
27
+        return of(new Post());
28
+    }
29
+}
30
+
31
+export const postRoute: Routes = [
32
+    {
33
+        path: 'post',
34
+        component: PostComponent,
35
+        data: {
36
+            authorities: ['ROLE_USER'],
37
+            pageTitle: 'zipConnectApp.post.home.title'
38
+        },
39
+        canActivate: [UserRouteAccessService]
40
+    },
41
+    {
42
+        path: 'post/:id/view',
43
+        component: PostDetailComponent,
44
+        resolve: {
45
+            post: PostResolve
46
+        },
47
+        data: {
48
+            authorities: ['ROLE_USER'],
49
+            pageTitle: 'zipConnectApp.post.home.title'
50
+        },
51
+        canActivate: [UserRouteAccessService]
52
+    },
53
+    {
54
+        path: 'post/new',
55
+        component: PostUpdateComponent,
56
+        resolve: {
57
+            post: PostResolve
58
+        },
59
+        data: {
60
+            authorities: ['ROLE_USER'],
61
+            pageTitle: 'zipConnectApp.post.home.title'
62
+        },
63
+        canActivate: [UserRouteAccessService]
64
+    },
65
+    {
66
+        path: 'post/:id/edit',
67
+        component: PostUpdateComponent,
68
+        resolve: {
69
+            post: PostResolve
70
+        },
71
+        data: {
72
+            authorities: ['ROLE_USER'],
73
+            pageTitle: 'zipConnectApp.post.home.title'
74
+        },
75
+        canActivate: [UserRouteAccessService]
76
+    }
77
+];
78
+
79
+export const postPopupRoute: Routes = [
80
+    {
81
+        path: 'post/:id/delete',
82
+        component: PostDeletePopupComponent,
83
+        resolve: {
84
+            post: PostResolve
85
+        },
86
+        data: {
87
+            authorities: ['ROLE_USER'],
88
+            pageTitle: 'zipConnectApp.post.home.title'
89
+        },
90
+        canActivate: [UserRouteAccessService],
91
+        outlet: 'popup'
92
+    }
93
+];

+ 74
- 0
src/main/webapp/app/entities/post/post.service.ts 查看文件

@@ -0,0 +1,74 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpClient, HttpResponse } from '@angular/common/http';
3
+import { Observable } from 'rxjs';
4
+import * as moment from 'moment';
5
+import { DATE_FORMAT } from 'app/shared/constants/input.constants';
6
+import { map } from 'rxjs/operators';
7
+
8
+import { SERVER_API_URL } from 'app/app.constants';
9
+import { createRequestOption } from 'app/shared';
10
+import { IPost } from 'app/shared/model/post.model';
11
+
12
+type EntityResponseType = HttpResponse<IPost>;
13
+type EntityArrayResponseType = HttpResponse<IPost[]>;
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class PostService {
17
+    public resourceUrl = SERVER_API_URL + 'api/posts';
18
+
19
+    constructor(private http: HttpClient) {}
20
+
21
+    create(post: IPost): Observable<EntityResponseType> {
22
+        const copy = this.convertDateFromClient(post);
23
+        return this.http
24
+            .post<IPost>(this.resourceUrl, copy, { observe: 'response' })
25
+            .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
26
+    }
27
+
28
+    update(post: IPost): Observable<EntityResponseType> {
29
+        const copy = this.convertDateFromClient(post);
30
+        return this.http
31
+            .put<IPost>(this.resourceUrl, copy, { observe: 'response' })
32
+            .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
33
+    }
34
+
35
+    find(id: number): Observable<EntityResponseType> {
36
+        return this.http
37
+            .get<IPost>(`${this.resourceUrl}/${id}`, { observe: 'response' })
38
+            .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
39
+    }
40
+
41
+    query(req?: any): Observable<EntityArrayResponseType> {
42
+        const options = createRequestOption(req);
43
+        return this.http
44
+            .get<IPost[]>(this.resourceUrl, { params: options, observe: 'response' })
45
+            .pipe(map((res: EntityArrayResponseType) => this.convertDateArrayFromServer(res)));
46
+    }
47
+
48
+    delete(id: number): Observable<HttpResponse<any>> {
49
+        return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
50
+    }
51
+
52
+    protected convertDateFromClient(post: IPost): IPost {
53
+        const copy: IPost = Object.assign({}, post, {
54
+            timestamp: post.timestamp != null && post.timestamp.isValid() ? post.timestamp.format(DATE_FORMAT) : null
55
+        });
56
+        return copy;
57
+    }
58
+
59
+    protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
60
+        if (res.body) {
61
+            res.body.timestamp = res.body.timestamp != null ? moment(res.body.timestamp) : null;
62
+        }
63
+        return res;
64
+    }
65
+
66
+    protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
67
+        if (res.body) {
68
+            res.body.forEach((post: IPost) => {
69
+                post.timestamp = post.timestamp != null ? moment(post.timestamp) : null;
70
+            });
71
+        }
72
+        return res;
73
+    }
74
+}

+ 6
- 0
src/main/webapp/app/entities/privacy/index.ts 查看文件

@@ -0,0 +1,6 @@
1
+export * from './privacy.service';
2
+export * from './privacy-update.component';
3
+export * from './privacy-delete-dialog.component';
4
+export * from './privacy-detail.component';
5
+export * from './privacy.component';
6
+export * from './privacy.route';

+ 19
- 0
src/main/webapp/app/entities/privacy/privacy-delete-dialog.component.html 查看文件

@@ -0,0 +1,19 @@
1
+<form name="deleteForm" (ngSubmit)="confirmDelete(privacy.id)">
2
+    <div class="modal-header">
3
+        <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
4
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
5
+                (click)="clear()">&times;</button>
6
+    </div>
7
+    <div class="modal-body">
8
+        <jhi-alert-error></jhi-alert-error>
9
+        <p id="jhi-delete-privacy-heading" jhiTranslate="zipConnectApp.privacy.delete.question" translateValues="{id: '{{privacy.id}}'}">Are you sure you want to delete this Privacy?</p>
10
+    </div>
11
+    <div class="modal-footer">
12
+        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
13
+            <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
14
+        </button>
15
+        <button id="jhi-confirm-delete-privacy" type="submit" class="btn btn-danger">
16
+            <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
17
+        </button>
18
+    </div>
19
+</form>

+ 65
- 0
src/main/webapp/app/entities/privacy/privacy-delete-dialog.component.ts 查看文件

@@ -0,0 +1,65 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { ActivatedRoute, Router } from '@angular/router';
3
+
4
+import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5
+import { JhiEventManager } from 'ng-jhipster';
6
+
7
+import { IPrivacy } from 'app/shared/model/privacy.model';
8
+import { PrivacyService } from './privacy.service';
9
+
10
+@Component({
11
+    selector: 'jhi-privacy-delete-dialog',
12
+    templateUrl: './privacy-delete-dialog.component.html'
13
+})
14
+export class PrivacyDeleteDialogComponent {
15
+    privacy: IPrivacy;
16
+
17
+    constructor(private privacyService: PrivacyService, public activeModal: NgbActiveModal, private eventManager: JhiEventManager) {}
18
+
19
+    clear() {
20
+        this.activeModal.dismiss('cancel');
21
+    }
22
+
23
+    confirmDelete(id: number) {
24
+        this.privacyService.delete(id).subscribe(response => {
25
+            this.eventManager.broadcast({
26
+                name: 'privacyListModification',
27
+                content: 'Deleted an privacy'
28
+            });
29
+            this.activeModal.dismiss(true);
30
+        });
31
+    }
32
+}
33
+
34
+@Component({
35
+    selector: 'jhi-privacy-delete-popup',
36
+    template: ''
37
+})
38
+export class PrivacyDeletePopupComponent implements OnInit, OnDestroy {
39
+    private ngbModalRef: NgbModalRef;
40
+
41
+    constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {}
42
+
43
+    ngOnInit() {
44
+        this.activatedRoute.data.subscribe(({ privacy }) => {
45
+            setTimeout(() => {
46
+                this.ngbModalRef = this.modalService.open(PrivacyDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
47
+                this.ngbModalRef.componentInstance.privacy = privacy;
48
+                this.ngbModalRef.result.then(
49
+                    result => {
50
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
51
+                        this.ngbModalRef = null;
52
+                    },
53
+                    reason => {
54
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
55
+                        this.ngbModalRef = null;
56
+                    }
57
+                );
58
+            }, 0);
59
+        });
60
+    }
61
+
62
+    ngOnDestroy() {
63
+        this.ngbModalRef = null;
64
+    }
65
+}

+ 39
- 0
src/main/webapp/app/entities/privacy/privacy-detail.component.html 查看文件

@@ -0,0 +1,39 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <div *ngIf="privacy">
4
+            <h2><span jhiTranslate="zipConnectApp.privacy.detail.title">Privacy</span> {{privacy.id}}</h2>
5
+            <hr>
6
+            <jhi-alert-error></jhi-alert-error>
7
+            <dl class="row-md jh-entity-details">
8
+                <dt><span jhiTranslate="zipConnectApp.privacy.privacyId">Privacy Id</span></dt>
9
+                <dd>
10
+                    <span>{{privacy.privacyId}}</span>
11
+                </dd>
12
+                <dt><span jhiTranslate="zipConnectApp.privacy.publicView">Public View</span></dt>
13
+                <dd>
14
+                    <span>{{privacy.publicView}}</span>
15
+                </dd>
16
+                <dt><span jhiTranslate="zipConnectApp.privacy.cohortView">Cohort View</span></dt>
17
+                <dd>
18
+                    <span>{{privacy.cohortView}}</span>
19
+                </dd>
20
+                <dt><span jhiTranslate="zipConnectApp.privacy.employerView">Employer View</span></dt>
21
+                <dd>
22
+                    <span>{{privacy.employerView}}</span>
23
+                </dd>
24
+            </dl>
25
+
26
+            <button type="submit"
27
+                    (click)="previousState()"
28
+                    class="btn btn-info">
29
+                <fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
30
+            </button>
31
+
32
+            <button type="button"
33
+                    [routerLink]="['/privacy', privacy.id, 'edit']"
34
+                    class="btn btn-primary">
35
+                <fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
36
+            </button>
37
+        </div>
38
+    </div>
39
+</div>

+ 24
- 0
src/main/webapp/app/entities/privacy/privacy-detail.component.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+
4
+import { IPrivacy } from 'app/shared/model/privacy.model';
5
+
6
+@Component({
7
+    selector: 'jhi-privacy-detail',
8
+    templateUrl: './privacy-detail.component.html'
9
+})
10
+export class PrivacyDetailComponent implements OnInit {
11
+    privacy: IPrivacy;
12
+
13
+    constructor(private activatedRoute: ActivatedRoute) {}
14
+
15
+    ngOnInit() {
16
+        this.activatedRoute.data.subscribe(({ privacy }) => {
17
+            this.privacy = privacy;
18
+        });
19
+    }
20
+
21
+    previousState() {
22
+        window.history.back();
23
+    }
24
+}

+ 44
- 0
src/main/webapp/app/entities/privacy/privacy-update.component.html 查看文件

@@ -0,0 +1,44 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
4
+            <h2 id="jhi-privacy-heading" jhiTranslate="zipConnectApp.privacy.home.createOrEditLabel">Create or edit a Privacy</h2>
5
+            <div>
6
+                <jhi-alert-error></jhi-alert-error>
7
+                <div class="form-group" [hidden]="!privacy.id">
8
+                    <label for="id" jhiTranslate="global.field.id">ID</label>
9
+                    <input type="text" class="form-control" id="id" name="id"
10
+                        [(ngModel)]="privacy.id" readonly />
11
+                </div>
12
+                <div class="form-group">
13
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.privacy.privacyId" for="field_privacyId">Privacy Id</label>
14
+                    <input type="number" class="form-control" name="privacyId" id="field_privacyId"
15
+                        [(ngModel)]="privacy.privacyId" />
16
+                </div>
17
+                <div class="form-group">
18
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.privacy.publicView" for="field_publicView">Public View</label>
19
+                    <input type="checkbox" class="form-control" name="publicView" id="field_publicView"
20
+                        [(ngModel)]="privacy.publicView" />
21
+                </div>
22
+                <div class="form-group">
23
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.privacy.cohortView" for="field_cohortView">Cohort View</label>
24
+                    <input type="checkbox" class="form-control" name="cohortView" id="field_cohortView"
25
+                        [(ngModel)]="privacy.cohortView" />
26
+                </div>
27
+                <div class="form-group">
28
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.privacy.employerView" for="field_employerView">Employer View</label>
29
+                    <input type="checkbox" class="form-control" name="employerView" id="field_employerView"
30
+                        [(ngModel)]="privacy.employerView" />
31
+                </div>
32
+
33
+            </div>
34
+            <div>
35
+                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
36
+                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
37
+                </button>
38
+                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
39
+                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
40
+                </button>
41
+            </div>
42
+        </form>
43
+    </div>
44
+</div>

+ 51
- 0
src/main/webapp/app/entities/privacy/privacy-update.component.ts 查看文件

@@ -0,0 +1,51 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
4
+import { Observable } from 'rxjs';
5
+
6
+import { IPrivacy } from 'app/shared/model/privacy.model';
7
+import { PrivacyService } from './privacy.service';
8
+
9
+@Component({
10
+    selector: 'jhi-privacy-update',
11
+    templateUrl: './privacy-update.component.html'
12
+})
13
+export class PrivacyUpdateComponent implements OnInit {
14
+    privacy: IPrivacy;
15
+    isSaving: boolean;
16
+
17
+    constructor(private privacyService: PrivacyService, private activatedRoute: ActivatedRoute) {}
18
+
19
+    ngOnInit() {
20
+        this.isSaving = false;
21
+        this.activatedRoute.data.subscribe(({ privacy }) => {
22
+            this.privacy = privacy;
23
+        });
24
+    }
25
+
26
+    previousState() {
27
+        window.history.back();
28
+    }
29
+
30
+    save() {
31
+        this.isSaving = true;
32
+        if (this.privacy.id !== undefined) {
33
+            this.subscribeToSaveResponse(this.privacyService.update(this.privacy));
34
+        } else {
35
+            this.subscribeToSaveResponse(this.privacyService.create(this.privacy));
36
+        }
37
+    }
38
+
39
+    private subscribeToSaveResponse(result: Observable<HttpResponse<IPrivacy>>) {
40
+        result.subscribe((res: HttpResponse<IPrivacy>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
41
+    }
42
+
43
+    private onSaveSuccess() {
44
+        this.isSaving = false;
45
+        this.previousState();
46
+    }
47
+
48
+    private onSaveError() {
49
+        this.isSaving = false;
50
+    }
51
+}

+ 60
- 0
src/main/webapp/app/entities/privacy/privacy.component.html 查看文件

@@ -0,0 +1,60 @@
1
+<div>
2
+    <h2 id="page-heading">
3
+        <span jhiTranslate="zipConnectApp.privacy.home.title">Privacies</span>
4
+        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-privacy" [routerLink]="['/privacy/new']">
5
+            <fa-icon [icon]="'plus'"></fa-icon>
6
+            <span  jhiTranslate="zipConnectApp.privacy.home.createLabel">
7
+            Create new Privacy
8
+            </span>
9
+        </button>
10
+    </h2>
11
+    <jhi-alert></jhi-alert>
12
+    <br/>
13
+    <div class="table-responsive" *ngIf="privacies">
14
+        <table class="table table-striped">
15
+            <thead>
16
+            <tr>
17
+            <th><span jhiTranslate="global.field.id">ID</span></th>
18
+            <th><span jhiTranslate="zipConnectApp.privacy.privacyId">Privacy Id</span></th>
19
+            <th><span jhiTranslate="zipConnectApp.privacy.publicView">Public View</span></th>
20
+            <th><span jhiTranslate="zipConnectApp.privacy.cohortView">Cohort View</span></th>
21
+            <th><span jhiTranslate="zipConnectApp.privacy.employerView">Employer View</span></th>
22
+            <th></th>
23
+            </tr>
24
+            </thead>
25
+            <tbody>
26
+            <tr *ngFor="let privacy of privacies ;trackBy: trackId">
27
+                <td><a [routerLink]="['/privacy', privacy.id, 'view' ]">{{privacy.id}}</a></td>
28
+                <td>{{privacy.privacyId}}</td>
29
+                <td>{{privacy.publicView}}</td>
30
+                <td>{{privacy.cohortView}}</td>
31
+                <td>{{privacy.employerView}}</td>
32
+                <td class="text-right">
33
+                    <div class="btn-group flex-btn-group-container">
34
+                        <button type="submit"
35
+                                [routerLink]="['/privacy', privacy.id, 'view' ]"
36
+                                class="btn btn-info btn-sm">
37
+                            <fa-icon [icon]="'eye'"></fa-icon>
38
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
39
+                        </button>
40
+                        <button type="submit"
41
+                                [routerLink]="['/privacy', privacy.id, 'edit']"
42
+                                class="btn btn-primary btn-sm">
43
+                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
44
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
45
+                        </button>
46
+                        <button type="submit"
47
+                                [routerLink]="['/', { outlets: { popup: 'privacy/'+ privacy.id + '/delete'} }]"
48
+                                replaceUrl="true"
49
+                                queryParamsHandling="merge"
50
+                                class="btn btn-danger btn-sm">
51
+                            <fa-icon [icon]="'times'"></fa-icon>
52
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
53
+                        </button>
54
+                    </div>
55
+                </td>
56
+            </tr>
57
+            </tbody>
58
+        </table>
59
+    </div>
60
+</div>

+ 58
- 0
src/main/webapp/app/entities/privacy/privacy.component.ts 查看文件

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
3
+import { Subscription } from 'rxjs';
4
+import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
5
+
6
+import { IPrivacy } from 'app/shared/model/privacy.model';
7
+import { Principal } from 'app/core';
8
+import { PrivacyService } from './privacy.service';
9
+
10
+@Component({
11
+    selector: 'jhi-privacy',
12
+    templateUrl: './privacy.component.html'
13
+})
14
+export class PrivacyComponent implements OnInit, OnDestroy {
15
+    privacies: IPrivacy[];
16
+    currentAccount: any;
17
+    eventSubscriber: Subscription;
18
+
19
+    constructor(
20
+        private privacyService: PrivacyService,
21
+        private jhiAlertService: JhiAlertService,
22
+        private eventManager: JhiEventManager,
23
+        private principal: Principal
24
+    ) {}
25
+
26
+    loadAll() {
27
+        this.privacyService.query().subscribe(
28
+            (res: HttpResponse<IPrivacy[]>) => {
29
+                this.privacies = res.body;
30
+            },
31
+            (res: HttpErrorResponse) => this.onError(res.message)
32
+        );
33
+    }
34
+
35
+    ngOnInit() {
36
+        this.loadAll();
37
+        this.principal.identity().then(account => {
38
+            this.currentAccount = account;
39
+        });
40
+        this.registerChangeInPrivacies();
41
+    }
42
+
43
+    ngOnDestroy() {
44
+        this.eventManager.destroy(this.eventSubscriber);
45
+    }
46
+
47
+    trackId(index: number, item: IPrivacy) {
48
+        return item.id;
49
+    }
50
+
51
+    registerChangeInPrivacies() {
52
+        this.eventSubscriber = this.eventManager.subscribe('privacyListModification', response => this.loadAll());
53
+    }
54
+
55
+    private onError(errorMessage: string) {
56
+        this.jhiAlertService.error(errorMessage, null, null);
57
+    }
58
+}

+ 29
- 0
src/main/webapp/app/entities/privacy/privacy.module.ts 查看文件

@@ -0,0 +1,29 @@
1
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+import { RouterModule } from '@angular/router';
3
+
4
+import { ZipConnectSharedModule } from 'app/shared';
5
+import {
6
+    PrivacyComponent,
7
+    PrivacyDetailComponent,
8
+    PrivacyUpdateComponent,
9
+    PrivacyDeletePopupComponent,
10
+    PrivacyDeleteDialogComponent,
11
+    privacyRoute,
12
+    privacyPopupRoute
13
+} from './';
14
+
15
+const ENTITY_STATES = [...privacyRoute, ...privacyPopupRoute];
16
+
17
+@NgModule({
18
+    imports: [ZipConnectSharedModule, RouterModule.forChild(ENTITY_STATES)],
19
+    declarations: [
20
+        PrivacyComponent,
21
+        PrivacyDetailComponent,
22
+        PrivacyUpdateComponent,
23
+        PrivacyDeleteDialogComponent,
24
+        PrivacyDeletePopupComponent
25
+    ],
26
+    entryComponents: [PrivacyComponent, PrivacyUpdateComponent, PrivacyDeleteDialogComponent, PrivacyDeletePopupComponent],
27
+    schemas: [CUSTOM_ELEMENTS_SCHEMA]
28
+})
29
+export class ZipConnectPrivacyModule {}

+ 93
- 0
src/main/webapp/app/entities/privacy/privacy.route.ts 查看文件

@@ -0,0 +1,93 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpResponse } from '@angular/common/http';
3
+import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
4
+import { UserRouteAccessService } from 'app/core';
5
+import { Observable, of } from 'rxjs';
6
+import { filter, map } from 'rxjs/operators';
7
+import { Privacy } from 'app/shared/model/privacy.model';
8
+import { PrivacyService } from './privacy.service';
9
+import { PrivacyComponent } from './privacy.component';
10
+import { PrivacyDetailComponent } from './privacy-detail.component';
11
+import { PrivacyUpdateComponent } from './privacy-update.component';
12
+import { PrivacyDeletePopupComponent } from './privacy-delete-dialog.component';
13
+import { IPrivacy } from 'app/shared/model/privacy.model';
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class PrivacyResolve implements Resolve<IPrivacy> {
17
+    constructor(private service: PrivacyService) {}
18
+
19
+    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Privacy> {
20
+        const id = route.params['id'] ? route.params['id'] : null;
21
+        if (id) {
22
+            return this.service.find(id).pipe(
23
+                filter((response: HttpResponse<Privacy>) => response.ok),
24
+                map((privacy: HttpResponse<Privacy>) => privacy.body)
25
+            );
26
+        }
27
+        return of(new Privacy());
28
+    }
29
+}
30
+
31
+export const privacyRoute: Routes = [
32
+    {
33
+        path: 'privacy',
34
+        component: PrivacyComponent,
35
+        data: {
36
+            authorities: ['ROLE_USER'],
37
+            pageTitle: 'zipConnectApp.privacy.home.title'
38
+        },
39
+        canActivate: [UserRouteAccessService]
40
+    },
41
+    {
42
+        path: 'privacy/:id/view',
43
+        component: PrivacyDetailComponent,
44
+        resolve: {
45
+            privacy: PrivacyResolve
46
+        },
47
+        data: {
48
+            authorities: ['ROLE_USER'],
49
+            pageTitle: 'zipConnectApp.privacy.home.title'
50
+        },
51
+        canActivate: [UserRouteAccessService]
52
+    },
53
+    {
54
+        path: 'privacy/new',
55
+        component: PrivacyUpdateComponent,
56
+        resolve: {
57
+            privacy: PrivacyResolve
58
+        },
59
+        data: {
60
+            authorities: ['ROLE_USER'],
61
+            pageTitle: 'zipConnectApp.privacy.home.title'
62
+        },
63
+        canActivate: [UserRouteAccessService]
64
+    },
65
+    {
66
+        path: 'privacy/:id/edit',
67
+        component: PrivacyUpdateComponent,
68
+        resolve: {
69
+            privacy: PrivacyResolve
70
+        },
71
+        data: {
72
+            authorities: ['ROLE_USER'],
73
+            pageTitle: 'zipConnectApp.privacy.home.title'
74
+        },
75
+        canActivate: [UserRouteAccessService]
76
+    }
77
+];
78
+
79
+export const privacyPopupRoute: Routes = [
80
+    {
81
+        path: 'privacy/:id/delete',
82
+        component: PrivacyDeletePopupComponent,
83
+        resolve: {
84
+            privacy: PrivacyResolve
85
+        },
86
+        data: {
87
+            authorities: ['ROLE_USER'],
88
+            pageTitle: 'zipConnectApp.privacy.home.title'
89
+        },
90
+        canActivate: [UserRouteAccessService],
91
+        outlet: 'popup'
92
+    }
93
+];

+ 38
- 0
src/main/webapp/app/entities/privacy/privacy.service.ts 查看文件

@@ -0,0 +1,38 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpClient, HttpResponse } from '@angular/common/http';
3
+import { Observable } from 'rxjs';
4
+
5
+import { SERVER_API_URL } from 'app/app.constants';
6
+import { createRequestOption } from 'app/shared';
7
+import { IPrivacy } from 'app/shared/model/privacy.model';
8
+
9
+type EntityResponseType = HttpResponse<IPrivacy>;
10
+type EntityArrayResponseType = HttpResponse<IPrivacy[]>;
11
+
12
+@Injectable({ providedIn: 'root' })
13
+export class PrivacyService {
14
+    public resourceUrl = SERVER_API_URL + 'api/privacies';
15
+
16
+    constructor(private http: HttpClient) {}
17
+
18
+    create(privacy: IPrivacy): Observable<EntityResponseType> {
19
+        return this.http.post<IPrivacy>(this.resourceUrl, privacy, { observe: 'response' });
20
+    }
21
+
22
+    update(privacy: IPrivacy): Observable<EntityResponseType> {
23
+        return this.http.put<IPrivacy>(this.resourceUrl, privacy, { observe: 'response' });
24
+    }
25
+
26
+    find(id: number): Observable<EntityResponseType> {
27
+        return this.http.get<IPrivacy>(`${this.resourceUrl}/${id}`, { observe: 'response' });
28
+    }
29
+
30
+    query(req?: any): Observable<EntityArrayResponseType> {
31
+        const options = createRequestOption(req);
32
+        return this.http.get<IPrivacy[]>(this.resourceUrl, { params: options, observe: 'response' });
33
+    }
34
+
35
+    delete(id: number): Observable<HttpResponse<any>> {
36
+        return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
37
+    }
38
+}

+ 6
- 0
src/main/webapp/app/entities/user-profile/index.ts 查看文件

@@ -0,0 +1,6 @@
1
+export * from './user-profile.service';
2
+export * from './user-profile-update.component';
3
+export * from './user-profile-delete-dialog.component';
4
+export * from './user-profile-detail.component';
5
+export * from './user-profile.component';
6
+export * from './user-profile.route';

+ 19
- 0
src/main/webapp/app/entities/user-profile/user-profile-delete-dialog.component.html 查看文件

@@ -0,0 +1,19 @@
1
+<form name="deleteForm" (ngSubmit)="confirmDelete(userProfile.id)">
2
+    <div class="modal-header">
3
+        <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
4
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
5
+                (click)="clear()">&times;</button>
6
+    </div>
7
+    <div class="modal-body">
8
+        <jhi-alert-error></jhi-alert-error>
9
+        <p id="jhi-delete-userProfile-heading" jhiTranslate="zipConnectApp.userProfile.delete.question" translateValues="{id: '{{userProfile.id}}'}">Are you sure you want to delete this User Profile?</p>
10
+    </div>
11
+    <div class="modal-footer">
12
+        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
13
+            <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
14
+        </button>
15
+        <button id="jhi-confirm-delete-userProfile" type="submit" class="btn btn-danger">
16
+            <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
17
+        </button>
18
+    </div>
19
+</form>

+ 72
- 0
src/main/webapp/app/entities/user-profile/user-profile-delete-dialog.component.ts 查看文件

@@ -0,0 +1,72 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { ActivatedRoute, Router } from '@angular/router';
3
+
4
+import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
5
+import { JhiEventManager } from 'ng-jhipster';
6
+
7
+import { IUserProfile } from 'app/shared/model/user-profile.model';
8
+import { UserProfileService } from './user-profile.service';
9
+
10
+@Component({
11
+    selector: 'jhi-user-profile-delete-dialog',
12
+    templateUrl: './user-profile-delete-dialog.component.html'
13
+})
14
+export class UserProfileDeleteDialogComponent {
15
+    userProfile: IUserProfile;
16
+
17
+    constructor(
18
+        private userProfileService: UserProfileService,
19
+        public activeModal: NgbActiveModal,
20
+        private eventManager: JhiEventManager
21
+    ) {}
22
+
23
+    clear() {
24
+        this.activeModal.dismiss('cancel');
25
+    }
26
+
27
+    confirmDelete(id: number) {
28
+        this.userProfileService.delete(id).subscribe(response => {
29
+            this.eventManager.broadcast({
30
+                name: 'userProfileListModification',
31
+                content: 'Deleted an userProfile'
32
+            });
33
+            this.activeModal.dismiss(true);
34
+        });
35
+    }
36
+}
37
+
38
+@Component({
39
+    selector: 'jhi-user-profile-delete-popup',
40
+    template: ''
41
+})
42
+export class UserProfileDeletePopupComponent implements OnInit, OnDestroy {
43
+    private ngbModalRef: NgbModalRef;
44
+
45
+    constructor(private activatedRoute: ActivatedRoute, private router: Router, private modalService: NgbModal) {}
46
+
47
+    ngOnInit() {
48
+        this.activatedRoute.data.subscribe(({ userProfile }) => {
49
+            setTimeout(() => {
50
+                this.ngbModalRef = this.modalService.open(UserProfileDeleteDialogComponent as Component, {
51
+                    size: 'lg',
52
+                    backdrop: 'static'
53
+                });
54
+                this.ngbModalRef.componentInstance.userProfile = userProfile;
55
+                this.ngbModalRef.result.then(
56
+                    result => {
57
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
58
+                        this.ngbModalRef = null;
59
+                    },
60
+                    reason => {
61
+                        this.router.navigate([{ outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' });
62
+                        this.ngbModalRef = null;
63
+                    }
64
+                );
65
+            }, 0);
66
+        });
67
+    }
68
+
69
+    ngOnDestroy() {
70
+        this.ngbModalRef = null;
71
+    }
72
+}

+ 67
- 0
src/main/webapp/app/entities/user-profile/user-profile-detail.component.html 查看文件

@@ -0,0 +1,67 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <div *ngIf="userProfile">
4
+            <h2><span jhiTranslate="zipConnectApp.userProfile.detail.title">User Profile</span> {{userProfile.id}}</h2>
5
+            <hr>
6
+            <jhi-alert-error></jhi-alert-error>
7
+            <dl class="row-md jh-entity-details">
8
+                <dt><span jhiTranslate="zipConnectApp.userProfile.profileId">Profile Id</span></dt>
9
+                <dd>
10
+                    <span>{{userProfile.profileId}}</span>
11
+                </dd>
12
+                <dt><span jhiTranslate="zipConnectApp.userProfile.firstName">First Name</span></dt>
13
+                <dd>
14
+                    <span>{{userProfile.firstName}}</span>
15
+                </dd>
16
+                <dt><span jhiTranslate="zipConnectApp.userProfile.lastName">Last Name</span></dt>
17
+                <dd>
18
+                    <span>{{userProfile.lastName}}</span>
19
+                </dd>
20
+                <dt><span jhiTranslate="zipConnectApp.userProfile.userStack">User Stack</span></dt>
21
+                <dd>
22
+                    <span>{{userProfile.userStack}}</span>
23
+                </dd>
24
+                <dt><span jhiTranslate="zipConnectApp.userProfile.user">User</span></dt>
25
+                <dd>
26
+                    {{userProfile.user?.id}}
27
+                </dd>
28
+                <dt><span jhiTranslate="zipConnectApp.userProfile.cohort">Cohort</span></dt>
29
+                <dd>
30
+                    <div *ngIf="userProfile.cohort">
31
+                        <a [routerLink]="['/cohort', userProfile.cohort?.id, 'view']">{{userProfile.cohort?.id}}</a>
32
+                    </div>
33
+                </dd>
34
+                <dt><span jhiTranslate="zipConnectApp.userProfile.employer">Employer</span></dt>
35
+                <dd>
36
+                    <div *ngIf="userProfile.employer">
37
+                        <a [routerLink]="['/employer', userProfile.employer?.id, 'view']">{{userProfile.employer?.id}}</a>
38
+                    </div>
39
+                </dd>
40
+                <dt><span jhiTranslate="zipConnectApp.userProfile.employer">Employer</span></dt>
41
+                <dd>
42
+                    <div *ngIf="userProfile.employer">
43
+                        <a [routerLink]="['/employer', userProfile.employer?.id, 'view']">{{userProfile.employer?.id}}</a>
44
+                    </div>
45
+                </dd>
46
+                <dt><span jhiTranslate="zipConnectApp.userProfile.cohort">Cohort</span></dt>
47
+                <dd>
48
+                    <div *ngIf="userProfile.cohort">
49
+                        <a [routerLink]="['/cohort', userProfile.cohort?.id, 'view']">{{userProfile.cohort?.id}}</a>
50
+                    </div>
51
+                </dd>
52
+            </dl>
53
+
54
+            <button type="submit"
55
+                    (click)="previousState()"
56
+                    class="btn btn-info">
57
+                <fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
58
+            </button>
59
+
60
+            <button type="button"
61
+                    [routerLink]="['/user-profile', userProfile.id, 'edit']"
62
+                    class="btn btn-primary">
63
+                <fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
64
+            </button>
65
+        </div>
66
+    </div>
67
+</div>

+ 24
- 0
src/main/webapp/app/entities/user-profile/user-profile-detail.component.ts 查看文件

@@ -0,0 +1,24 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+
4
+import { IUserProfile } from 'app/shared/model/user-profile.model';
5
+
6
+@Component({
7
+    selector: 'jhi-user-profile-detail',
8
+    templateUrl: './user-profile-detail.component.html'
9
+})
10
+export class UserProfileDetailComponent implements OnInit {
11
+    userProfile: IUserProfile;
12
+
13
+    constructor(private activatedRoute: ActivatedRoute) {}
14
+
15
+    ngOnInit() {
16
+        this.activatedRoute.data.subscribe(({ userProfile }) => {
17
+            this.userProfile = userProfile;
18
+        });
19
+    }
20
+
21
+    previousState() {
22
+        window.history.back();
23
+    }
24
+}

+ 79
- 0
src/main/webapp/app/entities/user-profile/user-profile-update.component.html 查看文件

@@ -0,0 +1,79 @@
1
+<div class="row justify-content-center">
2
+    <div class="col-8">
3
+        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
4
+            <h2 id="jhi-user-profile-heading" jhiTranslate="zipConnectApp.userProfile.home.createOrEditLabel">Create or edit a User Profile</h2>
5
+            <div>
6
+                <jhi-alert-error></jhi-alert-error>
7
+                <div class="form-group" [hidden]="!userProfile.id">
8
+                    <label for="id" jhiTranslate="global.field.id">ID</label>
9
+                    <input type="text" class="form-control" id="id" name="id"
10
+                        [(ngModel)]="userProfile.id" readonly />
11
+                </div>
12
+                <div class="form-group">
13
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.profileId" for="field_profileId">Profile Id</label>
14
+                    <input type="number" class="form-control" name="profileId" id="field_profileId"
15
+                        [(ngModel)]="userProfile.profileId" />
16
+                </div>
17
+                <div class="form-group">
18
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.firstName" for="field_firstName">First Name</label>
19
+                    <input type="text" class="form-control" name="firstName" id="field_firstName"
20
+                        [(ngModel)]="userProfile.firstName" />
21
+                </div>
22
+                <div class="form-group">
23
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.lastName" for="field_lastName">Last Name</label>
24
+                    <input type="text" class="form-control" name="lastName" id="field_lastName"
25
+                        [(ngModel)]="userProfile.lastName" />
26
+                </div>
27
+                <div class="form-group">
28
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.userStack" for="field_userStack">User Stack</label>
29
+                    <input type="text" class="form-control" name="userStack" id="field_userStack"
30
+                        [(ngModel)]="userProfile.userStack" />
31
+                </div>
32
+
33
+                <div class="form-group">
34
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.user" for="field_user">User</label>
35
+                    <select class="form-control" id="field_user" name="user" [(ngModel)]="userProfile.user" >
36
+                        <option [ngValue]="null"></option>
37
+                        <option [ngValue]="userOption.id === userProfile.user?.id ? userProfile.user : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.id}}</option>
38
+                    </select>
39
+                </div>
40
+                <div class="form-group">
41
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.cohort" for="field_cohort">Cohort</label>
42
+                    <select class="form-control" id="field_cohort" name="cohort" [(ngModel)]="userProfile.cohort">
43
+                        <option [ngValue]="null"></option>
44
+                        <option [ngValue]="cohortOption.id === userProfile.cohort?.id ? userProfile.cohort : cohortOption" *ngFor="let cohortOption of cohorts; trackBy: trackCohortById">{{cohortOption.id}}</option>
45
+                    </select>
46
+                </div>
47
+                <div class="form-group">
48
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.employer" for="field_employer">Employer</label>
49
+                    <select class="form-control" id="field_employer" name="employer" [(ngModel)]="userProfile.employer">
50
+                        <option [ngValue]="null"></option>
51
+                        <option [ngValue]="employerOption.id === userProfile.employer?.id ? userProfile.employer : employerOption" *ngFor="let employerOption of employers; trackBy: trackEmployerById">{{employerOption.id}}</option>
52
+                    </select>
53
+                </div>
54
+                <div class="form-group">
55
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.employer" for="field_employer">Employer</label>
56
+                    <select class="form-control" id="field_employer" name="employer" [(ngModel)]="userProfile.employer" >
57
+                        <option [ngValue]="null"></option>
58
+                        <option [ngValue]="employerOption.id === userProfile.employer?.id ? userProfile.employer : employerOption" *ngFor="let employerOption of employers; trackBy: trackEmployerById">{{employerOption.id}}</option>
59
+                    </select>
60
+                </div>
61
+                <div class="form-group">
62
+                    <label class="form-control-label" jhiTranslate="zipConnectApp.userProfile.cohort" for="field_cohort">Cohort</label>
63
+                    <select class="form-control" id="field_cohort" name="cohort" [(ngModel)]="userProfile.cohort" >
64
+                        <option [ngValue]="null"></option>
65
+                        <option [ngValue]="cohortOption.id === userProfile.cohort?.id ? userProfile.cohort : cohortOption" *ngFor="let cohortOption of cohorts; trackBy: trackCohortById">{{cohortOption.id}}</option>
66
+                    </select>
67
+                </div>
68
+            </div>
69
+            <div>
70
+                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
71
+                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
72
+                </button>
73
+                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
74
+                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
75
+                </button>
76
+            </div>
77
+        </form>
78
+    </div>
79
+</div>

+ 138
- 0
src/main/webapp/app/entities/user-profile/user-profile-update.component.ts 查看文件

@@ -0,0 +1,138 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
4
+import { Observable } from 'rxjs';
5
+import { JhiAlertService } from 'ng-jhipster';
6
+
7
+import { IUserProfile } from 'app/shared/model/user-profile.model';
8
+import { UserProfileService } from './user-profile.service';
9
+import { IUser, UserService } from 'app/core';
10
+import { ICohort } from 'app/shared/model/cohort.model';
11
+import { CohortService } from 'app/entities/cohort';
12
+import { IEmployer } from 'app/shared/model/employer.model';
13
+import { EmployerService } from 'app/entities/employer';
14
+
15
+@Component({
16
+    selector: 'jhi-user-profile-update',
17
+    templateUrl: './user-profile-update.component.html'
18
+})
19
+export class UserProfileUpdateComponent implements OnInit {
20
+    userProfile: IUserProfile;
21
+    isSaving: boolean;
22
+
23
+    users: IUser[];
24
+
25
+    cohorts: ICohort[];
26
+
27
+    employers: IEmployer[];
28
+
29
+    employers: IEmployer[];
30
+
31
+    cohorts: ICohort[];
32
+
33
+    constructor(
34
+        private jhiAlertService: JhiAlertService,
35
+        private userProfileService: UserProfileService,
36
+        private userService: UserService,
37
+        private cohortService: CohortService,
38
+        private employerService: EmployerService,
39
+        private activatedRoute: ActivatedRoute
40
+    ) {}
41
+
42
+    ngOnInit() {
43
+        this.isSaving = false;
44
+        this.activatedRoute.data.subscribe(({ userProfile }) => {
45
+            this.userProfile = userProfile;
46
+        });
47
+        this.userService.query().subscribe(
48
+            (res: HttpResponse<IUser[]>) => {
49
+                this.users = res.body;
50
+            },
51
+            (res: HttpErrorResponse) => this.onError(res.message)
52
+        );
53
+        this.cohortService.query({ filter: 'userprofile-is-null' }).subscribe(
54
+            (res: HttpResponse<ICohort[]>) => {
55
+                if (!this.userProfile.cohort || !this.userProfile.cohort.id) {
56
+                    this.cohorts = res.body;
57
+                } else {
58
+                    this.cohortService.find(this.userProfile.cohort.id).subscribe(
59
+                        (subRes: HttpResponse<ICohort>) => {
60
+                            this.cohorts = [subRes.body].concat(res.body);
61
+                        },
62
+                        (subRes: HttpErrorResponse) => this.onError(subRes.message)
63
+                    );
64
+                }
65
+            },
66
+            (res: HttpErrorResponse) => this.onError(res.message)
67
+        );
68
+        this.employerService.query({ filter: 'userprofile-is-null' }).subscribe(
69
+            (res: HttpResponse<IEmployer[]>) => {
70
+                if (!this.userProfile.employer || !this.userProfile.employer.id) {
71
+                    this.employers = res.body;
72
+                } else {
73
+                    this.employerService.find(this.userProfile.employer.id).subscribe(
74
+                        (subRes: HttpResponse<IEmployer>) => {
75
+                            this.employers = [subRes.body].concat(res.body);
76
+                        },
77
+                        (subRes: HttpErrorResponse) => this.onError(subRes.message)
78
+                    );
79
+                }
80
+            },
81
+            (res: HttpErrorResponse) => this.onError(res.message)
82
+        );
83
+        this.employerService.query().subscribe(
84
+            (res: HttpResponse<IEmployer[]>) => {
85
+                this.employers = res.body;
86
+            },
87
+            (res: HttpErrorResponse) => this.onError(res.message)
88
+        );
89
+        this.cohortService.query().subscribe(
90
+            (res: HttpResponse<ICohort[]>) => {
91
+                this.cohorts = res.body;
92
+            },
93
+            (res: HttpErrorResponse) => this.onError(res.message)
94
+        );
95
+    }
96
+
97
+    previousState() {
98
+        window.history.back();
99
+    }
100
+
101
+    save() {
102
+        this.isSaving = true;
103
+        if (this.userProfile.id !== undefined) {
104
+            this.subscribeToSaveResponse(this.userProfileService.update(this.userProfile));
105
+        } else {
106
+            this.subscribeToSaveResponse(this.userProfileService.create(this.userProfile));
107
+        }
108
+    }
109
+
110
+    private subscribeToSaveResponse(result: Observable<HttpResponse<IUserProfile>>) {
111
+        result.subscribe((res: HttpResponse<IUserProfile>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
112
+    }
113
+
114
+    private onSaveSuccess() {
115
+        this.isSaving = false;
116
+        this.previousState();
117
+    }
118
+
119
+    private onSaveError() {
120
+        this.isSaving = false;
121
+    }
122
+
123
+    private onError(errorMessage: string) {
124
+        this.jhiAlertService.error(errorMessage, null, null);
125
+    }
126
+
127
+    trackUserById(index: number, item: IUser) {
128
+        return item.id;
129
+    }
130
+
131
+    trackCohortById(index: number, item: ICohort) {
132
+        return item.id;
133
+    }
134
+
135
+    trackEmployerById(index: number, item: IEmployer) {
136
+        return item.id;
137
+    }
138
+}

+ 88
- 0
src/main/webapp/app/entities/user-profile/user-profile.component.html 查看文件

@@ -0,0 +1,88 @@
1
+<div>
2
+    <h2 id="page-heading">
3
+        <span jhiTranslate="zipConnectApp.userProfile.home.title">User Profiles</span>
4
+        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-user-profile" [routerLink]="['/user-profile/new']">
5
+            <fa-icon [icon]="'plus'"></fa-icon>
6
+            <span  jhiTranslate="zipConnectApp.userProfile.home.createLabel">
7
+            Create new User Profile
8
+            </span>
9
+        </button>
10
+    </h2>
11
+    <jhi-alert></jhi-alert>
12
+    <br/>
13
+    <div class="table-responsive" *ngIf="userProfiles">
14
+        <table class="table table-striped">
15
+            <thead>
16
+            <tr>
17
+            <th><span jhiTranslate="global.field.id">ID</span></th>
18
+            <th><span jhiTranslate="zipConnectApp.userProfile.profileId">Profile Id</span></th>
19
+            <th><span jhiTranslate="zipConnectApp.userProfile.firstName">First Name</span></th>
20
+            <th><span jhiTranslate="zipConnectApp.userProfile.lastName">Last Name</span></th>
21
+            <th><span jhiTranslate="zipConnectApp.userProfile.userStack">User Stack</span></th>
22
+            <th><span jhiTranslate="zipConnectApp.userProfile.user">User</span></th>
23
+            <th><span jhiTranslate="zipConnectApp.userProfile.cohort">Cohort</span></th>
24
+            <th><span jhiTranslate="zipConnectApp.userProfile.employer">Employer</span></th>
25
+            <th><span jhiTranslate="zipConnectApp.userProfile.employer">Employer</span></th>
26
+            <th><span jhiTranslate="zipConnectApp.userProfile.cohort">Cohort</span></th>
27
+            <th></th>
28
+            </tr>
29
+            </thead>
30
+            <tbody>
31
+            <tr *ngFor="let userProfile of userProfiles ;trackBy: trackId">
32
+                <td><a [routerLink]="['/user-profile', userProfile.id, 'view' ]">{{userProfile.id}}</a></td>
33
+                <td>{{userProfile.profileId}}</td>
34
+                <td>{{userProfile.firstName}}</td>
35
+                <td>{{userProfile.lastName}}</td>
36
+                <td>{{userProfile.userStack}}</td>
37
+                <td>
38
+                    {{userProfile.user?.id}}
39
+                </td>
40
+                <td>
41
+                    <div *ngIf="userProfile.cohort">
42
+                        <a [routerLink]="['../cohort', userProfile.cohort?.id, 'view' ]" >{{userProfile.cohort?.id}}</a>
43
+                    </div>
44
+                </td>
45
+                <td>
46
+                    <div *ngIf="userProfile.employer">
47
+                        <a [routerLink]="['../employer', userProfile.employer?.id, 'view' ]" >{{userProfile.employer?.id}}</a>
48
+                    </div>
49
+                </td>
50
+                <td>
51
+                    <div *ngIf="userProfile.employer">
52
+                        <a [routerLink]="['../employer', userProfile.employer?.id, 'view' ]" >{{userProfile.employer?.id}}</a>
53
+                    </div>
54
+                </td>
55
+                <td>
56
+                    <div *ngIf="userProfile.cohort">
57
+                        <a [routerLink]="['../cohort', userProfile.cohort?.id, 'view' ]" >{{userProfile.cohort?.id}}</a>
58
+                    </div>
59
+                </td>
60
+                <td class="text-right">
61
+                    <div class="btn-group flex-btn-group-container">
62
+                        <button type="submit"
63
+                                [routerLink]="['/user-profile', userProfile.id, 'view' ]"
64
+                                class="btn btn-info btn-sm">
65
+                            <fa-icon [icon]="'eye'"></fa-icon>
66
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
67
+                        </button>
68
+                        <button type="submit"
69
+                                [routerLink]="['/user-profile', userProfile.id, 'edit']"
70
+                                class="btn btn-primary btn-sm">
71
+                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
72
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
73
+                        </button>
74
+                        <button type="submit"
75
+                                [routerLink]="['/', { outlets: { popup: 'user-profile/'+ userProfile.id + '/delete'} }]"
76
+                                replaceUrl="true"
77
+                                queryParamsHandling="merge"
78
+                                class="btn btn-danger btn-sm">
79
+                            <fa-icon [icon]="'times'"></fa-icon>
80
+                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
81
+                        </button>
82
+                    </div>
83
+                </td>
84
+            </tr>
85
+            </tbody>
86
+        </table>
87
+    </div>
88
+</div>

+ 58
- 0
src/main/webapp/app/entities/user-profile/user-profile.component.ts 查看文件

@@ -0,0 +1,58 @@
1
+import { Component, OnInit, OnDestroy } from '@angular/core';
2
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
3
+import { Subscription } from 'rxjs';
4
+import { JhiEventManager, JhiAlertService } from 'ng-jhipster';
5
+
6
+import { IUserProfile } from 'app/shared/model/user-profile.model';
7
+import { Principal } from 'app/core';
8
+import { UserProfileService } from './user-profile.service';
9
+
10
+@Component({
11
+    selector: 'jhi-user-profile',
12
+    templateUrl: './user-profile.component.html'
13
+})
14
+export class UserProfileComponent implements OnInit, OnDestroy {
15
+    userProfiles: IUserProfile[];
16
+    currentAccount: any;
17
+    eventSubscriber: Subscription;
18
+
19
+    constructor(
20
+        private userProfileService: UserProfileService,
21
+        private jhiAlertService: JhiAlertService,
22
+        private eventManager: JhiEventManager,
23
+        private principal: Principal
24
+    ) {}
25
+
26
+    loadAll() {
27
+        this.userProfileService.query().subscribe(
28
+            (res: HttpResponse<IUserProfile[]>) => {
29
+                this.userProfiles = res.body;
30
+            },
31
+            (res: HttpErrorResponse) => this.onError(res.message)
32
+        );
33
+    }
34
+
35
+    ngOnInit() {
36
+        this.loadAll();
37
+        this.principal.identity().then(account => {
38
+            this.currentAccount = account;
39
+        });
40
+        this.registerChangeInUserProfiles();
41
+    }
42
+
43
+    ngOnDestroy() {
44
+        this.eventManager.destroy(this.eventSubscriber);
45
+    }
46
+
47
+    trackId(index: number, item: IUserProfile) {
48
+        return item.id;
49
+    }
50
+
51
+    registerChangeInUserProfiles() {
52
+        this.eventSubscriber = this.eventManager.subscribe('userProfileListModification', response => this.loadAll());
53
+    }
54
+
55
+    private onError(errorMessage: string) {
56
+        this.jhiAlertService.error(errorMessage, null, null);
57
+    }
58
+}

+ 30
- 0
src/main/webapp/app/entities/user-profile/user-profile.module.ts 查看文件

@@ -0,0 +1,30 @@
1
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+import { RouterModule } from '@angular/router';
3
+
4
+import { ZipConnectSharedModule } from 'app/shared';
5
+import { ZipConnectAdminModule } from 'app/admin/admin.module';
6
+import {
7
+    UserProfileComponent,
8
+    UserProfileDetailComponent,
9
+    UserProfileUpdateComponent,
10
+    UserProfileDeletePopupComponent,
11
+    UserProfileDeleteDialogComponent,
12
+    userProfileRoute,
13
+    userProfilePopupRoute
14
+} from './';
15
+
16
+const ENTITY_STATES = [...userProfileRoute, ...userProfilePopupRoute];
17
+
18
+@NgModule({
19
+    imports: [ZipConnectSharedModule, ZipConnectAdminModule, RouterModule.forChild(ENTITY_STATES)],
20
+    declarations: [
21
+        UserProfileComponent,
22
+        UserProfileDetailComponent,
23
+        UserProfileUpdateComponent,
24
+        UserProfileDeleteDialogComponent,
25
+        UserProfileDeletePopupComponent
26
+    ],
27
+    entryComponents: [UserProfileComponent, UserProfileUpdateComponent, UserProfileDeleteDialogComponent, UserProfileDeletePopupComponent],
28
+    schemas: [CUSTOM_ELEMENTS_SCHEMA]
29
+})
30
+export class ZipConnectUserProfileModule {}

+ 93
- 0
src/main/webapp/app/entities/user-profile/user-profile.route.ts 查看文件

@@ -0,0 +1,93 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpResponse } from '@angular/common/http';
3
+import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
4
+import { UserRouteAccessService } from 'app/core';
5
+import { Observable, of } from 'rxjs';
6
+import { filter, map } from 'rxjs/operators';
7
+import { UserProfile } from 'app/shared/model/user-profile.model';
8
+import { UserProfileService } from './user-profile.service';
9
+import { UserProfileComponent } from './user-profile.component';
10
+import { UserProfileDetailComponent } from './user-profile-detail.component';
11
+import { UserProfileUpdateComponent } from './user-profile-update.component';
12
+import { UserProfileDeletePopupComponent } from './user-profile-delete-dialog.component';
13
+import { IUserProfile } from 'app/shared/model/user-profile.model';
14
+
15
+@Injectable({ providedIn: 'root' })
16
+export class UserProfileResolve implements Resolve<IUserProfile> {
17
+    constructor(private service: UserProfileService) {}
18
+
19
+    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<UserProfile> {
20
+        const id = route.params['id'] ? route.params['id'] : null;
21
+        if (id) {
22
+            return this.service.find(id).pipe(
23
+                filter((response: HttpResponse<UserProfile>) => response.ok),
24
+                map((userProfile: HttpResponse<UserProfile>) => userProfile.body)
25
+            );
26
+        }
27
+        return of(new UserProfile());
28
+    }
29
+}
30
+
31
+export const userProfileRoute: Routes = [
32
+    {
33
+        path: 'user-profile',
34
+        component: UserProfileComponent,
35
+        data: {
36
+            authorities: ['ROLE_USER'],
37
+            pageTitle: 'zipConnectApp.userProfile.home.title'
38
+        },
39
+        canActivate: [UserRouteAccessService]
40
+    },
41
+    {
42
+        path: 'user-profile/:id/view',
43
+        component: UserProfileDetailComponent,
44
+        resolve: {
45
+            userProfile: UserProfileResolve
46
+        },
47
+        data: {
48
+            authorities: ['ROLE_USER'],
49
+            pageTitle: 'zipConnectApp.userProfile.home.title'
50
+        },
51
+        canActivate: [UserRouteAccessService]
52
+    },
53
+    {
54
+        path: 'user-profile/new',
55
+        component: UserProfileUpdateComponent,
56
+        resolve: {
57
+            userProfile: UserProfileResolve
58
+        },
59
+        data: {
60
+            authorities: ['ROLE_USER'],
61
+            pageTitle: 'zipConnectApp.userProfile.home.title'
62
+        },
63
+        canActivate: [UserRouteAccessService]
64
+    },
65
+    {
66
+        path: 'user-profile/:id/edit',
67
+        component: UserProfileUpdateComponent,
68
+        resolve: {
69
+            userProfile: UserProfileResolve
70
+        },
71
+        data: {
72
+            authorities: ['ROLE_USER'],
73
+            pageTitle: 'zipConnectApp.userProfile.home.title'
74
+        },
75
+        canActivate: [UserRouteAccessService]
76
+    }
77
+];
78
+
79
+export const userProfilePopupRoute: Routes = [
80
+    {
81
+        path: 'user-profile/:id/delete',
82
+        component: UserProfileDeletePopupComponent,
83
+        resolve: {
84
+            userProfile: UserProfileResolve
85
+        },
86
+        data: {
87
+            authorities: ['ROLE_USER'],
88
+            pageTitle: 'zipConnectApp.userProfile.home.title'
89
+        },
90
+        canActivate: [UserRouteAccessService],
91
+        outlet: 'popup'
92
+    }
93
+];

+ 38
- 0
src/main/webapp/app/entities/user-profile/user-profile.service.ts 查看文件

@@ -0,0 +1,38 @@
1
+import { Injectable } from '@angular/core';
2
+import { HttpClient, HttpResponse } from '@angular/common/http';
3
+import { Observable } from 'rxjs';
4
+
5
+import { SERVER_API_URL } from 'app/app.constants';
6
+import { createRequestOption } from 'app/shared';
7
+import { IUserProfile } from 'app/shared/model/user-profile.model';
8
+
9
+type EntityResponseType = HttpResponse<IUserProfile>;
10
+type EntityArrayResponseType = HttpResponse<IUserProfile[]>;
11
+
12
+@Injectable({ providedIn: 'root' })
13
+export class UserProfileService {
14
+    public resourceUrl = SERVER_API_URL + 'api/user-profiles';
15
+
16
+    constructor(private http: HttpClient) {}
17
+
18
+    create(userProfile: IUserProfile): Observable<EntityResponseType> {
19
+        return this.http.post<IUserProfile>(this.resourceUrl, userProfile, { observe: 'response' });
20
+    }
21
+
22
+    update(userProfile: IUserProfile): Observable<EntityResponseType> {
23
+        return this.http.put<IUserProfile>(this.resourceUrl, userProfile, { observe: 'response' });
24
+    }
25
+
26
+    find(id: number): Observable<EntityResponseType> {
27
+        return this.http.get<IUserProfile>(`${this.resourceUrl}/${id}`, { observe: 'response' });
28
+    }
29
+
30
+    query(req?: any): Observable<EntityArrayResponseType> {
31
+        const options = createRequestOption(req);
32
+        return this.http.get<IUserProfile[]>(this.resourceUrl, { params: options, observe: 'response' });
33
+    }
34
+
35
+    delete(id: number): Observable<HttpResponse<any>> {
36
+        return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
37
+    }
38
+}

+ 30
- 0
src/main/webapp/app/layouts/navbar/navbar.component.html 查看文件

@@ -29,6 +29,36 @@
29 29
                     </span>
30 30
                 </a>
31 31
                 <ul class="dropdown-menu" ngbDropdownMenu>
32
+                    <li>
33
+                        <a class="dropdown-item" routerLink="user-profile" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
34
+                            <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
35
+                            <span jhiTranslate="global.menu.entities.userProfile">User Profile</span>
36
+                        </a>
37
+                    </li>
38
+                    <li>
39
+                        <a class="dropdown-item" routerLink="cohort" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
40
+                            <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
41
+                            <span jhiTranslate="global.menu.entities.cohort">Cohort</span>
42
+                        </a>
43
+                    </li>
44
+                    <li>
45
+                        <a class="dropdown-item" routerLink="employer" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
46
+                            <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
47
+                            <span jhiTranslate="global.menu.entities.employer">Employer</span>
48
+                        </a>
49
+                    </li>
50
+                    <li>
51
+                        <a class="dropdown-item" routerLink="post" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
52
+                            <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
53
+                            <span jhiTranslate="global.menu.entities.post">Post</span>
54
+                        </a>
55
+                    </li>
56
+                    <li>
57
+                        <a class="dropdown-item" routerLink="privacy" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
58
+                            <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
59
+                            <span jhiTranslate="global.menu.entities.privacy">Privacy</span>
60
+                        </a>
61
+                    </li>
32 62
                     <!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
33 63
                 </ul>
34 64
             </li>

+ 9
- 0
src/main/webapp/app/shared/model/cohort.model.ts 查看文件

@@ -0,0 +1,9 @@
1
+export interface ICohort {
2
+    id?: number;
3
+    cohortId?: number;
4
+    gradDate?: string;
5
+}
6
+
7
+export class Cohort implements ICohort {
8
+    constructor(public id?: number, public cohortId?: number, public gradDate?: string) {}
9
+}

+ 11
- 0
src/main/webapp/app/shared/model/employer.model.ts 查看文件

@@ -0,0 +1,11 @@
1
+export interface IEmployer {
2
+    id?: number;
3
+    employerId?: number;
4
+    companyName?: string;
5
+    city?: string;
6
+    state?: string;
7
+}
8
+
9
+export class Employer implements IEmployer {
10
+    constructor(public id?: number, public employerId?: number, public companyName?: string, public city?: string, public state?: string) {}
11
+}

+ 27
- 0
src/main/webapp/app/shared/model/post.model.ts 查看文件

@@ -0,0 +1,27 @@
1
+import { Moment } from 'moment';
2
+import { IUser } from 'app/core/user/user.model';
3
+import { IPrivacy } from 'app/shared/model//privacy.model';
4
+
5
+export interface IPost {
6
+    id?: number;
7
+    postId?: number;
8
+    timestamp?: Moment;
9
+    content?: string;
10
+    likes?: string;
11
+    poster?: IUser;
12
+    privacySetting?: IPrivacy;
13
+    poster?: IUser;
14
+}
15
+
16
+export class Post implements IPost {
17
+    constructor(
18
+        public id?: number,
19
+        public postId?: number,
20
+        public timestamp?: Moment,
21
+        public content?: string,
22
+        public likes?: string,
23
+        public poster?: IUser,
24
+        public privacySetting?: IPrivacy,
25
+        public poster?: IUser
26
+    ) {}
27
+}

+ 21
- 0
src/main/webapp/app/shared/model/privacy.model.ts 查看文件

@@ -0,0 +1,21 @@
1
+export interface IPrivacy {
2
+    id?: number;
3
+    privacyId?: number;
4
+    publicView?: boolean;
5
+    cohortView?: boolean;
6
+    employerView?: boolean;
7
+}
8
+
9
+export class Privacy implements IPrivacy {
10
+    constructor(
11
+        public id?: number,
12
+        public privacyId?: number,
13
+        public publicView?: boolean,
14
+        public cohortView?: boolean,
15
+        public employerView?: boolean
16
+    ) {
17
+        this.publicView = this.publicView || false;
18
+        this.cohortView = this.cohortView || false;
19
+        this.employerView = this.employerView || false;
20
+    }
21
+}

+ 31
- 0
src/main/webapp/app/shared/model/user-profile.model.ts 查看文件

@@ -0,0 +1,31 @@
1
+import { IUser } from 'app/core/user/user.model';
2
+import { ICohort } from 'app/shared/model//cohort.model';
3
+import { IEmployer } from 'app/shared/model//employer.model';
4
+
5
+export interface IUserProfile {
6
+    id?: number;
7
+    profileId?: number;
8
+    firstName?: string;
9
+    lastName?: string;
10
+    userStack?: string;
11
+    user?: IUser;
12
+    cohort?: ICohort;
13
+    employer?: IEmployer;
14
+    employer?: IEmployer;
15
+    cohort?: ICohort;
16
+}
17
+
18
+export class UserProfile implements IUserProfile {
19
+    constructor(
20
+        public id?: number,
21
+        public profileId?: number,
22
+        public firstName?: string,
23
+        public lastName?: string,
24
+        public userStack?: string,
25
+        public user?: IUser,
26
+        public cohort?: ICohort,
27
+        public employer?: IEmployer,
28
+        public employer?: IEmployer,
29
+        public cohort?: ICohort
30
+    ) {}
31
+}

+ 22
- 0
src/main/webapp/i18n/en/cohort.json 查看文件

@@ -0,0 +1,22 @@
1
+{
2
+    "zipConnectApp": {
3
+        "cohort": {
4
+            "home": {
5
+                "title": "Cohorts",
6
+                "createLabel": "Create a new Cohort",
7
+                "createOrEditLabel": "Create or edit a Cohort"
8
+            },
9
+            "created": "A new Cohort is created with identifier {{ param }}",
10
+            "updated": "A Cohort is updated with identifier {{ param }}",
11
+            "deleted": "A Cohort is deleted with identifier {{ param }}",
12
+            "delete": {
13
+                "question": "Are you sure you want to delete Cohort {{ id }}?"
14
+            },
15
+            "detail": {
16
+                "title": "Cohort"
17
+            },
18
+            "cohortId": "Cohort Id",
19
+            "gradDate": "Grad Date"
20
+        }
21
+    }
22
+}

+ 24
- 0
src/main/webapp/i18n/en/employer.json 查看文件

@@ -0,0 +1,24 @@
1
+{
2
+    "zipConnectApp": {
3
+        "employer": {
4
+            "home": {
5
+                "title": "Employers",
6
+                "createLabel": "Create a new Employer",
7
+                "createOrEditLabel": "Create or edit a Employer"
8
+            },
9
+            "created": "A new Employer is created with identifier {{ param }}",
10
+            "updated": "A Employer is updated with identifier {{ param }}",
11
+            "deleted": "A Employer is deleted with identifier {{ param }}",
12
+            "delete": {
13
+                "question": "Are you sure you want to delete Employer {{ id }}?"
14
+            },
15
+            "detail": {
16
+                "title": "Employer"
17
+            },
18
+            "employerId": "Employer Id",
19
+            "companyName": "Company Name",
20
+            "city": "City",
21
+            "state": "State"
22
+        }
23
+    }
24
+}

+ 5
- 0
src/main/webapp/i18n/en/global.json 查看文件

@@ -7,6 +7,11 @@
7 7
             "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)",
8 8
             "entities": {
9 9
                 "main": "Entities",
10
+                "userProfile": "User Profile",
11
+                "cohort": "Cohort",
12
+                "employer": "Employer",
13
+                "post": "Post",
14
+                "privacy": "Privacy",
10 15
                 "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)"
11 16
             },
12 17
             "account": {

+ 0
- 0
src/main/webapp/i18n/en/post.json 查看文件


部分文件因文件數量過多而無法顯示