This commit is contained in:
oneao committed 2026-01-30 22:06:16 +08:00
1 parent 6a8c31e20c
commit 572011017a
25 files changed
+599 -563

No files matched your search

@@ -34,7 +34,7 @@ func CreateSpace(ctx context.Context, c *app.RequestContext) {
userID := middleware.GetUserID(ctx)
_, err = db.Queries.GetSpaceUser(ctx, userID)
_, err = db.Queries.GetSpaceMember(ctx, userID)
var isExist = true
@@ -93,13 +93,13 @@ func CreateSpace(ctx context.Context, c *app.RequestContext) {
return err
}
// 将创建用户默认添加到该空间内
userParams := repo.InsertSpaceUserParams{
userParams := repo.InsertSpaceMemberParams{
ID: idgen.NextId(),
SpaceID: spaceId,
UserID: userID,
Role: 0,
}
err := q.InsertSpaceUser(ctx, userParams)
err := q.InsertSpaceMember(ctx, userParams)
if err != nil {
return err
@@ -155,7 +155,7 @@ func DissolveSpace(ctx context.Context, c *app.RequestContext) {
return err2
}
err2 = q.DeleteSpaceUsersBySpaceID(ctx, spaceID)
err2 = q.DeleteSpaceMembersBySpaceID(ctx, spaceID)
if err2 != nil {
return err2
}
@@ -188,7 +188,7 @@ func ExitSpace(ctx context.Context, c *app.RequestContext) {
userID := middleware.GetUserID(ctx)
spaceUser, err := db.Queries.GetSpaceUser(ctx, userID)
spaceUser, err := db.Queries.GetSpaceMember(ctx, userID)
if err != nil {
if errorx.IsNotFound(err) {
@@ -210,7 +210,7 @@ func ExitSpace(ctx context.Context, c *app.RequestContext) {
}
err = db.WithTx(ctx, func(q *repo.Queries) error {
err2 := q.DeleteSpaceUserByUserID(ctx, userID)
err2 := q.DeleteSpaceMemberByUserID(ctx, userID)
if err2 != nil {
return err2
}
@@ -225,90 +225,6 @@ func ExitSpace(ctx context.Context, c *app.RequestContext) {
response.Success(c).Data(resp).Send()
}
// ListSpaceUsers .
// @router /space/users [POST]
func ListSpaceUsers(ctx context.Context, c *app.RequestContext) {
var err error
var req space.ListSpaceUsersParams
if err = c.BindAndValidate(&req); err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(space.ListSpaceUsersResult)
users, err := db.Queries.ListSpaceUsers(ctx, req.SpaceId)
if err != nil {
c.String(consts.StatusInternalServerError, err.Error())
return
}
resp.Users = make([]*space.SpaceUser, 0, len(users))
for _, u := range users {
resp.Users = append(resp.Users, &space.SpaceUser{
Id: u.UserID,
Username: u.UserName,
Avatar: u.UserAvatar,
Role: u.Role,
LastLoginTime: pgtypex.TimestamptzToMillis(u.LastLoginTime),
})
}
response.Success(c).Data(resp).Send()
}
// RemoveSpaceUser .
// @router /space/remove [POST]
func RemoveSpaceUser(ctx context.Context, c *app.RequestContext) {
var err error
var req space.RemoveSpaceUserParams
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(space.RemoveSpaceUserResult)
userID := middleware.GetUserID(ctx)
spaceID := req.SpaceId
// 检查权限
hasPermission, err := hasSpacePermission(ctx, userID, spaceID)
if err != nil {
errorx.AddError(c, err)
return
}
if !hasPermission {
response.Fail(c).Message("无权限操作该空间").Send()
return
}
// 移除
err = db.WithTx(ctx, func(q *repo.Queries) error {
err2 := q.DeleteSpaceUserBySpaceIDAndUserID(ctx, repo.DeleteSpaceUserBySpaceIDAndUserIDParams{
SpaceID: spaceID,
UserID: req.UserId,
})
if err2 != nil {
return err2
}
return nil
})
if err != nil {
errorx.AddError(c, err)
return
}
response.Success(c).Data(resp).Send()
}
// JoinSpace .
// @router /space/join [POST]
func JoinSpace(ctx context.Context, c *app.RequestContext) {
@@ -324,7 +240,7 @@ func JoinSpace(ctx context.Context, c *app.RequestContext) {
userID := middleware.GetUserID(ctx)
_, err = db.Queries.GetSpaceUser(ctx, userID)
_, err = db.Queries.GetSpaceMember(ctx, userID)
if err != nil {
if errorx.IsNotFound(err) {
@@ -352,7 +268,7 @@ func JoinSpace(ctx context.Context, c *app.RequestContext) {
}
err = db.WithTx(ctx, func(q *repo.Queries) error {
err2 := q.InsertSpaceUser(ctx, repo.InsertSpaceUserParams{
err2 := q.InsertSpaceMember(ctx, repo.InsertSpaceMemberParams{
ID: idgen.NextId(),
UserID: userID,
SpaceID: spaceByInviteCode.ID,
@@ -377,18 +293,102 @@ func JoinSpace(ctx context.Context, c *app.RequestContext) {
response.Success(c).Data(resp).Send()
}
// UpdateSpaceUserRole .
// @router /space/updateRole [POST]
func UpdateSpaceUserRole(ctx context.Context, c *app.RequestContext) {
// ListSpaceMembers .
// @router /space/members [POST]
func ListSpaceMembers(ctx context.Context, c *app.RequestContext) {
var err error
var req space.UpdateSpaceUserRoleParams
var req space.ListSpaceMembersParams
if err = c.BindAndValidate(&req); err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(space.ListSpaceMembersResult)
members, err := db.Queries.ListSpaceMembers(ctx, req.SpaceId)
if err != nil {
c.String(consts.StatusInternalServerError, err.Error())
return
}
resp.Members = make([]*space.SpaceMember, 0, len(members))
for _, u := range members {
resp.Members = append(resp.Members, &space.SpaceMember{
Id: u.UserID,
Username: u.UserName,
Avatar: u.UserAvatar,
Role: u.Role,
LastLoginTime: pgtypex.TimestamptzToMillis(u.LastLoginTime),
})
}
response.Success(c).Data(resp).Send()
}
// RemoveSpaceMember .
// @router /space/remove [POST]
func RemoveSpaceMember(ctx context.Context, c *app.RequestContext) {
var err error
var req space.RemoveSpaceMemberParams
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(space.UpdateSpaceUserRoleResult)
resp := new(space.RemoveSpaceMemberResult)
userID := middleware.GetUserID(ctx)
spaceID := req.SpaceId
// 检查权限
hasPermission, err := hasSpacePermission(ctx, userID, spaceID)
if err != nil {
errorx.AddError(c, err)
return
}
if !hasPermission {
response.Fail(c).Message("无权限操作该空间").Send()
return
}
// 移除
err = db.WithTx(ctx, func(q *repo.Queries) error {
err2 := q.DeleteSpaceMemberBySpaceIDAndUserID(ctx, repo.DeleteSpaceMemberBySpaceIDAndUserIDParams{
SpaceID: spaceID,
UserID: req.UserId,
})
if err2 != nil {
return err2
}
return nil
})
if err != nil {
errorx.AddError(c, err)
return
}
response.Success(c).Data(resp).Send()
}
// UpdateSpaceMemberRole .
// @router /space/updateRole [POST]
func UpdateSpaceMemberRole(ctx context.Context, c *app.RequestContext) {
var err error
var req space.UpdateSpaceMemberRoleParams
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(space.UpdateSpaceMemberRoleResult)
userID := middleware.GetUserID(ctx)
spaceID := req.SpaceId
@@ -407,7 +407,7 @@ func UpdateSpaceUserRole(ctx context.Context, c *app.RequestContext) {
}
// 检查是否在该空间
updateSpaceUser, err := db.Queries.GetSpaceUser(ctx, updateUserID)
updateSpaceUser, err := db.Queries.GetSpaceMember(ctx, updateUserID)
if err != nil {
if errorx.IsNotFound(err) {
@@ -425,7 +425,7 @@ func UpdateSpaceUserRole(ctx context.Context, c *app.RequestContext) {
// 更新
err = db.WithTx(ctx, func(q *repo.Queries) error {
err2 := q.UpdateSpaceUserRole(ctx, repo.UpdateSpaceUserRoleParams{
err2 := q.UpdateSpaceMemberRole(ctx, repo.UpdateSpaceMemberRoleParams{
Role: 1,
SpaceID: spaceID,
UserID: userID,
@@ -435,7 +435,7 @@ func UpdateSpaceUserRole(ctx context.Context, c *app.RequestContext) {
return err2
}
err2 = q.UpdateSpaceUserRole(ctx, repo.UpdateSpaceUserRoleParams{
err2 = q.UpdateSpaceMemberRole(ctx, repo.UpdateSpaceMemberRoleParams{
Role: 0,
SpaceID: spaceID,
UserID: updateUserID,
@@ -457,7 +457,7 @@ func UpdateSpaceUserRole(ctx context.Context, c *app.RequestContext) {
}
func hasSpacePermission(ctx context.Context, userID int64, spaceID int64) (bool, error) {
user, err := db.Queries.GetSpaceUser(ctx, userID)
user, err := db.Queries.GetSpaceMember(ctx, userID)
if err != nil {
if errorx.IsNotFound(err) {
@@ -3,7 +3,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v4.25.3
// protoc v6.33.1
// source: api.proto
package api
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v4.25.3
// protoc v6.33.1
// source: space.proto
package space
@@ -26,7 +26,7 @@ var file_space_proto_rawDesc = []byte{
0x0a, 0x0b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73,
0x70, 0x61, 0x63, 0x65, 0x1a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x17, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x90, 0x05, 0x0a, 0x0c, 0x53, 0x70, 0x61,
0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa4, 0x05, 0x0a, 0x0c, 0x53, 0x70, 0x61,
0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x0b, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
@@ -43,65 +43,67 @@ var file_space_proto_rawDesc = []byte{
0x63, 0x65, 0x2e, 0x45, 0x78, 0x69, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x73, 0x1a, 0x16, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x45, 0x78, 0x69, 0x74, 0x53,
0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x0f, 0xd2, 0xc1, 0x18, 0x0b,
0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, 0x0e, 0x4c,
0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e,
0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55,
0x73, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1b, 0x2e, 0x73, 0x70, 0x61,
0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x10, 0xd2, 0xc1, 0x18, 0x0c, 0x2f, 0x73, 0x70,
0x61, 0x63, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x60, 0x0a, 0x0f, 0x52, 0x65, 0x6d,
0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x73,
0x70, 0x61, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65,
0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1c, 0x2e, 0x73, 0x70, 0x61,
0x63, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x11, 0xd2, 0xc1, 0x18, 0x0d, 0x2f, 0x73,
0x70, 0x61, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x4a,
0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65,
0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
0x1a, 0x16, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61,
0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x0f, 0xd2, 0xc1, 0x18, 0x0b, 0x2f, 0x73,
0x70, 0x61, 0x63, 0x65, 0x2f, 0x6a, 0x6f, 0x69, 0x6e, 0x12, 0x70, 0x0a, 0x13, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
0x12, 0x20, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x73, 0x1a, 0x20, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x15, 0xd2, 0xc1, 0x18, 0x11, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65,
0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x18, 0x5a, 0x16, 0x61,
0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f,
0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0x64, 0x0a, 0x10, 0x4c,
0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12,
0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63,
0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1d,
0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x12, 0xd2,
0xc1, 0x18, 0x0e, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x73, 0x12, 0x66, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x52,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x52,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x11, 0xd2, 0xc1, 0x18, 0x0d, 0x2f, 0x73, 0x70, 0x61,
0x63, 0x65, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x4a, 0x6f, 0x69,
0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4a,
0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x16,
0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x0f, 0xd2, 0xc1, 0x18, 0x0b, 0x2f, 0x73, 0x70, 0x61,
0x63, 0x65, 0x2f, 0x6a, 0x6f, 0x69, 0x6e, 0x12, 0x76, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
0x12, 0x22, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f,
0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x15, 0xd2, 0xc1, 0x18, 0x11, 0x2f, 0x73,
0x70, 0x61, 0x63, 0x65, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42,
0x18, 0x5a, 0x16, 0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var file_space_proto_goTypes = []interface{}{
(*CreateSpaceParams)(nil), // 0: space.CreateSpaceParams
(*DissolveSpaceParams)(nil), // 1: space.DissolveSpaceParams
(*ExitSpaceParams)(nil), // 2: space.ExitSpaceParams
(*ListSpaceUsersParams)(nil), // 3: space.ListSpaceUsersParams
(*RemoveSpaceUserParams)(nil), // 4: space.RemoveSpaceUserParams
(*JoinSpaceParams)(nil), // 5: space.JoinSpaceParams
(*UpdateSpaceUserRoleParams)(nil), // 6: space.UpdateSpaceUserRoleParams
(*DissolveSpaceResult)(nil), // 7: space.DissolveSpaceResult
(*ExitSpaceResult)(nil), // 8: space.ExitSpaceResult
(*ListSpaceUsersResult)(nil), // 9: space.ListSpaceUsersResult
(*RemoveSpaceUserResult)(nil), // 10: space.RemoveSpaceUserResult
(*JoinSpaceResult)(nil), // 11: space.JoinSpaceResult
(*UpdateSpaceUserRoleResult)(nil), // 12: space.UpdateSpaceUserRoleResult
(*CreateSpaceParams)(nil), // 0: space.CreateSpaceParams
(*DissolveSpaceParams)(nil), // 1: space.DissolveSpaceParams
(*ExitSpaceParams)(nil), // 2: space.ExitSpaceParams
(*ListSpaceMembersParams)(nil), // 3: space.ListSpaceMembersParams
(*RemoveSpaceMemberParams)(nil), // 4: space.RemoveSpaceMemberParams
(*JoinSpaceParams)(nil), // 5: space.JoinSpaceParams
(*UpdateSpaceMemberRoleParams)(nil), // 6: space.UpdateSpaceMemberRoleParams
(*DissolveSpaceResult)(nil), // 7: space.DissolveSpaceResult
(*ExitSpaceResult)(nil), // 8: space.ExitSpaceResult
(*ListSpaceMembersResult)(nil), // 9: space.ListSpaceMembersResult
(*RemoveSpaceMemberResult)(nil), // 10: space.RemoveSpaceMemberResult
(*JoinSpaceResult)(nil), // 11: space.JoinSpaceResult
(*UpdateSpaceMemberRoleResult)(nil), // 12: space.UpdateSpaceMemberRoleResult
}
var file_space_proto_depIdxs = []int32{
0, // 0: space.SpaceService.CreateSpace:input_type -> space.CreateSpaceParams
1, // 1: space.SpaceService.DissolveSpace:input_type -> space.DissolveSpaceParams
2, // 2: space.SpaceService.ExitSpace:input_type -> space.ExitSpaceParams
3, // 3: space.SpaceService.ListSpaceUsers:input_type -> space.ListSpaceUsersParams
4, // 4: space.SpaceService.RemoveSpaceUser:input_type -> space.RemoveSpaceUserParams
3, // 3: space.SpaceService.ListSpaceMembers:input_type -> space.ListSpaceMembersParams
4, // 4: space.SpaceService.RemoveSpaceMember:input_type -> space.RemoveSpaceMemberParams
5, // 5: space.SpaceService.JoinSpace:input_type -> space.JoinSpaceParams
6, // 6: space.SpaceService.UpdateSpaceUserRole:input_type -> space.UpdateSpaceUserRoleParams
6, // 6: space.SpaceService.UpdateSpaceMemberRole:input_type -> space.UpdateSpaceMemberRoleParams
0, // 7: space.SpaceService.CreateSpace:output_type -> space.CreateSpaceParams
7, // 8: space.SpaceService.DissolveSpace:output_type -> space.DissolveSpaceResult
8, // 9: space.SpaceService.ExitSpace:output_type -> space.ExitSpaceResult
9, // 10: space.SpaceService.ListSpaceUsers:output_type -> space.ListSpaceUsersResult
10, // 11: space.SpaceService.RemoveSpaceUser:output_type -> space.RemoveSpaceUserResult
9, // 10: space.SpaceService.ListSpaceMembers:output_type -> space.ListSpaceMembersResult
10, // 11: space.SpaceService.RemoveSpaceMember:output_type -> space.RemoveSpaceMemberResult
11, // 12: space.SpaceService.JoinSpace:output_type -> space.JoinSpaceResult
12, // 13: space.SpaceService.UpdateSpaceUserRole:output_type -> space.UpdateSpaceUserRoleResult
12, // 13: space.SpaceService.UpdateSpaceMemberRole:output_type -> space.UpdateSpaceMemberRoleResult
7, // [7:14] is the sub-list for method output_type
0, // [0:7] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v4.25.3
// protoc v6.33.1
// source: space/space_types.proto
package space
@@ -211,7 +211,7 @@ func (*DissolveSpaceResult) Descriptor() ([]byte, []int) {
}
// 获取空间下的成员
type ListSpaceUsersParams struct {
type ListSpaceMembersParams struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -219,8 +219,8 @@ type ListSpaceUsersParams struct {
SpaceId int64 `protobuf:"varint,1,opt,name=SpaceId,proto3" form:"space_id" json:"space_id"`
}
func (x *ListSpaceUsersParams) Reset() {
*x = ListSpaceUsersParams{}
func (x *ListSpaceMembersParams) Reset() {
*x = ListSpaceMembersParams{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -228,13 +228,13 @@ func (x *ListSpaceUsersParams) Reset() {
}
}
func (x *ListSpaceUsersParams) String() string {
func (x *ListSpaceMembersParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListSpaceUsersParams) ProtoMessage() {}
func (*ListSpaceMembersParams) ProtoMessage() {}
func (x *ListSpaceUsersParams) ProtoReflect() protoreflect.Message {
func (x *ListSpaceMembersParams) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -246,19 +246,19 @@ func (x *ListSpaceUsersParams) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ListSpaceUsersParams.ProtoReflect.Descriptor instead.
func (*ListSpaceUsersParams) Descriptor() ([]byte, []int) {
// Deprecated: Use ListSpaceMembersParams.ProtoReflect.Descriptor instead.
func (*ListSpaceMembersParams) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{4}
}
func (x *ListSpaceUsersParams) GetSpaceId() int64 {
func (x *ListSpaceMembersParams) GetSpaceId() int64 {
if x != nil {
return x.SpaceId
}
return 0
}
type SpaceUser struct {
type SpaceMember struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -270,8 +270,8 @@ type SpaceUser struct {
LastLoginTime int64 `protobuf:"varint,5,opt,name=LastLoginTime,proto3" form:"last_login_time" json:"last_login_time"`
}
func (x *SpaceUser) Reset() {
*x = SpaceUser{}
func (x *SpaceMember) Reset() {
*x = SpaceMember{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -279,13 +279,13 @@ func (x *SpaceUser) Reset() {
}
}
func (x *SpaceUser) String() string {
func (x *SpaceMember) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SpaceUser) ProtoMessage() {}
func (*SpaceMember) ProtoMessage() {}
func (x *SpaceUser) ProtoReflect() protoreflect.Message {
func (x *SpaceMember) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -297,56 +297,56 @@ func (x *SpaceUser) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use SpaceUser.ProtoReflect.Descriptor instead.
func (*SpaceUser) Descriptor() ([]byte, []int) {
// Deprecated: Use SpaceMember.ProtoReflect.Descriptor instead.
func (*SpaceMember) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{5}
}
func (x *SpaceUser) GetId() int64 {
func (x *SpaceMember) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *SpaceUser) GetUsername() string {
func (x *SpaceMember) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *SpaceUser) GetAvatar() string {
func (x *SpaceMember) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *SpaceUser) GetRole() int32 {
func (x *SpaceMember) GetRole() int32 {
if x != nil {
return x.Role
}
return 0
}
func (x *SpaceUser) GetLastLoginTime() int64 {
func (x *SpaceMember) GetLastLoginTime() int64 {
if x != nil {
return x.LastLoginTime
}
return 0
}
type ListSpaceUsersResult struct {
type ListSpaceMembersResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Users []*SpaceUser `protobuf:"bytes,1,rep,name=users,proto3" form:"users" json:"users" query:"users"`
Members []*SpaceMember `protobuf:"bytes,1,rep,name=members,proto3" form:"members" json:"members" query:"members"`
}
func (x *ListSpaceUsersResult) Reset() {
*x = ListSpaceUsersResult{}
func (x *ListSpaceMembersResult) Reset() {
*x = ListSpaceMembersResult{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -354,13 +354,13 @@ func (x *ListSpaceUsersResult) Reset() {
}
}
func (x *ListSpaceUsersResult) String() string {
func (x *ListSpaceMembersResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListSpaceUsersResult) ProtoMessage() {}
func (*ListSpaceMembersResult) ProtoMessage() {}
func (x *ListSpaceUsersResult) ProtoReflect() protoreflect.Message {
func (x *ListSpaceMembersResult) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -372,14 +372,14 @@ func (x *ListSpaceUsersResult) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ListSpaceUsersResult.ProtoReflect.Descriptor instead.
func (*ListSpaceUsersResult) Descriptor() ([]byte, []int) {
// Deprecated: Use ListSpaceMembersResult.ProtoReflect.Descriptor instead.
func (*ListSpaceMembersResult) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{6}
}
func (x *ListSpaceUsersResult) GetUsers() []*SpaceUser {
func (x *ListSpaceMembersResult) GetMembers() []*SpaceMember {
if x != nil {
return x.Users
return x.Members
}
return nil
}
@@ -574,7 +574,7 @@ func (*ExitSpaceResult) Descriptor() ([]byte, []int) {
}
// 踢出成员
type RemoveSpaceUserParams struct {
type RemoveSpaceMemberParams struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -583,8 +583,8 @@ type RemoveSpaceUserParams struct {
UserId int64 `protobuf:"varint,2,opt,name=UserId,proto3" form:"user_id" json:"user_id" vd:"$ != 0"`
}
func (x *RemoveSpaceUserParams) Reset() {
*x = RemoveSpaceUserParams{}
func (x *RemoveSpaceMemberParams) Reset() {
*x = RemoveSpaceMemberParams{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -592,13 +592,13 @@ func (x *RemoveSpaceUserParams) Reset() {
}
}
func (x *RemoveSpaceUserParams) String() string {
func (x *RemoveSpaceMemberParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveSpaceUserParams) ProtoMessage() {}
func (*RemoveSpaceMemberParams) ProtoMessage() {}
func (x *RemoveSpaceUserParams) ProtoReflect() protoreflect.Message {
func (x *RemoveSpaceMemberParams) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -610,33 +610,33 @@ func (x *RemoveSpaceUserParams) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use RemoveSpaceUserParams.ProtoReflect.Descriptor instead.
func (*RemoveSpaceUserParams) Descriptor() ([]byte, []int) {
// Deprecated: Use RemoveSpaceMemberParams.ProtoReflect.Descriptor instead.
func (*RemoveSpaceMemberParams) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{11}
}
func (x *RemoveSpaceUserParams) GetSpaceId() int64 {
func (x *RemoveSpaceMemberParams) GetSpaceId() int64 {
if x != nil {
return x.SpaceId
}
return 0
}
func (x *RemoveSpaceUserParams) GetUserId() int64 {
func (x *RemoveSpaceMemberParams) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
type RemoveSpaceUserResult struct {
type RemoveSpaceMemberResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *RemoveSpaceUserResult) Reset() {
*x = RemoveSpaceUserResult{}
func (x *RemoveSpaceMemberResult) Reset() {
*x = RemoveSpaceMemberResult{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -644,13 +644,13 @@ func (x *RemoveSpaceUserResult) Reset() {
}
}
func (x *RemoveSpaceUserResult) String() string {
func (x *RemoveSpaceMemberResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveSpaceUserResult) ProtoMessage() {}
func (*RemoveSpaceMemberResult) ProtoMessage() {}
func (x *RemoveSpaceUserResult) ProtoReflect() protoreflect.Message {
func (x *RemoveSpaceMemberResult) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -662,13 +662,13 @@ func (x *RemoveSpaceUserResult) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use RemoveSpaceUserResult.ProtoReflect.Descriptor instead.
func (*RemoveSpaceUserResult) Descriptor() ([]byte, []int) {
// Deprecated: Use RemoveSpaceMemberResult.ProtoReflect.Descriptor instead.
func (*RemoveSpaceMemberResult) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{12}
}
// 更新权限
type UpdateSpaceUserRoleParams struct {
type UpdateSpaceMemberRoleParams struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -678,8 +678,8 @@ type UpdateSpaceUserRoleParams struct {
Role int32 `protobuf:"varint,3,opt,name=Role,proto3" form:"role" json:"role" vd:"$ != 0"`
}
func (x *UpdateSpaceUserRoleParams) Reset() {
*x = UpdateSpaceUserRoleParams{}
func (x *UpdateSpaceMemberRoleParams) Reset() {
*x = UpdateSpaceMemberRoleParams{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -687,13 +687,13 @@ func (x *UpdateSpaceUserRoleParams) Reset() {
}
}
func (x *UpdateSpaceUserRoleParams) String() string {
func (x *UpdateSpaceMemberRoleParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateSpaceUserRoleParams) ProtoMessage() {}
func (*UpdateSpaceMemberRoleParams) ProtoMessage() {}
func (x *UpdateSpaceUserRoleParams) ProtoReflect() protoreflect.Message {
func (x *UpdateSpaceMemberRoleParams) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -705,40 +705,40 @@ func (x *UpdateSpaceUserRoleParams) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use UpdateSpaceUserRoleParams.ProtoReflect.Descriptor instead.
func (*UpdateSpaceUserRoleParams) Descriptor() ([]byte, []int) {
// Deprecated: Use UpdateSpaceMemberRoleParams.ProtoReflect.Descriptor instead.
func (*UpdateSpaceMemberRoleParams) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{13}
}
func (x *UpdateSpaceUserRoleParams) GetSpaceId() int64 {
func (x *UpdateSpaceMemberRoleParams) GetSpaceId() int64 {
if x != nil {
return x.SpaceId
}
return 0
}
func (x *UpdateSpaceUserRoleParams) GetUserId() int64 {
func (x *UpdateSpaceMemberRoleParams) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *UpdateSpaceUserRoleParams) GetRole() int32 {
func (x *UpdateSpaceMemberRoleParams) GetRole() int32 {
if x != nil {
return x.Role
}
return 0
}
type UpdateSpaceUserRoleResult struct {
type UpdateSpaceMemberRoleResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UpdateSpaceUserRoleResult) Reset() {
*x = UpdateSpaceUserRoleResult{}
func (x *UpdateSpaceMemberRoleResult) Reset() {
*x = UpdateSpaceMemberRoleResult{}
if protoimpl.UnsafeEnabled {
mi := &file_space_space_types_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -746,13 +746,13 @@ func (x *UpdateSpaceUserRoleResult) Reset() {
}
}
func (x *UpdateSpaceUserRoleResult) String() string {
func (x *UpdateSpaceMemberRoleResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateSpaceUserRoleResult) ProtoMessage() {}
func (*UpdateSpaceMemberRoleResult) ProtoMessage() {}
func (x *UpdateSpaceUserRoleResult) ProtoReflect() protoreflect.Message {
func (x *UpdateSpaceMemberRoleResult) ProtoReflect() protoreflect.Message {
mi := &file_space_space_types_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -764,8 +764,8 @@ func (x *UpdateSpaceUserRoleResult) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use UpdateSpaceUserRoleResult.ProtoReflect.Descriptor instead.
func (*UpdateSpaceUserRoleResult) Descriptor() ([]byte, []int) {
// Deprecated: Use UpdateSpaceMemberRoleResult.ProtoReflect.Descriptor instead.
func (*UpdateSpaceMemberRoleResult) Descriptor() ([]byte, []int) {
return file_space_space_types_proto_rawDescGZIP(), []int{14}
}
@@ -790,67 +790,69 @@ var file_space_space_types_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f,
0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44,
0x69, 0x73, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x22, 0x3e, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55,
0x73, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x70,
0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18,
0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65,
0x49, 0x64, 0x22, 0xca, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72,
0x12, 0x16, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xca, 0xbb,
0x18, 0x02, 0x69, 0x64, 0x52, 0x02, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xca, 0xbb, 0x18, 0x08,
0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x0a, 0xca, 0xbb, 0x18, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x06,
0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x42, 0x08, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x04,
0x52, 0x6f, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0d, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69,
0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x13, 0xca, 0xbb, 0x18,
0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65,
0x52, 0x0d, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22,
0x3e, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x53,
0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22,
0x4d, 0x0a, 0x0f, 0x4a, 0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0xca, 0xbb, 0x18, 0x0b, 0x69, 0x6e, 0x76, 0x69,
0x74, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0xda, 0xbb, 0x18, 0x07, 0x24, 0x20, 0x21, 0x3d, 0x20,
0x27, 0x27, 0x52, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x67,
0x0a, 0x0f, 0x4a, 0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64,
0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x09, 0x53, 0x70, 0x61,
0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xca, 0xbb,
0x18, 0x0a, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x53, 0x70,
0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x74, 0x53,
0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x70,
0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18,
0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65,
0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x78, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53,
0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30,
0x0a, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42,
0x16, 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18,
0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64,
0x12, 0x2d, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x42, 0x15, 0xca, 0xbb, 0x18, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18,
0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22,
0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa4, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x16, 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61,
0x63, 0x65, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52,
0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72,
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xca, 0xbb, 0x18, 0x07, 0x75, 0x73,
0x65, 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52,
0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x12, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0xda,
0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x22,
0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73,
0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x18, 0x5a, 0x16,
0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6c, 0x74, 0x22, 0x40, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x07,
0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca,
0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61,
0x63, 0x65, 0x49, 0x64, 0x22, 0xcc, 0x01, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65,
0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x42, 0x06, 0xca, 0xbb, 0x18, 0x02, 0x69, 0x64, 0x52, 0x02, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08,
0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c,
0xca, 0xbb, 0x18, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x08, 0x55, 0x73,
0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xca, 0xbb, 0x18, 0x06, 0x61, 0x76, 0x61, 0x74,
0x61, 0x72, 0x52, 0x06, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x52, 0x6f,
0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x08, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f,
0x6c, 0x65, 0x52, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0d, 0x4c, 0x61, 0x73, 0x74,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42,
0x13, 0xca, 0xbb, 0x18, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f,
0x74, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54,
0x69, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a,
0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x0f, 0x4a,
0x6f, 0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3a,
0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x1a, 0xca, 0xbb, 0x18, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x63,
0x6f, 0x64, 0x65, 0xda, 0xbb, 0x18, 0x07, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x27, 0x27, 0x52, 0x0a,
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x67, 0x0a, 0x0f, 0x4a, 0x6f,
0x69, 0x6e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a,
0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c,
0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70,
0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xca, 0xbb, 0x18, 0x0a, 0x73, 0x70,
0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e,
0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61,
0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, 0x11,
0x0a, 0x0f, 0x45, 0x78, 0x69, 0x74, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x22, 0x7a, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x07,
0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x16, 0xca,
0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24,
0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2d,
0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15,
0xca, 0xbb, 0x18, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24,
0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x19, 0x0a,
0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa6, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f,
0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x53, 0x70, 0x61, 0x63,
0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x16, 0xca, 0xbb, 0x18, 0x08, 0x73,
0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20,
0x30, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x55, 0x73,
0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xca, 0xbb, 0x18, 0x07,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20,
0x30, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x52, 0x6f, 0x6c,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x12, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f, 0x6c,
0x65, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x04, 0x52, 0x6f, 0x6c,
0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x42, 0x18, 0x5a, 0x16, 0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d,
0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
@@ -867,24 +869,24 @@ func file_space_space_types_proto_rawDescGZIP() []byte {
var file_space_space_types_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_space_space_types_proto_goTypes = []interface{}{
(*CreateSpaceParams)(nil), // 0: space.CreateSpaceParams
(*CreateSpaceResult)(nil), // 1: space.CreateSpaceResult
(*DissolveSpaceParams)(nil), // 2: space.DissolveSpaceParams
(*DissolveSpaceResult)(nil), // 3: space.DissolveSpaceResult
(*ListSpaceUsersParams)(nil), // 4: space.ListSpaceUsersParams
(*SpaceUser)(nil), // 5: space.SpaceUser
(*ListSpaceUsersResult)(nil), // 6: space.ListSpaceUsersResult
(*JoinSpaceParams)(nil), // 7: space.JoinSpaceParams
(*JoinSpaceResult)(nil), // 8: space.JoinSpaceResult
(*ExitSpaceParams)(nil), // 9: space.ExitSpaceParams
(*ExitSpaceResult)(nil), // 10: space.ExitSpaceResult
(*RemoveSpaceUserParams)(nil), // 11: space.RemoveSpaceUserParams
(*RemoveSpaceUserResult)(nil), // 12: space.RemoveSpaceUserResult
(*UpdateSpaceUserRoleParams)(nil), // 13: space.UpdateSpaceUserRoleParams
(*UpdateSpaceUserRoleResult)(nil), // 14: space.UpdateSpaceUserRoleResult
(*CreateSpaceParams)(nil), // 0: space.CreateSpaceParams
(*CreateSpaceResult)(nil), // 1: space.CreateSpaceResult
(*DissolveSpaceParams)(nil), // 2: space.DissolveSpaceParams
(*DissolveSpaceResult)(nil), // 3: space.DissolveSpaceResult
(*ListSpaceMembersParams)(nil), // 4: space.ListSpaceMembersParams
(*SpaceMember)(nil), // 5: space.SpaceMember
(*ListSpaceMembersResult)(nil), // 6: space.ListSpaceMembersResult
(*JoinSpaceParams)(nil), // 7: space.JoinSpaceParams
(*JoinSpaceResult)(nil), // 8: space.JoinSpaceResult
(*ExitSpaceParams)(nil), // 9: space.ExitSpaceParams
(*ExitSpaceResult)(nil), // 10: space.ExitSpaceResult
(*RemoveSpaceMemberParams)(nil), // 11: space.RemoveSpaceMemberParams
(*RemoveSpaceMemberResult)(nil), // 12: space.RemoveSpaceMemberResult
(*UpdateSpaceMemberRoleParams)(nil), // 13: space.UpdateSpaceMemberRoleParams
(*UpdateSpaceMemberRoleResult)(nil), // 14: space.UpdateSpaceMemberRoleResult
}
var file_space_space_types_proto_depIdxs = []int32{
5, // 0: space.ListSpaceUsersResult.users:type_name -> space.SpaceUser
5, // 0: space.ListSpaceMembersResult.members:type_name -> space.SpaceMember
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -947,7 +949,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListSpaceUsersParams); i {
switch v := v.(*ListSpaceMembersParams); i {
case 0:
return &v.state
case 1:
@@ -959,7 +961,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SpaceUser); i {
switch v := v.(*SpaceMember); i {
case 0:
return &v.state
case 1:
@@ -971,7 +973,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListSpaceUsersResult); i {
switch v := v.(*ListSpaceMembersResult); i {
case 0:
return &v.state
case 1:
@@ -1031,7 +1033,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveSpaceUserParams); i {
switch v := v.(*RemoveSpaceMemberParams); i {
case 0:
return &v.state
case 1:
@@ -1043,7 +1045,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveSpaceUserResult); i {
switch v := v.(*RemoveSpaceMemberResult); i {
case 0:
return &v.state
case 1:
@@ -1055,7 +1057,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateSpaceUserRoleParams); i {
switch v := v.(*UpdateSpaceMemberRoleParams); i {
case 0:
return &v.state
case 1:
@@ -1067,7 +1069,7 @@ func file_space_space_types_proto_init() {
}
}
file_space_space_types_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateSpaceUserRoleResult); i {
switch v := v.(*UpdateSpaceMemberRoleResult); i {
case 0:
return &v.state
case 1:
@@ -55,3 +55,18 @@ func _updatespaceuserroleMw() []app.HandlerFunc {
// your code...
return nil
}
func _listspacemembersMw() []app.HandlerFunc {
// your code...
return nil
}
func _removespacememberMw() []app.HandlerFunc {
// your code...
return nil
}
func _updatespacememberroleMw() []app.HandlerFunc {
// your code...
return nil
}
@@ -23,8 +23,8 @@ func Register(r *server.Hertz) {
_space.POST("/dissolve", append(_dissolvespaceMw(), space.DissolveSpace)...)
_space.POST("/exit", append(_exitspaceMw(), space.ExitSpace)...)
_space.POST("/join", append(_joinspaceMw(), space.JoinSpace)...)
_space.POST("/remove", append(_removespaceuserMw(), space.RemoveSpaceUser)...)
_space.POST("/updateRole", append(_updatespaceuserroleMw(), space.UpdateSpaceUserRole)...)
_space.POST("/users", append(_listspaceusersMw(), space.ListSpaceUsers)...)
_space.POST("/members", append(_listspacemembersMw(), space.ListSpaceMembers)...)
_space.POST("/remove", append(_removespacememberMw(), space.RemoveSpaceMember)...)
_space.POST("/updateRole", append(_updatespacememberroleMw(), space.UpdateSpaceMemberRole)...)
}
}
@@ -3,7 +3,7 @@ SELECT
mr.*,
u.username AS username
FROM money_record mr
LEFT JOIN space_user su
LEFT JOIN space_member su
ON su.user_id = mr.user_id
LEFT JOIN "user" u
ON u.id = mr.user_id
@@ -68,7 +68,7 @@ FROM
LEFT JOIN
money_user_category muc ON mr.category_id = muc.id -- 连接 money_user_category 获取 type
LEFT JOIN
space_user su ON su.user_id = $2 -- 连接 space_user 表,查找该用户在空间中的信息
space_member su ON su.user_id = $2 -- 连接 space_member 表,查找该用户在空间中的信息
LEFT JOIN
space s ON s.id = su.space_id -- 连接 space 表,获取空间信息
WHERE
@@ -94,7 +94,7 @@ FROM
LEFT JOIN
money_user_category muc ON mr.category_id = muc.id
LEFT JOIN
space_user su ON su.user_id = $1 -- 连接 space_user 表,查找该用户在空间中的信息
space_member su ON su.user_id = $1 -- 连接 space_member 表,查找该用户在空间中的信息
LEFT JOIN
space s ON s.id = su.space_id -- 连接 space 表,获取空间信息
WHERE
+2 -1
View File
@@ -12,11 +12,12 @@ DELETE FROM space WHERE id = $1;
-- name: GetSpaceById :one
SELECT * FROM space WHERE id = $1;
-- 查询用户所在的空间信息
-- name: GetSpaceByUserId :one
SELECT s.*, m.role
FROM space s
JOIN space_user m
JOIN space_member m
ON s.id = m.space_id
WHERE m.user_id = $1;
@@ -1,44 +1,44 @@
-- 插入空间用户
-- name: InsertSpaceUser :exec
INSERT INTO space_user(id,space_id,user_id,role,join_time)
-- name: InsertSpaceMember :exec
INSERT INTO space_member(id,space_id,user_id,role,join_time)
VALUES ($1,$2,$3,$4,NOW());
-- name: ListSpaceUsers :many
-- name: ListSpaceMembers :many
SELECT
u.id AS user_id,
u.username AS user_name,
u.avatar AS user_avatar,
u.last_login_time AS last_login_time,
su.role
FROM space_user su
FROM space_member su
INNER JOIN "user" u ON su.user_id = u.id
WHERE su.space_id = $1
ORDER BY su.role DESC, u.username ASC;
-- 获取空间用户
-- name: GetSpaceUser :one
-- name: GetSpaceMember :one
SELECT *
FROM space_user
FROM space_member
WHERE user_id = $1;
-- 删除某个用户在所有空间的关系
-- name: DeleteSpaceUserByUserID :exec
DELETE FROM space_user
-- name: DeleteSpaceMemberByUserID :exec
DELETE FROM space_member
WHERE user_id = $1;
-- 删除某个用户在指定空间中的关系
-- name: DeleteSpaceUserBySpaceIDAndUserID :exec
DELETE FROM space_user
-- name: DeleteSpaceMemberBySpaceIDAndUserID :exec
DELETE FROM space_member
WHERE space_id = $1
AND user_id = $2;
-- 删除某个空间下的所有用户
-- name: DeleteSpaceUsersBySpaceID :exec
DELETE FROM space_user
-- name: DeleteSpaceMembersBySpaceID :exec
DELETE FROM space_member
WHERE space_id = $1;
-- 修改角色
-- name: UpdateSpaceUserRole :exec
UPDATE space_user
-- name: UpdateSpaceMemberRole :exec
UPDATE space_member
SET role = $1
WHERE user_id = $2 AND space_id = $3;
+1 -1
View File
@@ -46,7 +46,7 @@ type Space struct {
UpdateTime pgtype.Timestamp
}
type SpaceUser struct {
type SpaceMember struct {
ID int64
SpaceID int64
UserID int64
@@ -95,7 +95,7 @@ SELECT
mr.id, mr.category_id, mr.user_id, mr.amount, mr.remark, mr.record_time, mr.create_time, mr.update_time,
u.username AS username
FROM money_record mr
LEFT JOIN space_user su
LEFT JOIN space_member su
ON su.user_id = mr.user_id
LEFT JOIN "user" u
ON u.id = mr.user_id
@@ -173,7 +173,7 @@ FROM
LEFT JOIN
money_user_category muc ON mr.category_id = muc.id -- 连接 money_user_category 获取 type
LEFT JOIN
space_user su ON su.user_id = $2 -- 连接 space_user 表,查找该用户在空间中的信息
space_member su ON su.user_id = $2 -- 连接 space_member 表,查找该用户在空间中的信息
LEFT JOIN
space s ON s.id = su.space_id -- 连接 space 表,获取空间信息
WHERE
@@ -238,7 +238,7 @@ FROM
LEFT JOIN
money_user_category muc ON mr.category_id = muc.id
LEFT JOIN
space_user su ON su.user_id = $1 -- 连接 space_user 表,查找该用户在空间中的信息
space_member su ON su.user_id = $1 -- 连接 space_member 表,查找该用户在空间中的信息
LEFT JOIN
space s ON s.id = su.space_id -- 连接 space 表,获取空间信息
WHERE
+1 -1
View File
@@ -60,7 +60,7 @@ func (q *Queries) GetSpaceById(ctx context.Context, id int64) (Space, error) {
const getSpaceByUserId = `-- name: GetSpaceByUserId :one
SELECT s.id, s.name, s.invite_code, s.create_time, s.update_time, m.role
FROM space s
JOIN space_user m
JOIN space_member m
ON s.id = m.space_id
WHERE m.user_id = $1
`
@@ -0,0 +1,159 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// source: space_member.sql
package repo
import (
"context"
"github.com/jackc/pgx/v5/pgtype"
)
const deleteSpaceMemberBySpaceIDAndUserID = `-- name: DeleteSpaceMemberBySpaceIDAndUserID :exec
DELETE FROM space_member
WHERE space_id = $1
AND user_id = $2
`
type DeleteSpaceMemberBySpaceIDAndUserIDParams struct {
SpaceID int64
UserID int64
}
// 删除某个用户在指定空间中的关系
func (q *Queries) DeleteSpaceMemberBySpaceIDAndUserID(ctx context.Context, arg DeleteSpaceMemberBySpaceIDAndUserIDParams) error {
_, err := q.db.Exec(ctx, deleteSpaceMemberBySpaceIDAndUserID, arg.SpaceID, arg.UserID)
return err
}
const deleteSpaceMemberByUserID = `-- name: DeleteSpaceMemberByUserID :exec
DELETE FROM space_member
WHERE user_id = $1
`
// 删除某个用户在所有空间的关系
func (q *Queries) DeleteSpaceMemberByUserID(ctx context.Context, userID int64) error {
_, err := q.db.Exec(ctx, deleteSpaceMemberByUserID, userID)
return err
}
const deleteSpaceMembersBySpaceID = `-- name: DeleteSpaceMembersBySpaceID :exec
DELETE FROM space_member
WHERE space_id = $1
`
// 删除某个空间下的所有用户
func (q *Queries) DeleteSpaceMembersBySpaceID(ctx context.Context, spaceID int64) error {
_, err := q.db.Exec(ctx, deleteSpaceMembersBySpaceID, spaceID)
return err
}
const getSpaceMember = `-- name: GetSpaceMember :one
SELECT id, space_id, user_id, role, join_time
FROM space_member
WHERE user_id = $1
`
// 获取空间用户
func (q *Queries) GetSpaceMember(ctx context.Context, userID int64) (SpaceMember, error) {
row := q.db.QueryRow(ctx, getSpaceMember, userID)
var i SpaceMember
err := row.Scan(
&i.ID,
&i.SpaceID,
&i.UserID,
&i.Role,
&i.JoinTime,
)
return i, err
}
const insertSpaceMember = `-- name: InsertSpaceMember :exec
INSERT INTO space_member(id,space_id,user_id,role,join_time)
VALUES ($1,$2,$3,$4,NOW())
`
type InsertSpaceMemberParams struct {
ID int64
SpaceID int64
UserID int64
Role int32
}
// 插入空间用户
func (q *Queries) InsertSpaceMember(ctx context.Context, arg InsertSpaceMemberParams) error {
_, err := q.db.Exec(ctx, insertSpaceMember,
arg.ID,
arg.SpaceID,
arg.UserID,
arg.Role,
)
return err
}
const listSpaceMembers = `-- name: ListSpaceMembers :many
SELECT
u.id AS user_id,
u.username AS user_name,
u.avatar AS user_avatar,
u.last_login_time AS last_login_time,
su.role
FROM space_member su
INNER JOIN "user" u ON su.user_id = u.id
WHERE su.space_id = $1
ORDER BY su.role DESC, u.username ASC
`
type ListSpaceMembersRow struct {
UserID int64
UserName string
UserAvatar string
LastLoginTime pgtype.Timestamptz
Role int32
}
func (q *Queries) ListSpaceMembers(ctx context.Context, spaceID int64) ([]ListSpaceMembersRow, error) {
rows, err := q.db.Query(ctx, listSpaceMembers, spaceID)
if err != nil {
return nil, err
}
defer rows.Close()
var items []ListSpaceMembersRow
for rows.Next() {
var i ListSpaceMembersRow
if err := rows.Scan(
&i.UserID,
&i.UserName,
&i.UserAvatar,
&i.LastLoginTime,
&i.Role,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const updateSpaceMemberRole = `-- name: UpdateSpaceMemberRole :exec
UPDATE space_member
SET role = $1
WHERE user_id = $2 AND space_id = $3
`
type UpdateSpaceMemberRoleParams struct {
Role int32
UserID int64
SpaceID int64
}
// 修改角色
func (q *Queries) UpdateSpaceMemberRole(ctx context.Context, arg UpdateSpaceMemberRoleParams) error {
_, err := q.db.Exec(ctx, updateSpaceMemberRole, arg.Role, arg.UserID, arg.SpaceID)
return err
}
@@ -1,159 +0,0 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// source: space_user.sql
package repo
import (
"context"
"github.com/jackc/pgx/v5/pgtype"
)
const deleteSpaceUserBySpaceIDAndUserID = `-- name: DeleteSpaceUserBySpaceIDAndUserID :exec
DELETE FROM space_user
WHERE space_id = $1
AND user_id = $2
`
type DeleteSpaceUserBySpaceIDAndUserIDParams struct {
SpaceID int64
UserID int64
}
// 删除某个用户在指定空间中的关系
func (q *Queries) DeleteSpaceUserBySpaceIDAndUserID(ctx context.Context, arg DeleteSpaceUserBySpaceIDAndUserIDParams) error {
_, err := q.db.Exec(ctx, deleteSpaceUserBySpaceIDAndUserID, arg.SpaceID, arg.UserID)
return err
}
const deleteSpaceUserByUserID = `-- name: DeleteSpaceUserByUserID :exec
DELETE FROM space_user
WHERE user_id = $1
`
// 删除某个用户在所有空间的关系
func (q *Queries) DeleteSpaceUserByUserID(ctx context.Context, userID int64) error {
_, err := q.db.Exec(ctx, deleteSpaceUserByUserID, userID)
return err
}
const deleteSpaceUsersBySpaceID = `-- name: DeleteSpaceUsersBySpaceID :exec
DELETE FROM space_user
WHERE space_id = $1
`
// 删除某个空间下的所有用户
func (q *Queries) DeleteSpaceUsersBySpaceID(ctx context.Context, spaceID int64) error {
_, err := q.db.Exec(ctx, deleteSpaceUsersBySpaceID, spaceID)
return err
}
const getSpaceUser = `-- name: GetSpaceUser :one
SELECT id, space_id, user_id, role, join_time
FROM space_user
WHERE user_id = $1
`
// 获取空间用户
func (q *Queries) GetSpaceUser(ctx context.Context, userID int64) (SpaceUser, error) {
row := q.db.QueryRow(ctx, getSpaceUser, userID)
var i SpaceUser
err := row.Scan(
&i.ID,
&i.SpaceID,
&i.UserID,
&i.Role,
&i.JoinTime,
)
return i, err
}
const insertSpaceUser = `-- name: InsertSpaceUser :exec
INSERT INTO space_user(id,space_id,user_id,role,join_time)
VALUES ($1,$2,$3,$4,NOW())
`
type InsertSpaceUserParams struct {
ID int64
SpaceID int64
UserID int64
Role int32
}
// 插入空间用户
func (q *Queries) InsertSpaceUser(ctx context.Context, arg InsertSpaceUserParams) error {
_, err := q.db.Exec(ctx, insertSpaceUser,
arg.ID,
arg.SpaceID,
arg.UserID,
arg.Role,
)
return err
}
const listSpaceUsers = `-- name: ListSpaceUsers :many
SELECT
u.id AS user_id,
u.username AS user_name,
u.avatar AS user_avatar,
u.last_login_time AS last_login_time,
su.role
FROM space_user su
INNER JOIN "user" u ON su.user_id = u.id
WHERE su.space_id = $1
ORDER BY su.role DESC, u.username ASC
`
type ListSpaceUsersRow struct {
UserID int64
UserName string
UserAvatar string
LastLoginTime pgtype.Timestamptz
Role int32
}
func (q *Queries) ListSpaceUsers(ctx context.Context, spaceID int64) ([]ListSpaceUsersRow, error) {
rows, err := q.db.Query(ctx, listSpaceUsers, spaceID)
if err != nil {
return nil, err
}
defer rows.Close()
var items []ListSpaceUsersRow
for rows.Next() {
var i ListSpaceUsersRow
if err := rows.Scan(
&i.UserID,
&i.UserName,
&i.UserAvatar,
&i.LastLoginTime,
&i.Role,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const updateSpaceUserRole = `-- name: UpdateSpaceUserRole :exec
UPDATE space_user
SET role = $1
WHERE user_id = $2 AND space_id = $3
`
type UpdateSpaceUserRoleParams struct {
Role int32
UserID int64
SpaceID int64
}
// 修改角色
func (q *Queries) UpdateSpaceUserRole(ctx context.Context, arg UpdateSpaceUserRoleParams) error {
_, err := q.db.Exec(ctx, updateSpaceUserRole, arg.Role, arg.UserID, arg.SpaceID)
return err
}
+1 -1
View File
@@ -74,7 +74,7 @@ ALTER TABLE space
ADD CONSTRAINT space_invite_code_key UNIQUE (invite_code);
-- 空间成员表(每个用户只能加入一个空间)
CREATE TABLE space_user (
CREATE TABLE space_member (
id BIGSERIAL PRIMARY KEY,
space_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
+1 -1
View File
@@ -5,6 +5,7 @@ go 1.25.3
require (
github.com/cloudwego/hertz v0.10.4
github.com/golang-jwt/jwt/v4 v4.5.2
github.com/gorilla/websocket v1.5.3
github.com/hertz-contrib/requestid v1.1.0
github.com/jackc/pgx/v5 v5.8.0
github.com/pkg/errors v0.9.1
@@ -28,7 +29,6 @@ require (
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
+4 -4
View File
@@ -25,12 +25,12 @@ service SpaceService {
};
// 获取空间用户列表
rpc ListSpaceUsers(ListSpaceUsersParams) returns (ListSpaceUsersResult){
option (api.post) = '/space/users';
rpc ListSpaceMembers(ListSpaceMembersParams) returns (ListSpaceMembersResult){
option (api.post) = '/space/members';
};
// 踢出某人
rpc RemoveSpaceUser(RemoveSpaceUserParams) returns (RemoveSpaceUserResult){
rpc RemoveSpaceMember(RemoveSpaceMemberParams) returns (RemoveSpaceMemberResult){
option (api.post) = '/space/remove';
};
@@ -40,7 +40,7 @@ service SpaceService {
};
// 赋予权限
rpc UpdateSpaceUserRole(UpdateSpaceUserRoleParams) returns (UpdateSpaceUserRoleResult) {
rpc UpdateSpaceMemberRole(UpdateSpaceMemberRoleParams) returns (UpdateSpaceMemberRoleResult) {
option (api.post) = "/space/updateRole";
}
}
@@ -26,11 +26,11 @@ message DissolveSpaceResult {
}
// 获取空间下的成员
message ListSpaceUsersParams {
message ListSpaceMembersParams {
int64 SpaceId = 1 [(api.body)="space_id"];
}
message SpaceUser {
message SpaceMember {
int64 Id = 1 [(api.body)="id"];
string Username = 2 [(api.body)="username"];
string Avatar = 3 [(api.body)="avatar"];
@@ -38,8 +38,8 @@ message SpaceUser {
int64 LastLoginTime = 5 [(api.body)="last_login_time"];
}
message ListSpaceUsersResult {
repeated SpaceUser users = 1;
message ListSpaceMembersResult {
repeated SpaceMember members = 1;
}
// 加入空间
@@ -62,22 +62,22 @@ message ExitSpaceResult {
}
// 踢出成员
message RemoveSpaceUserParams {
message RemoveSpaceMemberParams {
int64 SpaceId = 1 [(api.body) = "space_id",(api.vd)="$ != 0"];
int64 UserId = 2 [(api.body) = "user_id",(api.vd)="$ != 0"];
}
message RemoveSpaceUserResult {
message RemoveSpaceMemberResult {
}
// 更新权限
message UpdateSpaceUserRoleParams {
message UpdateSpaceMemberRoleParams {
int64 SpaceId = 1 [(api.body) = "space_id",(api.vd)="$ != 0"];
int64 UserId = 2 [(api.body) = "user_id",(api.vd)="$ != 0"];
int32 Role = 3 [(api.body) = "role",(api.vd)="$ != 0"];
}
message UpdateSpaceUserRoleResult {
message UpdateSpaceMemberRoleResult {
}
@@ -5,7 +5,8 @@ import { useCallback, useEffect, useState } from 'react'
import { Text, TouchableOpacity, View } from 'react-native'
import Animated, { useAnimatedRef } from 'react-native-reanimated'
import Sortable from 'react-native-sortables'
import { ADivider, ADrawer, LucideIcon } from '@/components/common/ao'
import { ADrawer, LucideIcon } from '@/components/common/ao'
import { Divider } from '@/components/ui/divider'
import { useNavStore } from '@/store/navigation'
export default function TabsLayout() {
@@ -92,9 +93,7 @@ export default function TabsLayout() {
<LucideIcon icon="Bot" size={24} clickable={false} strokeWidth={2} />
</TouchableOpacity>
<ADivider
direction="vertical"
/>
<Divider orientation="vertical" className="h-8" />
<TouchableOpacity
className="flex-1 items-center justify-center flex flex-row"
@@ -106,7 +105,7 @@ export default function TabsLayout() {
<Text className="font-semibold text-lg ml-2">{currentNav.label}</Text>
</TouchableOpacity>
<ADivider direction="vertical" />
<Divider orientation="vertical" className="h-8" />
<TouchableOpacity className="w-12 items-center justify-center" onPress={refreshPage}>
<LucideIcon icon="RefreshCcw" size={24} clickable={false} strokeWidth={2} />
@@ -5,7 +5,7 @@ import { Pressable, RefreshControl, SectionList, Text, Vibration, View } from 'r
import { LucideIcon } from '@/components/common/ao'
import EmptyState from '@/components/common/EmptyStatus'
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
import { Menu, MenuItem, MenuItemLabel } from '@/components/ui/menu'
import { Menu, MenuItem, MenuItemLabel, MenuSeparator } from '@/components/ui/menu'
import { useMoneyCategoryStore } from '@/store/moneyCategory'
import { useUserStore } from '@/store/user'
import { MoneyCategoryEnum } from '@/types/money/category'
@@ -125,6 +125,7 @@ export default function StaticTransactions({
shadowColor: '#000',
borderRadius: 4,
width: 160,
padding: 0,
}}
offset={0}
placement="bottom"
@@ -186,53 +187,69 @@ export default function StaticTransactions({
>
{
userID === item.user_id && (
<MenuItem
key="update"
textValue="update"
className="flex gap-2"
style={{
paddingVertical: 10,
minWidth: 150,
}}
onPress={() => {
onUpdate?.(item)
}}
>
<LucideIcon icon="Pencil" size={18} />
<MenuItemLabel>更新</MenuItemLabel>
</MenuItem>
<>
<MenuItem
key="update"
textValue="update"
className="flex gap-3"
style={{
minWidth: 150,
height: 42,
paddingTop: 0,
paddingBottom: 0,
alignItems: 'center',
borderRadius: 0,
}}
onPress={() => {
onUpdate?.(item)
}}
>
<LucideIcon icon="Pencil" size={18} />
<MenuItemLabel className="text-lg">更新</MenuItemLabel>
</MenuItem>
<MenuSeparator />
</>
)
}
<MenuItem
key="delete"
textValue="delete"
className="flex gap-2"
className="flex gap-3"
style={{
paddingVertical: 10,
minWidth: 150,
height: 42,
paddingTop: 0,
paddingBottom: 0,
alignItems: 'center',
borderRadius: 0,
}}
onPress={() => {
onDelete?.(item.id)
}}
>
<LucideIcon icon="Trash" size={18} />
<MenuItemLabel>删除</MenuItemLabel>
<MenuItemLabel className="text-lg">删除</MenuItemLabel>
</MenuItem>
<MenuSeparator />
<MenuItem
key="detail"
textValue="detail"
className="flex gap-2"
className="flex gap-3"
style={{
paddingVertical: 10,
minWidth: 150,
height: 42,
paddingTop: 0,
paddingBottom: 0,
alignItems: 'center',
borderRadius: 0,
}}
onPress={() => {
onDetail?.(item.id)
}}
>
<LucideIcon icon="ReceiptText" size={18} />
<MenuItemLabel>详细</MenuItemLabel>
<MenuItemLabel className="text-lg">详细</MenuItemLabel>
</MenuItem>
</Menu>
)
@@ -1,4 +1,4 @@
import type { SpaceUser } from '@/types/space/space'
import type { SpaceMember } from '@/types/space/space'
import * as Clipboard from 'expo-clipboard'
import { useState } from 'react'
import { FlatList, TouchableHighlight, TouchableOpacity, View } from 'react-native'
@@ -28,7 +28,7 @@ import { HStack } from '@/components/ui/hstack'
import { ChevronDownIcon, ChevronUpIcon } from '@/components/ui/icon'
import { Text } from '@/components/ui/text'
import { VStack } from '@/components/ui/vstack'
import { dissolveSpaceApi, exitSpaceApi, removeSpaceUserApi } from '@/request/api/space/space'
import { dissolveSpaceApi, exitSpaceApi, removeSpaceMemberApi } from '@/request/api/space/space'
import { useUserStore } from '@/store/user'
import { formatRelativeTime } from '@/utils/time'
import { toast } from '@/utils/toast'
@@ -42,7 +42,7 @@ interface ExitParams {
interface SpaceInviteProps {
userSpace: UserSpace | null
spaceUsers: SpaceUser[]
spaceUsers: SpaceMember[]
onExit?: (params: ExitParams) => void
}
@@ -92,7 +92,7 @@ export default function SpaceInvite({
return
}
// 移除
removeSpaceUserApi({
removeSpaceMemberApi({
space_id: userSpace.id,
user_id: modal.userId,
}).catch((err) => {
@@ -1,8 +1,8 @@
import type { SpaceUser } from '@/types/space/space'
import type { SpaceMember } from '@/types/space/space'
import { useEffect, useState } from 'react'
import { View } from 'react-native'
import CustomHeader from '@/components/custom/Header'
import { createSpaceApi, joinSpaceApi, listSpaceUsersApi } from '@/request/api/space/space'
import { createSpaceApi, joinSpaceApi, listSpaceMembersApi } from '@/request/api/space/space'
import { useSpaceStore } from '@/store/space'
import { useUserStore } from '@/store/user'
import JoinSpace from './components/JoinSpace'
@@ -16,15 +16,15 @@ export default function PagerWithTab() {
const [headerTitle, setHeaderTitle] = useState('我的空间')
const [step, setStep] = useState<'join' | 'invite' | 'home'>('home')
const [spaceUsers, setSpaceUsers] = useState<SpaceUser[]>([])
const [spaceUsers, setSpaceUsers] = useState<SpaceMember[]>([])
// 封装获取空间用户列表并直接更新状态
const fetchSpaceUsers = async (spaceId: number) => {
try {
const res = await listSpaceUsersApi({ space_id: spaceId })
const res = await listSpaceMembersApi({ space_id: spaceId })
if (res.isSuccess) {
setSpaceUsers(res.data.users)
console.log(res.data.users)
setSpaceUsers(res.data.members)
console.log(res.data.members)
}
else {
console.warn('获取空间用户失败')
@@ -7,12 +7,12 @@ import type {
ExitSpaceResult,
JoinSpaceParams,
JoinSpaceResult,
ListSpaceUsersParams,
ListSpaceUsersResult,
RemoveSpaceUserParams,
RemoveSpaceUserResult,
UpdateSpaceUserRoleParams,
UpdateSpaceUserRoleResult,
ListSpaceMembersParams,
ListSpaceMembersResult,
RemoveSpaceMemberParams,
RemoveSpaceMemberResult,
UpdateSpaceMemberRoleParams,
UpdateSpaceMemberRoleResult,
} from '@/types/space/space'
import alovaInstance from '../../index'
@@ -39,16 +39,16 @@ export function exitSpaceApi(params: ExitSpaceParams) {
}
// Remove Space User API
export function removeSpaceUserApi(params: RemoveSpaceUserParams) {
return alovaInstance.Post<ResponseData<RemoveSpaceUserResult>>(`${API_PREFIX}/remove`, params)
export function removeSpaceMemberApi(params: RemoveSpaceMemberParams) {
return alovaInstance.Post<ResponseData<RemoveSpaceMemberResult>>(`${API_PREFIX}/remove`, params)
}
// Update Role API
export function updateSpaceUserRoleApi(params: UpdateSpaceUserRoleParams) {
return alovaInstance.Post<ResponseData<UpdateSpaceUserRoleResult>>(`${API_PREFIX}/updateRole`, params)
export function updateSpaceMemberRoleApi(params: UpdateSpaceMemberRoleParams) {
return alovaInstance.Post<ResponseData<UpdateSpaceMemberRoleResult>>(`${API_PREFIX}/updateRole`, params)
}
// List Space Users API
export function listSpaceUsersApi(params: ListSpaceUsersParams) {
return alovaInstance.Post<ResponseData<ListSpaceUsersResult>>(`${API_PREFIX}/users`, params)
export function listSpaceMembersApi(params: ListSpaceMembersParams) {
return alovaInstance.Post<ResponseData<ListSpaceMembersResult>>(`${API_PREFIX}/members`, params)
}
+2 -2
View File
@@ -28,8 +28,8 @@ function isWhiteListed(url: string) {
}
const alovaInstance = createAlova({
// baseURL: 'http://192.168.5.6:8086/app',
baseURL: 'http://192.168.1.137:8086/app',
baseURL: 'http://192.168.5.6:8086/app',
// baseURL: 'http://192.168.1.137:8086/app',
requestAdapter: axiosRequestAdapter(),
timeout: 5000,
cacheFor: null,
@@ -31,25 +31,25 @@ export interface ExitSpaceResult {
}
// 踢出用户
export interface RemoveSpaceUserParams {
export interface RemoveSpaceMemberParams {
space_id: number
user_id: number
}
export interface RemoveSpaceUserResult {
export interface RemoveSpaceMemberResult {
}
// 更新用户权限
export interface UpdateSpaceUserRoleParams {
export interface UpdateSpaceMemberRoleParams {
space_id: number
user_id: number
role: number
}
export interface UpdateSpaceUserRoleResult {
export interface UpdateSpaceMemberRoleResult {
}
// 空间用户列表
export interface SpaceUser {
export interface SpaceMember {
id: number
username: string
avatar: string
@@ -57,10 +57,10 @@ export interface SpaceUser {
last_login_time: number
}
export interface ListSpaceUsersParams {
export interface ListSpaceMembersParams {
space_id: number
}
export interface ListSpaceUsersResult {
users: SpaceUser[]
export interface ListSpaceMembersResult {
members: SpaceMember[]
}