Skip to content

Commit 37d0ffc

Browse files
committed
updating accounts
1 parent f74b17a commit 37d0ffc

File tree

3 files changed

+182
-111
lines changed

3 files changed

+182
-111
lines changed

docs.go

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const docTemplate = `{
142142
"200": {
143143
"description": "OK",
144144
"schema": {
145-
"$ref": "#/definitions/model.Account"
145+
"$ref": "#/definitions/model.GroupAccount"
146146
}
147147
}
148148
}
@@ -175,7 +175,7 @@ const docTemplate = `{
175175
"schema": {
176176
"type": "array",
177177
"items": {
178-
"$ref": "#/definitions/model.Account"
178+
"$ref": "#/definitions/model.GroupAccount"
179179
}
180180
}
181181
}
@@ -216,6 +216,34 @@ const docTemplate = `{
216216
}
217217
}
218218
},
219+
"/v1/group-account/{user-id}": {
220+
"post": {
221+
"consumes": [
222+
"application/json"
223+
],
224+
"produces": [
225+
"application/json"
226+
],
227+
"tags": [
228+
"Account"
229+
],
230+
"summary": "Creates a group account under the user",
231+
"parameters": [
232+
{
233+
"type": "string",
234+
"description": "Authentication header",
235+
"name": "Auth",
236+
"in": "header",
237+
"required": true
238+
}
239+
],
240+
"responses": {
241+
"200": {
242+
"description": "OK"
243+
}
244+
}
245+
}
246+
},
219247
"/v1/role/{id}": {
220248
"get": {
221249
"consumes": [
@@ -504,38 +532,9 @@ const docTemplate = `{
504532
}
505533
}
506534
}
507-
},
508-
"post": {
509-
"consumes": [
510-
"application/json"
511-
],
512-
"produces": [
513-
"application/json"
514-
],
515-
"tags": [
516-
"User Account Role"
517-
],
518-
"summary": "Creates a user account role",
519-
"parameters": [
520-
{
521-
"type": "string",
522-
"description": "Authentication header",
523-
"name": "Auth",
524-
"in": "header",
525-
"required": true
526-
}
527-
],
528-
"responses": {
529-
"200": {
530-
"description": "OK",
531-
"schema": {
532-
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
533-
}
534-
}
535-
}
536535
}
537536
},
538-
"/v1/user-account-roles/{user-id}/{account-id}": {
537+
"/v1/user-account-roles/{user-id}/{group-id}": {
539538
"get": {
540539
"consumes": [
541540
"application/json"
@@ -546,7 +545,7 @@ const docTemplate = `{
546545
"tags": [
547546
"User Account Role"
548547
],
549-
"summary": "Gets the user account role by user ID and account ID",
548+
"summary": "Gets the user account role by user ID and group ID",
550549
"parameters": [
551550
{
552551
"type": "string",
@@ -784,6 +783,37 @@ const docTemplate = `{
784783
}
785784
}
786785
},
786+
"/v1/user-account/{user-id}/group/{group-id}/role": {
787+
"post": {
788+
"consumes": [
789+
"application/json"
790+
],
791+
"produces": [
792+
"application/json"
793+
],
794+
"tags": [
795+
"User Account Role by user id and group id"
796+
],
797+
"summary": "Creates a user account role",
798+
"parameters": [
799+
{
800+
"type": "string",
801+
"description": "Authentication header",
802+
"name": "Auth",
803+
"in": "header",
804+
"required": true
805+
}
806+
],
807+
"responses": {
808+
"200": {
809+
"description": "OK",
810+
"schema": {
811+
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
812+
}
813+
}
814+
}
815+
}
816+
},
787817
"/v1/user-dashboard": {
788818
"get": {
789819
"consumes": [
@@ -817,7 +847,10 @@ const docTemplate = `{
817847
}
818848
},
819849
"definitions": {
820-
"model.Account": {
850+
"model.Dashboard": {
851+
"type": "object"
852+
},
853+
"model.GroupAccount": {
821854
"type": "object",
822855
"properties": {
823856
"created": {
@@ -843,9 +876,6 @@ const docTemplate = `{
843876
}
844877
}
845878
},
846-
"model.Dashboard": {
847-
"type": "object"
848-
},
849879
"model.UpdateUserAccountRoleDTO": {
850880
"type": "object",
851881
"required": [
@@ -909,9 +939,6 @@ const docTemplate = `{
909939
},
910940
"status_name": {
911941
"type": "string"
912-
},
913-
"temp": {
914-
"type": "boolean"
915942
}
916943
}
917944
},
@@ -978,7 +1005,7 @@ const docTemplate = `{
9781005
"model.UserAccountRole": {
9791006
"type": "object",
9801007
"properties": {
981-
"fk_account_id": {
1008+
"fk_group_account_id": {
9821009
"type": "integer"
9831010
},
9841011
"fk_user_account_id": {

swagger.json

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"200": {
136136
"description": "OK",
137137
"schema": {
138-
"$ref": "#/definitions/model.Account"
138+
"$ref": "#/definitions/model.GroupAccount"
139139
}
140140
}
141141
}
@@ -168,7 +168,7 @@
168168
"schema": {
169169
"type": "array",
170170
"items": {
171-
"$ref": "#/definitions/model.Account"
171+
"$ref": "#/definitions/model.GroupAccount"
172172
}
173173
}
174174
}
@@ -209,6 +209,34 @@
209209
}
210210
}
211211
},
212+
"/v1/group-account/{user-id}": {
213+
"post": {
214+
"consumes": [
215+
"application/json"
216+
],
217+
"produces": [
218+
"application/json"
219+
],
220+
"tags": [
221+
"Account"
222+
],
223+
"summary": "Creates a group account under the user",
224+
"parameters": [
225+
{
226+
"type": "string",
227+
"description": "Authentication header",
228+
"name": "Auth",
229+
"in": "header",
230+
"required": true
231+
}
232+
],
233+
"responses": {
234+
"200": {
235+
"description": "OK"
236+
}
237+
}
238+
}
239+
},
212240
"/v1/role/{id}": {
213241
"get": {
214242
"consumes": [
@@ -497,38 +525,9 @@
497525
}
498526
}
499527
}
500-
},
501-
"post": {
502-
"consumes": [
503-
"application/json"
504-
],
505-
"produces": [
506-
"application/json"
507-
],
508-
"tags": [
509-
"User Account Role"
510-
],
511-
"summary": "Creates a user account role",
512-
"parameters": [
513-
{
514-
"type": "string",
515-
"description": "Authentication header",
516-
"name": "Auth",
517-
"in": "header",
518-
"required": true
519-
}
520-
],
521-
"responses": {
522-
"200": {
523-
"description": "OK",
524-
"schema": {
525-
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
526-
}
527-
}
528-
}
529528
}
530529
},
531-
"/v1/user-account-roles/{user-id}/{account-id}": {
530+
"/v1/user-account-roles/{user-id}/{group-id}": {
532531
"get": {
533532
"consumes": [
534533
"application/json"
@@ -539,7 +538,7 @@
539538
"tags": [
540539
"User Account Role"
541540
],
542-
"summary": "Gets the user account role by user ID and account ID",
541+
"summary": "Gets the user account role by user ID and group ID",
543542
"parameters": [
544543
{
545544
"type": "string",
@@ -777,6 +776,37 @@
777776
}
778777
}
779778
},
779+
"/v1/user-account/{user-id}/group/{group-id}/role": {
780+
"post": {
781+
"consumes": [
782+
"application/json"
783+
],
784+
"produces": [
785+
"application/json"
786+
],
787+
"tags": [
788+
"User Account Role by user id and group id"
789+
],
790+
"summary": "Creates a user account role",
791+
"parameters": [
792+
{
793+
"type": "string",
794+
"description": "Authentication header",
795+
"name": "Auth",
796+
"in": "header",
797+
"required": true
798+
}
799+
],
800+
"responses": {
801+
"200": {
802+
"description": "OK",
803+
"schema": {
804+
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
805+
}
806+
}
807+
}
808+
}
809+
},
780810
"/v1/user-dashboard": {
781811
"get": {
782812
"consumes": [
@@ -810,7 +840,10 @@
810840
}
811841
},
812842
"definitions": {
813-
"model.Account": {
843+
"model.Dashboard": {
844+
"type": "object"
845+
},
846+
"model.GroupAccount": {
814847
"type": "object",
815848
"properties": {
816849
"created": {
@@ -836,9 +869,6 @@
836869
}
837870
}
838871
},
839-
"model.Dashboard": {
840-
"type": "object"
841-
},
842872
"model.UpdateUserAccountRoleDTO": {
843873
"type": "object",
844874
"required": [
@@ -902,9 +932,6 @@
902932
},
903933
"status_name": {
904934
"type": "string"
905-
},
906-
"temp": {
907-
"type": "boolean"
908935
}
909936
}
910937
},
@@ -971,7 +998,7 @@
971998
"model.UserAccountRole": {
972999
"type": "object",
9731000
"properties": {
974-
"fk_account_id": {
1001+
"fk_group_account_id": {
9751002
"type": "integer"
9761003
},
9771004
"fk_user_account_id": {

0 commit comments

Comments
 (0)