Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue sort #1993

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sqle/api/controller/v1/sql_manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type GetSqlManageListReq struct {
FilterStatus *string `query:"filter_status" json:"filter_status,omitempty"`
FilterDbType *string `query:"filter_db_type" json:"filter_db_type,omitempty"`
FilterRuleName *string `query:"filter_rule_name" json:"filter_rule_name,omitempty"`
SortField *string `query:"sort_field" json:"sort_field,omitempty" valid:"omitempty,oneof=first_appear_time last_appear_time appear_count" enums:"first_appear_time,last_appear_time,appear_count"`
SortOrder *string `query:"sort_order" json:"sort_order,omitempty" valid:"omitempty,oneof=asc desc" enums:"asc,desc"`
PageIndex uint32 `query:"page_index" valid:"required" json:"page_index"`
PageSize uint32 `query:"page_size" valid:"required" json:"page_size"`
}
Expand Down Expand Up @@ -74,6 +76,8 @@ type Source struct {
// @Param filter_status query string false "status" Enums(unhandled,solved,ignored,manual_audited)
// @Param filter_rule_name query string false "rule name"
// @Param filter_db_type query string false "db type"
// @Param sort_field query string false "sort field" Enums(first_appear_time,last_appear_time,appear_count)
// @Param sort_order query string false "sort order" Enums(asc,desc)
// @Param page_index query uint32 true "page index"
// @Param page_size query uint32 true "size of per page"
// @Success 200 {object} v1.GetSqlManageListResp
Expand Down Expand Up @@ -114,6 +118,8 @@ type ExportSqlManagesReq struct {
FilterStatus *string `query:"filter_status" json:"filter_status,omitempty"`
FilterDbType *string `query:"filter_db_type" json:"filter_db_type,omitempty"`
FilterRuleName *string `query:"filter_rule_name" json:"filter_rule_name,omitempty"`
SortField *string `query:"sort_field" json:"sort_field,omitempty" valid:"omitempty,oneof=first_appear_time last_appear_time appear_count" enums:"first_appear_time,last_appear_time,appear_count"`
SortOrder *string `query:"sort_order" json:"sort_order,omitempty" valid:"omitempty,oneof=asc desc" enums:"asc,desc"`
}

// ExportSqlManagesV1
Expand All @@ -133,6 +139,8 @@ type ExportSqlManagesReq struct {
// @Param filter_status query string false "status" Enums(unhandled,solved,ignored,manual_audited)
// @Param filter_db_type query string false "db type"
// @Param filter_rule_name query string false "rule name"
// @Param sort_field query string false "sort field" Enums(first_appear_time,last_appear_time,appear_count)
// @Param sort_order query string false "sort order" Enums(asc,desc)
// @Success 200 {file} file "export sql manage"
// @Router /v1/projects/{project_name}/sql_manages/exports [get]
func ExportSqlManagesV1(c echo.Context) error {
Expand Down
136 changes: 136 additions & 0 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,67 @@ var doc = `{
}
}
},
"/v1/company_notice": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get company notice info",
"tags": [
"companyNotice"
],
"summary": "获取企业公告",
"operationId": "getCompanyNotice",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.GetCompanyNoticeResp"
}
}
}
},
"patch": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "update company notice info",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"companyNotice"
],
"summary": "更新企业公告",
"operationId": "updateCompanyNotice",
"parameters": [
{
"description": "company notice",
"name": "companyNotice",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UpdateCompanyNoticeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.BaseRes"
}
}
}
}
},
"/v1/configurations/ding_talk": {
"get": {
"security": [
Expand Down Expand Up @@ -4757,6 +4818,27 @@ var doc = `{
"name": "filter_db_type",
"in": "query"
},
{
"enum": [
"first_appear_time",
"last_appear_time",
"appear_count"
],
"type": "string",
"description": "sort field",
"name": "sort_field",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "sort order",
"name": "sort_order",
"in": "query"
},
{
"type": "integer",
"description": "page index",
Expand Down Expand Up @@ -4919,6 +5001,27 @@ var doc = `{
"description": "rule name",
"name": "filter_rule_name",
"in": "query"
},
{
"enum": [
"first_appear_time",
"last_appear_time",
"appear_count"
],
"type": "string",
"description": "sort field",
"name": "sort_field",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "sort order",
"name": "sort_order",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -10648,6 +10751,14 @@ var doc = `{
}
}
},
"v1.CompanyNotice": {
"type": "object",
"properties": {
"notice_str": {
"type": "string"
}
}
},
"v1.CreateAuditPlanReqV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11614,6 +11725,23 @@ var doc = `{
}
}
},
"v1.GetCompanyNoticeResp": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 0
},
"data": {
"type": "object",
"$ref": "#/definitions/v1.CompanyNotice"
},
"message": {
"type": "string",
"example": "ok"
}
}
},
"v1.GetCustomRuleResV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -15354,6 +15482,14 @@ var doc = `{
}
}
},
"v1.UpdateCompanyNoticeReq": {
"type": "object",
"properties": {
"notice_str": {
"type": "string"
}
}
},
"v1.UpdateCurrentUserPasswordReqV1": {
"type": "object",
"properties": {
Expand Down
136 changes: 136 additions & 0 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,67 @@
}
}
},
"/v1/company_notice": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get company notice info",
"tags": [
"companyNotice"
],
"summary": "获取企业公告",
"operationId": "getCompanyNotice",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.GetCompanyNoticeResp"
}
}
}
},
"patch": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "update company notice info",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"companyNotice"
],
"summary": "更新企业公告",
"operationId": "updateCompanyNotice",
"parameters": [
{
"description": "company notice",
"name": "companyNotice",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UpdateCompanyNoticeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controller.BaseRes"
}
}
}
}
},
"/v1/configurations/ding_talk": {
"get": {
"security": [
Expand Down Expand Up @@ -4741,6 +4802,27 @@
"name": "filter_db_type",
"in": "query"
},
{
"enum": [
"first_appear_time",
"last_appear_time",
"appear_count"
],
"type": "string",
"description": "sort field",
"name": "sort_field",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "sort order",
"name": "sort_order",
"in": "query"
},
{
"type": "integer",
"description": "page index",
Expand Down Expand Up @@ -4903,6 +4985,27 @@
"description": "rule name",
"name": "filter_rule_name",
"in": "query"
},
{
"enum": [
"first_appear_time",
"last_appear_time",
"appear_count"
],
"type": "string",
"description": "sort field",
"name": "sort_field",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "sort order",
"name": "sort_order",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -10632,6 +10735,14 @@
}
}
},
"v1.CompanyNotice": {
"type": "object",
"properties": {
"notice_str": {
"type": "string"
}
}
},
"v1.CreateAuditPlanReqV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -11598,6 +11709,23 @@
}
}
},
"v1.GetCompanyNoticeResp": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 0
},
"data": {
"type": "object",
"$ref": "#/definitions/v1.CompanyNotice"
},
"message": {
"type": "string",
"example": "ok"
}
}
},
"v1.GetCustomRuleResV1": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -15338,6 +15466,14 @@
}
}
},
"v1.UpdateCompanyNoticeReq": {
"type": "object",
"properties": {
"notice_str": {
"type": "string"
}
}
},
"v1.UpdateCurrentUserPasswordReqV1": {
"type": "object",
"properties": {
Expand Down
Loading
Loading