feat: 初次启动

This commit is contained in:
Blizzard
2026-04-27 21:23:13 +08:00
parent e515f6a287
commit bb8ad4d515
148 changed files with 8602 additions and 5678 deletions
@@ -1,13 +1,11 @@
// Code scaffolded by goctl. Safe to edit.
package dict
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/logx"
"sundynix-micro-go/app/system/api/internal/svc"
"sundynix-micro-go/app/system/api/internal/types"
sysModel "sundynix-micro-go/app/system/model"
"sundynix-micro-go/app/system/rpc/system"
)
type CreateDictLogic struct {
@@ -21,9 +19,8 @@ func NewCreateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
}
func (l *CreateDictLogic) CreateDict(req *types.DictReq) error {
dict := sysModel.SundynixDict{Type: req.Type, Label: req.Label, Value: req.Value, Sort: req.Sort, Desc: req.Desc}
if err := l.svcCtx.DB.Create(&dict).Error; err != nil {
return fmt.Errorf("创建字典失败")
}
return nil
_, err := l.svcCtx.SystemRpc.CreateDict(l.ctx, &system.DictReq{
Type: req.Type, Label: req.Label, Value: req.Value, Sort: int32(req.Sort), Desc: req.Desc,
})
return err
}