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

feat: add group api for UI module #344 #373

Merged
merged 6 commits into from
Aug 31, 2022

Conversation

jettcc
Copy link
Contributor

@jettcc jettcc commented Aug 22, 2022

What this PR does:
add missing interfaces && add group api

Which issue(s) this PR fixes:

ref #344

@jettcc jettcc changed the title add group api for UI module #344 feat: add group api for UI module #344 Aug 22, 2022
@jettcc jettcc closed this Aug 22, 2022
@jettcc jettcc reopened this Aug 22, 2022
pkg/admin/router/db_groups.go Show resolved Hide resolved
pkg/admin/router/db_groups.go Show resolved Hide resolved
@dongzl dongzl added the config Config center. label Aug 22, 2022
err := service.UpsertGroup(context.Background(), tenantName, "", "", group)
if err != nil {
_ = c.Error(err)
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有问题吧,当出错的时候,返回值是啥呢?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不会的,我昨天试了下,当error 的时候,返回值是空的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package main

import (
	"errors"
	"github.com/gin-gonic/gin"
)

func main() {
	g := gin.Default()
	g.GET("/11", func(context *gin.Context) {
		context.Error(errors.New("111"))
	})
	g.Run()
}

结果:
image
image

func CreateGroup(c *gin.Context) {
service := admin.GetService(c)
tenantName := c.Param("tenant")
var group *boot.GroupBody
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be boot.GroupBody.

service := admin.GetService(c)
tenant := c.Param("tenant")
group := c.Param("group")
var groupBody *boot.GroupBody
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Comment on lines 30 to 32
import (
"github.com/gin-gonic/gin"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 3rd imports should before arana imports, pls reformat

@jjeffcaii jjeffcaii merged commit 1113978 into arana-db:feat/admin-api Aug 31, 2022
chuntaojun pushed a commit to chuntaojun/arana that referenced this pull request Sep 4, 2022
* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (arana-db#344)

* style: add license header and add tool: imports-formatter

* style: fix import
jjeffcaii added a commit that referenced this pull request Sep 4, 2022
* feat: add group api for UI module #344 (#373)

* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (#344)

* style: add license header and add tool: imports-formatter

* style: fix import

* feat: support notify event

* refactor:config center

* none

* feat: none

* refactor:split config and add change watch

* style: fix code style

* fix: fix func call error

* fix: ci error

* style:fix code style

* fix: fix code style

* refactor: rebase upstream

* fix:add cluster info to list groups

Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
Co-authored-by: Jeffsky <jjeffcaii@outlook.com>
AlexStocks pushed a commit that referenced this pull request Sep 10, 2022
* feat: add admin api server skeleton (#330)

* feat(config): add config updater api (#336)

* add http server api for cluster. (#352)

* add http server api for tenant (#366)

* add http server api for tenant

* fix import format

* fix go format

Co-authored-by: Zhang Aphelios <aphelios.zhang@shopee.com>

* add  http api for nodes#344 (#371)

* add  http api for nodes

* fix:bug

* fix:bug

* fix:bug

* fix:bug

* feat: add arana-admin into docker compose file

* fix 🐛  HTTP API For UI (#399)

* change

* change

* feat(config): support new config & Feat config listener (#374)

* feat: add group api for UI module #344 (#373)

* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (#344)

* style: add license header and add tool: imports-formatter

* style: fix import

* feat: support notify event

* refactor:config center

* none

* feat: none

* refactor:split config and add change watch

* style: fix code style

* fix: fix func call error

* fix: ci error

* style:fix code style

* fix: fix code style

* refactor: rebase upstream

* fix:add cluster info to list groups

Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
Co-authored-by: Jeffsky <jjeffcaii@outlook.com>

* fix: compile failure

* fix:unit test (#403)

* Feat/admin api (#404)

* Feat/admin api (#406)

* fix:unit test

* fix:unit test

* fix:file unit test

Co-authored-by: Zonglei Dong <dongzonglei@apache.org>
Co-authored-by: Aphelios <996933971@qq.com>
Co-authored-by: Zhang Aphelios <aphelios.zhang@shopee.com>
Co-authored-by: 龚娜 <2036479155@qq.com>
Co-authored-by: liaochuntao <liaochuntao@live.com>
Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Config center.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants