mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 20:53:49 +08:00
1、泛型化参数,预留泛型约束,方便以后代码扩展的类型安全校验
2、升级goframe至v2.7.3
This commit is contained in:
@@ -29,7 +29,7 @@ func init() {
|
||||
func (s *sSysIndex) Test(ctx context.Context, in *sysin.IndexTestInp) (res *sysin.IndexTestModel, err error) {
|
||||
res = new(sysin.IndexTestModel)
|
||||
res.Name = in.Name
|
||||
res.Module = fmt.Sprintf("当前插件模块是:%s,当前应用模块是:%s", global.GetSkeleton().Name, contexts.Get(ctx).Module)
|
||||
res.Module = fmt.Sprintf("当前插件模块是:%s,当前应用模块是:%s", global.GetSkeleton().Name, contexts.Get[any](ctx).Module)
|
||||
res.Time = gtime.Now()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ func (s *sSysTable) Export(ctx context.Context, in *sysin.TableListInp) (err err
|
||||
return
|
||||
}
|
||||
|
||||
if err = excel.ExportByStructs(ctx, tags, exports, fileName, sheetName); err != nil {
|
||||
if err = excel.ExportByStructs[any](ctx, tags, exports, fileName, sheetName); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
@@ -143,7 +143,7 @@ func (s *sSysTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error
|
||||
|
||||
// 修改
|
||||
if in.Id > 0 {
|
||||
in.UpdatedBy = contexts.GetUserId(ctx)
|
||||
in.UpdatedBy = contexts.GetUserId[any](ctx)
|
||||
if _, err = s.Model(ctx).WherePri(in.Id).Data(in).Update(); err != nil {
|
||||
err = gerror.Wrap(err, "修改表格失败,请稍后重试!")
|
||||
return
|
||||
@@ -152,7 +152,7 @@ func (s *sSysTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error
|
||||
}
|
||||
|
||||
// 新增
|
||||
in.CreatedBy = contexts.GetUserId(ctx)
|
||||
in.CreatedBy = contexts.GetUserId[any](ctx)
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil {
|
||||
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||
return
|
||||
@@ -173,7 +173,7 @@ func (s *sSysTable) Delete(ctx context.Context, in *sysin.TableDeleteInp) (err e
|
||||
func (s *sSysTable) Status(ctx context.Context, in *sysin.TableStatusInp) (err error) {
|
||||
update := g.Map{
|
||||
dao.AddonHgexampleTable.Columns().Status: in.Status,
|
||||
dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId(ctx),
|
||||
dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId[any](ctx),
|
||||
}
|
||||
|
||||
if _, err = s.Model(ctx).WherePri(in.Id).Data(update).Update(); err != nil {
|
||||
@@ -197,7 +197,7 @@ func (s *sSysTable) Switch(ctx context.Context, in *sysin.TableSwitchInp) (err e
|
||||
|
||||
update := g.Map{
|
||||
in.Key: in.Value,
|
||||
dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId(ctx),
|
||||
dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId[any](ctx),
|
||||
}
|
||||
|
||||
if _, err = s.Model(ctx).Where(dao.AddonHgexampleTable.Columns().Id, in.Id).Data(update).Update(); err != nil {
|
||||
|
||||
@@ -126,7 +126,7 @@ func (s *sSysTenantOrder) Export(ctx context.Context, in *sysin.TenantOrderListI
|
||||
return
|
||||
}
|
||||
|
||||
err = excel.ExportByStructs(ctx, tags, exports, fileName, sheetName)
|
||||
err = excel.ExportByStructs[any](ctx, tags, exports, fileName, sheetName)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -118,13 +118,13 @@ func (s *sSysTreeTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err e
|
||||
}
|
||||
|
||||
if in.Id > 0 {
|
||||
in.UpdatedBy = contexts.GetUserId(ctx)
|
||||
in.UpdatedBy = contexts.GetUserId[any](ctx)
|
||||
if _, err = s.Model(ctx).WherePri(in.Id).Data(in).Update(); err != nil {
|
||||
err = gerror.Wrap(err, "修改表格失败,请稍后重试!")
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
in.CreatedBy = contexts.GetUserId(ctx)
|
||||
in.CreatedBy = contexts.GetUserId[any](ctx)
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil {
|
||||
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user