forked from krasnopv/das
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proficiency.go
61 lines (53 loc) · 2.05 KB
/
proficiency.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package reference
import (
"github.com/ProximaB/das/businesslogic"
"github.com/ProximaB/das/config/database"
"github.com/ProximaB/das/controller/reference"
"github.com/ProximaB/das/controller/util"
"net/http"
)
const apiReferenceProficiencyEndpoint = "/api/v1.0/reference/proficiency"
var proficiencyServer = reference.ProficiencyServer{
database.ProficiencyRepository,
}
var searchProficiencyController = util.DasController{
Name: "SearchProficiencyController",
Description: "Search proficiencies in DAS",
Method: http.MethodGet,
Endpoint: apiReferenceProficiencyEndpoint,
Handler: proficiencyServer.SearchProficiencyHandler,
AllowedRoles: []int{businesslogic.AccountTypeNoAuth},
}
var createProficiencyController = util.DasController{
Name: "CreateProficiencyController",
Description: "Create a proficiency in DAS",
Method: http.MethodPost,
Endpoint: apiReferenceProficiencyEndpoint,
Handler: proficiencyServer.CreateProficiencyHandler,
AllowedRoles: []int{businesslogic.AccountTypeAdministrator},
}
var deleteProficiencyController = util.DasController{
Name: "DeleteProficiencyController",
Description: "Delete a proficiency from DAS",
Method: http.MethodDelete,
Endpoint: apiReferenceProficiencyEndpoint,
Handler: proficiencyServer.DeleteProficiencyHandler,
AllowedRoles: []int{businesslogic.AccountTypeAdministrator},
}
var updateProficiencyController = util.DasController{
Name: "UpdateProficiencyController",
Description: "Update a proficiency in DAS",
Method: http.MethodPut,
Endpoint: apiReferenceProficiencyEndpoint,
Handler: proficiencyServer.UpdateProficiencyHandler,
AllowedRoles: []int{businesslogic.AccountTypeAdministrator},
}
// ProficiencyControllerGroup is a collection of handler functions for managing proficiencies in DAS
var ProficiencyControllerGroup = util.DasControllerGroup{
Controllers: []util.DasController{
searchProficiencyController,
createProficiencyController,
deleteProficiencyController,
updateProficiencyController,
},
}