feat: rbac迁移完成,并已部署至dev服务器

This commit is contained in:
Blizzard
2026-05-01 01:19:50 +08:00
parent f80a3dc064
commit 8b11068fef
250 changed files with 6314 additions and 13072 deletions
@@ -0,0 +1,44 @@
package logic
import (
"context"
sysModel "sundynix-micro-go/app/system/model"
"sundynix-micro-go/app/system/rpc/internal/svc"
"sundynix-micro-go/app/system/rpc/system"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateUserLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUpdateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserLogic {
return &UpdateUserLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)}
}
func (l *UpdateUserLogic) UpdateUser(in *system.UpdateUserReq) (*system.CommonResp, error) {
updates := map[string]interface{}{}
if in.Name != "" {
updates["name"] = in.Name
}
if in.Account != "" {
updates["account"] = in.Account
}
if in.Phone != "" {
updates["phone"] = in.Phone
}
if in.AvatarId != "" {
updates["avatar_id"] = in.AvatarId
}
if in.NickName != "" {
updates["nick_name"] = in.NickName
}
if err := l.svcCtx.DB.Model(&sysModel.SundynixUser{}).Where("id = ?", in.Id).Updates(updates).Error; err != nil {
return nil, err
}
return &system.CommonResp{Code: 200, Msg: "success"}, nil
}