Skip to content

Commit

Permalink
Merge pull request #1789 from actiontech/feishu-0
Browse files Browse the repository at this point in the history
chore:feishu config ce implement
  • Loading branch information
ColdWaterLW authored Sep 7, 2023
2 parents f8d8833 + b18d795 commit 4a117c2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sqle/api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config config.SqleConfi
v1Router.GET("/configurations/feishu", v1.GetFeishuConfigurationV1, AdminUserAllowed())
v1Router.PATCH("/configurations/feishu", v1.UpdateFeishuConfigurationV1, AdminUserAllowed())
v1Router.POST("/configurations/feishu/test", v1.TestFeishuConfigV1, AdminUserAllowed())
v1Router.PATCH("/configurations/feishu_audit", v1.UpdateFeishuAuditConfigurationV1, AdminUserAllowed())
v1Router.GET("/configurations/feishu_audit", v1.GetFeishuAuditConfigurationV1, AdminUserAllowed())
v1Router.POST("/configurations/feishu_audit/test", v1.TestFeishuAuditConfigV1, AdminUserAllowed())
v1Router.GET("/configurations/system_variables", v1.GetSystemVariables, AdminUserAllowed())
v1Router.PATCH("/configurations/system_variables", v1.UpdateSystemVariables, AdminUserAllowed())
v1Router.GET("/configurations/license", v1.GetLicense, AdminUserAllowed())
Expand Down
6 changes: 3 additions & 3 deletions sqle/api/controller/v1/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ type GetFeishuAuditConfigurationResV1 struct {
// @Success 200 {object} v1.GetFeishuAuditConfigurationResV1
// @router /v1/configurations/feishu_audit [get]
func GetFeishuAuditConfigurationV1(c echo.Context) error {
return nil
return getFeishuAuditConfigurationV1(c)
}

// UpdateFeishuAuditConfigurationV1
Expand All @@ -1388,7 +1388,7 @@ func GetFeishuAuditConfigurationV1(c echo.Context) error {
// @Success 200 {object} controller.BaseRes
// @router /v1/configurations/feishu_audit [patch]
func UpdateFeishuAuditConfigurationV1(c echo.Context) error {
return nil
return updateFeishuAuditConfigurationV1(c)
}

// TestFeishuAuditConfigV1
Expand All @@ -1402,5 +1402,5 @@ func UpdateFeishuAuditConfigurationV1(c echo.Context) error {
// @Success 200 {object} v1.TestFeishuConfigResV1
// @router /v1/configurations/feishu_audit/test [post]
func TestFeishuAuditConfigV1(c echo.Context) error {
return nil
return testFeishuAuditConfigV1(c)
}
13 changes: 13 additions & 0 deletions sqle/api/controller/v1/configuration_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
var (
errCommunityEditionNotSupportCostumeLogo = errors.New(errors.EnterpriseEditionFeatures, e.New("costume logo is enterprise version feature"))
errCommunityEditionNotSupportUpdatePersonaliseConfig = errors.New(errors.EnterpriseEditionFeatures, e.New("update personalise config is enterprise version feature"))
errCommunityEditionNotSupportFeishuAudit = errors.New(errors.EnterpriseEditionFeatures, e.New("feishu audit is enterprise version feature"))
)

const (
Expand Down Expand Up @@ -50,3 +51,15 @@ func getSQLEInfo(c echo.Context) error {
},
})
}

func updateFeishuAuditConfigurationV1(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionNotSupportFeishuAudit)
}

func getFeishuAuditConfigurationV1(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionNotSupportFeishuAudit)
}

func testFeishuAuditConfigV1(c echo.Context) error {
return controller.JSONBaseErrorReq(c, errCommunityEditionNotSupportFeishuAudit)
}

0 comments on commit 4a117c2

Please sign in to comment.