mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-09 18:53:46 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -7,12 +7,8 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/addons"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -23,27 +19,20 @@ type cAddons struct{}
|
||||
|
||||
// List 查看列表
|
||||
func (c *cAddons) List(ctx context.Context, req *addons.ListReq) (res *addons.ListRes, err error) {
|
||||
var in sysin.AddonsListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysAddons().List(ctx, in)
|
||||
list, totalCount, err := service.SysAddons().List(ctx, &req.AddonsListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(addons.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Selects 获取指定信息
|
||||
func (c *cAddons) Selects(ctx context.Context, req *addons.SelectsReq) (res *addons.SelectsRes, err error) {
|
||||
data, err := service.SysAddons().Selects(ctx, sysin.AddonsSelectsInp{})
|
||||
data, err := service.SysAddons().Selects(ctx, &req.AddonsSelectsInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -55,27 +44,13 @@ func (c *cAddons) Selects(ctx context.Context, req *addons.SelectsReq) (res *add
|
||||
|
||||
// Build 生成预览
|
||||
func (c *cAddons) Build(ctx context.Context, req *addons.BuildReq) (res *addons.BuildRes, err error) {
|
||||
var in sysin.AddonsBuildInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysAddons().Build(ctx, in)
|
||||
err = service.SysAddons().Build(ctx, &req.AddonsBuildInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Install 安装模块
|
||||
func (c *cAddons) Install(ctx context.Context, req *addons.InstallReq) (res *addons.InstallRes, err error) {
|
||||
var in sysin.AddonsInstallInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = service.SysAddons().Install(ctx, in); err != nil {
|
||||
if err = service.SysAddons().Install(ctx, &req.AddonsInstallInp); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
@@ -83,12 +58,7 @@ func (c *cAddons) Install(ctx context.Context, req *addons.InstallReq) (res *add
|
||||
|
||||
// Upgrade 更新模块
|
||||
func (c *cAddons) Upgrade(ctx context.Context, req *addons.UpgradeReq) (res *addons.UpgradeRes, err error) {
|
||||
var in sysin.AddonsUpgradeInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = service.SysAddons().Upgrade(ctx, in); err != nil {
|
||||
if err = service.SysAddons().Upgrade(ctx, &req.AddonsUpgradeInp); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
@@ -96,12 +66,7 @@ func (c *cAddons) Upgrade(ctx context.Context, req *addons.UpgradeReq) (res *add
|
||||
|
||||
// UnInstall 卸载模块
|
||||
func (c *cAddons) UnInstall(ctx context.Context, req *addons.UnInstallReq) (res *addons.UnInstallRes, err error) {
|
||||
var in sysin.AddonsUnInstallInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = service.SysAddons().UnInstall(ctx, in); err != nil {
|
||||
if err = service.SysAddons().UnInstall(ctx, &req.AddonsUnInstallInp); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
|
||||
@@ -7,9 +7,8 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/attachment"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/library/storager"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
@@ -22,18 +21,13 @@ type cAttachment struct{}
|
||||
|
||||
// Delete 删除附件
|
||||
func (c *cAttachment) Delete(ctx context.Context, req *attachment.DeleteReq) (res *attachment.DeleteRes, err error) {
|
||||
var in sysin.AttachmentDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysAttachment().Delete(ctx, in)
|
||||
err = service.SysAttachment().Delete(ctx, &req.AttachmentDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定附件信息
|
||||
func (c *cAttachment) View(ctx context.Context, req *attachment.ViewReq) (res *attachment.ViewRes, err error) {
|
||||
data, err := service.SysAttachment().View(ctx, sysin.AttachmentViewInp{Id: req.Id})
|
||||
data, err := service.SysAttachment().View(ctx, &req.AttachmentViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -45,20 +39,55 @@ func (c *cAttachment) View(ctx context.Context, req *attachment.ViewReq) (res *a
|
||||
|
||||
// List 查看附件列表
|
||||
func (c *cAttachment) List(ctx context.Context, req *attachment.ListReq) (res *attachment.ListRes, err error) {
|
||||
var in sysin.AttachmentListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysAttachment().List(ctx, in)
|
||||
list, totalCount, err := service.SysAttachment().List(ctx, &req.AttachmentListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(attachment.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// ChooserOption 获取选择器选项
|
||||
func (c *cAttachment) ChooserOption(ctx context.Context, req *attachment.ChooserOptionReq) (res *attachment.ChooserOptionRes, err error) {
|
||||
res = new(attachment.ChooserOptionRes)
|
||||
|
||||
res.Drive, err = service.SysDictData().Select(ctx, &sysin.DataSelectInp{Type: "config_upload_drive"})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var kinds = []attachment.KindSelect{
|
||||
{
|
||||
Label: "全部", Key: "", Value: "",
|
||||
},
|
||||
{
|
||||
Label: "图片", Key: storager.KindImg, Value: storager.KindImg, Icon: "PictureOutlined", Tag: "success",
|
||||
},
|
||||
{
|
||||
Label: "文档", Key: storager.KindDoc, Value: storager.KindDoc, Icon: "FileWordOutlined", Tag: "primary",
|
||||
},
|
||||
{
|
||||
Label: "音频", Key: storager.KindAudio, Value: storager.KindAudio, Icon: "CustomerServiceOutlined", Tag: "info",
|
||||
},
|
||||
{
|
||||
Label: "视频", Key: storager.KindVideo, Value: storager.KindVideo, Icon: "PlaySquareOutlined", Tag: "warning",
|
||||
},
|
||||
{
|
||||
Label: "压缩包", Key: storager.KindZip, Value: storager.KindZip, Icon: "FileZipOutlined", Tag: "error",
|
||||
},
|
||||
{
|
||||
Label: "其他", Key: storager.KindOther, Value: storager.KindOther, Icon: "PlusOutlined", Tag: "default",
|
||||
},
|
||||
}
|
||||
res.Kind = append(res.Kind, kinds...)
|
||||
return
|
||||
}
|
||||
|
||||
// ClearKind 清空上传类型
|
||||
func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) {
|
||||
err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/blacklist"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -23,41 +19,19 @@ type cBlacklist struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cBlacklist) Delete(ctx context.Context, req *blacklist.DeleteReq) (res *blacklist.DeleteRes, err error) {
|
||||
var in sysin.BlacklistDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysBlacklist().Delete(ctx, in)
|
||||
err = service.SysBlacklist().Delete(ctx, &req.BlacklistDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cBlacklist) Edit(ctx context.Context, req *blacklist.EditReq) (res *blacklist.EditRes, err error) {
|
||||
var in sysin.BlacklistEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysBlacklist().Edit(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cBlacklist) MaxSort(ctx context.Context, req *blacklist.MaxSortReq) (res *blacklist.MaxSortRes, err error) {
|
||||
data, err := service.SysBlacklist().MaxSort(ctx, sysin.BlacklistMaxSortInp{Id: req.Id})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(blacklist.MaxSortRes)
|
||||
res.Sort = data.Sort
|
||||
err = service.SysBlacklist().Edit(ctx, &req.BlacklistEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cBlacklist) View(ctx context.Context, req *blacklist.ViewReq) (res *blacklist.ViewRes, err error) {
|
||||
data, err := service.SysBlacklist().View(ctx, sysin.BlacklistViewInp{Id: req.Id})
|
||||
data, err := service.SysBlacklist().View(ctx, &req.BlacklistViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -69,31 +43,19 @@ func (c *cBlacklist) View(ctx context.Context, req *blacklist.ViewReq) (res *bla
|
||||
|
||||
// List 查看列表
|
||||
func (c *cBlacklist) List(ctx context.Context, req *blacklist.ListReq) (res *blacklist.ListRes, err error) {
|
||||
var in sysin.BlacklistListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysBlacklist().List(ctx, in)
|
||||
list, totalCount, err := service.SysBlacklist().List(ctx, &req.BlacklistListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(blacklist.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
// Status 更新黑名单状态
|
||||
func (c *cBlacklist) Status(ctx context.Context, req *blacklist.StatusReq) (res *blacklist.StatusRes, err error) {
|
||||
var in sysin.BlacklistStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysBlacklist().Status(ctx, in)
|
||||
err = service.SysBlacklist().Status(ctx, &req.BlacklistStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/config"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/input/form"
|
||||
@@ -23,24 +22,14 @@ type cConfig struct{}
|
||||
|
||||
// GetConfig 获取指定分组的配置
|
||||
func (c *cConfig) GetConfig(ctx context.Context, req *config.GetReq) (res *config.GetRes, err error) {
|
||||
var in sysin.GetConfigInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(config.GetRes)
|
||||
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, in)
|
||||
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &req.GetConfigInp)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateConfig 更新指定分组的配置
|
||||
func (c *cConfig) UpdateConfig(ctx context.Context, req *config.UpdateReq) (res *config.UpdateRes, err error) {
|
||||
var in sysin.UpdateConfigInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysConfig().UpdateConfigByGroup(ctx, in)
|
||||
err = service.SysConfig().UpdateConfigByGroup(ctx, &req.UpdateConfigInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -56,9 +45,9 @@ func (c *cConfig) TypeSelect(_ context.Context, _ *config.TypeSelectReq) (res co
|
||||
return
|
||||
}
|
||||
|
||||
// GetCash 获取指定分组的配置
|
||||
// GetCash 获取提现的配置
|
||||
func (c *cConfig) GetCash(ctx context.Context, _ *config.GetCashReq) (res *config.GetCashRes, err error) {
|
||||
res = new(config.GetCashRes)
|
||||
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, sysin.GetConfigInp{Group: "cash"})
|
||||
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &sysin.GetConfigInp{Group: "cash"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ package sys
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/cron"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/msgin"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/api/servmsg"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -24,29 +21,19 @@ type cCron struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cCron) Delete(ctx context.Context, req *cron.DeleteReq) (res *cron.DeleteRes, err error) {
|
||||
var in = new(msgin.CronDelete)
|
||||
if err = gconv.Scan(req, &in.CronDeleteInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.TCPServer().CronDelete(ctx, in)
|
||||
err = service.TCPServer().CronDelete(ctx, &servmsg.CronDeleteReq{CronDeleteInp: &req.CronDeleteInp})
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cCron) Edit(ctx context.Context, req *cron.EditReq) (res *cron.EditRes, err error) {
|
||||
var in = new(msgin.CronEdit)
|
||||
if err = gconv.Scan(req, &in.CronEditInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.TCPServer().CronEdit(ctx, in)
|
||||
err = service.TCPServer().CronEdit(ctx, &servmsg.CronEditReq{CronEditInp: &req.CronEditInp})
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cCron) MaxSort(ctx context.Context, req *cron.MaxSortReq) (res *cron.MaxSortRes, err error) {
|
||||
data, err := service.SysCron().MaxSort(ctx, sysin.CronMaxSortInp{Id: req.Id})
|
||||
data, err := service.SysCron().MaxSort(ctx, &req.CronMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -58,7 +45,7 @@ func (c *cCron) MaxSort(ctx context.Context, req *cron.MaxSortReq) (res *cron.Ma
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cCron) View(ctx context.Context, req *cron.ViewReq) (res *cron.ViewRes, err error) {
|
||||
data, err := service.SysCron().View(ctx, sysin.CronViewInp{Id: req.Id})
|
||||
data, err := service.SysCron().View(ctx, &req.CronViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -70,32 +57,20 @@ func (c *cCron) View(ctx context.Context, req *cron.ViewReq) (res *cron.ViewRes,
|
||||
|
||||
// List 查看列表
|
||||
func (c *cCron) List(ctx context.Context, req *cron.ListReq) (res *cron.ListRes, err error) {
|
||||
var in sysin.CronListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysCron().List(ctx, in)
|
||||
list, totalCount, err := service.SysCron().List(ctx, &req.CronListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(cron.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
func (c *cCron) Status(ctx context.Context, req *cron.StatusReq) (res *cron.StatusRes, err error) {
|
||||
var in sysin.CronStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCron().Status(ctx, in)
|
||||
err = service.SysCron().Status(ctx, &req.CronStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -105,11 +80,6 @@ func (c *cCron) OnlineExec(ctx context.Context, req *cron.OnlineExecReq) (res *c
|
||||
return nil, gerror.New("定时任务ID不能为空")
|
||||
}
|
||||
|
||||
var in = new(msgin.CronOnlineExec)
|
||||
if err = gconv.Scan(req, &in.OnlineExecInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.TCPServer().CronOnlineExec(ctx, in)
|
||||
err = service.TCPServer().CronOnlineExec(ctx, &servmsg.CronOnlineExecReq{OnlineExecInp: &req.OnlineExecInp})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,12 +7,8 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/cron"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -23,33 +19,19 @@ type cCronGroup struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cCronGroup) Delete(ctx context.Context, req *cron.GroupDeleteReq) (res *cron.GroupDeleteRes, err error) {
|
||||
var in sysin.CronGroupDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCronGroup().Delete(ctx, in)
|
||||
err = service.SysCronGroup().Delete(ctx, &req.CronGroupDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cCronGroup) Edit(ctx context.Context, req *cron.GroupEditReq) (res *cron.GroupEditRes, err error) {
|
||||
var in sysin.CronGroupEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCronGroup().Edit(ctx, in)
|
||||
err = service.SysCronGroup().Edit(ctx, &req.CronGroupEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cCronGroup) MaxSort(ctx context.Context, req *cron.GroupMaxSortReq) (res *cron.GroupMaxSortRes, err error) {
|
||||
data, err := service.SysCronGroup().MaxSort(ctx, sysin.CronGroupMaxSortInp{Id: req.Id})
|
||||
data, err := service.SysCronGroup().MaxSort(ctx, &req.CronGroupMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -61,7 +43,7 @@ func (c *cCronGroup) MaxSort(ctx context.Context, req *cron.GroupMaxSortReq) (re
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cCronGroup) View(ctx context.Context, req *cron.GroupViewReq) (res *cron.GroupViewRes, err error) {
|
||||
data, err := service.SysCronGroup().View(ctx, sysin.CronGroupViewInp{Id: req.Id})
|
||||
data, err := service.SysCronGroup().View(ctx, &req.CronGroupViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -73,42 +55,26 @@ func (c *cCronGroup) View(ctx context.Context, req *cron.GroupViewReq) (res *cro
|
||||
|
||||
// List 查看列表
|
||||
func (c *cCronGroup) List(ctx context.Context, req *cron.GroupListReq) (res *cron.GroupListRes, err error) {
|
||||
var in sysin.CronGroupListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysCronGroup().List(ctx, in)
|
||||
list, totalCount, err := service.SysCronGroup().List(ctx, &req.CronGroupListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(cron.GroupListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新状态
|
||||
func (c *cCronGroup) Status(ctx context.Context, req *cron.GroupStatusReq) (res *cron.GroupStatusRes, err error) {
|
||||
var in sysin.CronGroupStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCronGroup().Status(ctx, in)
|
||||
err = service.SysCronGroup().Status(ctx, &req.CronGroupStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Select 选项
|
||||
func (c *cCronGroup) Select(ctx context.Context, _ *cron.GroupSelectReq) (res *cron.GroupSelectRes, err error) {
|
||||
data, err := service.SysCronGroup().Select(ctx, sysin.CronGroupSelectInp{})
|
||||
func (c *cCronGroup) Select(ctx context.Context, req *cron.GroupSelectReq) (res *cron.GroupSelectRes, err error) {
|
||||
data, err := service.SysCronGroup().Select(ctx, &req.CronGroupSelectInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,18 +3,13 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.7.3
|
||||
// @AutoGenerate Version 2.7.6
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/curddemo"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -25,61 +20,32 @@ type cCurdDemo struct{}
|
||||
|
||||
// List 查看生成演示列表
|
||||
func (c *cCurdDemo) List(ctx context.Context, req *curddemo.ListReq) (res *curddemo.ListRes, err error) {
|
||||
var in sysin.CurdDemoListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysCurdDemo().List(ctx, in)
|
||||
list, totalCount, err := service.SysCurdDemo().List(ctx, &req.CurdDemoListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(curddemo.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出生成演示列表
|
||||
func (c *cCurdDemo) Export(ctx context.Context, req *curddemo.ExportReq) (res *curddemo.ExportRes, err error) {
|
||||
var in sysin.CurdDemoListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCurdDemo().Export(ctx, in)
|
||||
err = service.SysCurdDemo().Export(ctx, &req.CurdDemoListInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新生成演示
|
||||
func (c *cCurdDemo) Edit(ctx context.Context, req *curddemo.EditReq) (res *curddemo.EditRes, err error) {
|
||||
var in sysin.CurdDemoEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCurdDemo().Edit(ctx, in)
|
||||
err = service.SysCurdDemo().Edit(ctx, &req.CurdDemoEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 获取生成演示最大排序
|
||||
func (c *cCurdDemo) MaxSort(ctx context.Context, req *curddemo.MaxSortReq) (res *curddemo.MaxSortRes, err error) {
|
||||
data, err := service.SysCurdDemo().MaxSort(ctx, sysin.CurdDemoMaxSortInp{})
|
||||
data, err := service.SysCurdDemo().MaxSort(ctx, &req.CurdDemoMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -91,16 +57,7 @@ func (c *cCurdDemo) MaxSort(ctx context.Context, req *curddemo.MaxSortReq) (res
|
||||
|
||||
// View 获取指定生成演示信息
|
||||
func (c *cCurdDemo) View(ctx context.Context, req *curddemo.ViewReq) (res *curddemo.ViewRes, err error) {
|
||||
var in sysin.CurdDemoViewInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysCurdDemo().View(ctx, in)
|
||||
data, err := service.SysCurdDemo().View(ctx, &req.CurdDemoViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -112,45 +69,18 @@ func (c *cCurdDemo) View(ctx context.Context, req *curddemo.ViewReq) (res *curdd
|
||||
|
||||
// Delete 删除生成演示
|
||||
func (c *cCurdDemo) Delete(ctx context.Context, req *curddemo.DeleteReq) (res *curddemo.DeleteRes, err error) {
|
||||
var in sysin.CurdDemoDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCurdDemo().Delete(ctx, in)
|
||||
err = service.SysCurdDemo().Delete(ctx, &req.CurdDemoDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新生成演示状态
|
||||
func (c *cCurdDemo) Status(ctx context.Context, req *curddemo.StatusReq) (res *curddemo.StatusRes, err error) {
|
||||
var in sysin.CurdDemoStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCurdDemo().Status(ctx, in)
|
||||
err = service.SysCurdDemo().Status(ctx, &req.CurdDemoStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Switch 更新生成演示开关状态
|
||||
func (c *cCurdDemo) Switch(ctx context.Context, req *curddemo.SwitchReq) (res *curddemo.SwitchRes, err error) {
|
||||
var in sysin.CurdDemoSwitchInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCurdDemo().Switch(ctx, in)
|
||||
err = service.SysCurdDemo().Switch(ctx, &req.CurdDemoSwitchInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,12 +7,9 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/dict"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -23,58 +20,32 @@ type cDictData struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cDictData) Delete(ctx context.Context, req *dict.DataDeleteReq) (res *dict.DataDeleteRes, err error) {
|
||||
var in sysin.DictDataDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysDictData().Delete(ctx, in)
|
||||
err = service.SysDictData().Delete(ctx, &req.DictDataDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cDictData) Edit(ctx context.Context, req *dict.DataEditReq) (res *dict.DataEditRes, err error) {
|
||||
var in sysin.DictDataEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysDictData().Edit(ctx, in)
|
||||
err = service.SysDictData().Edit(ctx, &req.DictDataEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// List 查看列表
|
||||
func (c *cDictData) List(ctx context.Context, req *dict.DataListReq) (res *dict.DataListRes, err error) {
|
||||
var in sysin.DictDataListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysDictData().List(ctx, in)
|
||||
list, totalCount, err := service.SysDictData().List(ctx, &req.DictDataListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(dict.DataListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Select 指定选项
|
||||
func (c *cDictData) Select(ctx context.Context, req *dict.DataSelectReq) (res dict.DataSelectRes, err error) {
|
||||
var in sysin.DataSelectInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, err := service.SysDictData().Select(ctx, in)
|
||||
list, err := service.SysDictData().Select(ctx, &req.DataSelectInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -87,7 +58,7 @@ func (c *cDictData) Select(ctx context.Context, req *dict.DataSelectReq) (res di
|
||||
func (c *cDictData) Selects(ctx context.Context, req *dict.DataSelectsReq) (res dict.DataSelectsRes, err error) {
|
||||
res = make(dict.DataSelectsRes)
|
||||
for _, v := range req.Types {
|
||||
option, err := service.SysDictData().Select(ctx, sysin.DataSelectInp{Type: v})
|
||||
option, err := service.SysDictData().Select(ctx, &sysin.DataSelectInp{Type: v})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -7,11 +7,8 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/dict"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -29,26 +26,12 @@ func (c *cDictType) Tree(ctx context.Context, _ *dict.TypeTreeReq) (res *dict.Ty
|
||||
|
||||
// Delete 删除
|
||||
func (c *cDictType) Delete(ctx context.Context, req *dict.TypeDeleteReq) (res *dict.TypeDeleteRes, err error) {
|
||||
var in sysin.DictTypeDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysDictType().Delete(ctx, in)
|
||||
err = service.SysDictType().Delete(ctx, &req.DictTypeDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cDictType) Edit(ctx context.Context, req *dict.TypeEditReq) (res *dict.TypeEditRes, err error) {
|
||||
var in sysin.DictTypeEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysDictType().Edit(ctx, in)
|
||||
err = service.SysDictType().Edit(ctx, &req.DictTypeEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/emslog"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -23,29 +19,19 @@ type cEmsLog struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cEmsLog) Delete(ctx context.Context, req *emslog.DeleteReq) (res *emslog.DeleteRes, err error) {
|
||||
var in sysin.EmsLogDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysEmsLog().Delete(ctx, in)
|
||||
err = service.SysEmsLog().Delete(ctx, &req.EmsLogDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cEmsLog) Edit(ctx context.Context, req *emslog.EditReq) (res *emslog.EditRes, err error) {
|
||||
var in sysin.EmsLogEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysEmsLog().Edit(ctx, in)
|
||||
err = service.SysEmsLog().Edit(ctx, &req.EmsLogEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cEmsLog) View(ctx context.Context, req *emslog.ViewReq) (res *emslog.ViewRes, err error) {
|
||||
data, err := service.SysEmsLog().View(ctx, sysin.EmsLogViewInp{Id: req.Id})
|
||||
data, err := service.SysEmsLog().View(ctx, &req.EmsLogViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -57,31 +43,19 @@ func (c *cEmsLog) View(ctx context.Context, req *emslog.ViewReq) (res *emslog.Vi
|
||||
|
||||
// List 查看列表
|
||||
func (c *cEmsLog) List(ctx context.Context, req *emslog.ListReq) (res *emslog.ListRes, err error) {
|
||||
var in sysin.EmsLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysEmsLog().List(ctx, in)
|
||||
list, totalCount, err := service.SysEmsLog().List(ctx, &req.EmsLogListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(emslog.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
// Status 更新状态
|
||||
func (c *cEmsLog) Status(ctx context.Context, req *emslog.StatusReq) (res *emslog.StatusRes, err error) {
|
||||
var in sysin.EmsLogStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysEmsLog().Status(ctx, in)
|
||||
err = service.SysEmsLog().Status(ctx, &req.EmsLogStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,17 +3,12 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/gencodes"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -24,27 +19,13 @@ type cGenCodes struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cGenCodes) Delete(ctx context.Context, req *gencodes.DeleteReq) (res *gencodes.DeleteRes, err error) {
|
||||
var in sysin.GenCodesDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysGenCodes().Delete(ctx, in)
|
||||
err = service.SysGenCodes().Delete(ctx, &req.GenCodesDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cGenCodes) Edit(ctx context.Context, req *gencodes.EditReq) (res *gencodes.EditRes, err error) {
|
||||
var in sysin.GenCodesEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysGenCodes().Edit(ctx, in)
|
||||
data, err := service.SysGenCodes().Edit(ctx, &req.GenCodesEditInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -56,7 +37,7 @@ func (c *cGenCodes) Edit(ctx context.Context, req *gencodes.EditReq) (res *genco
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cGenCodes) MaxSort(ctx context.Context, req *gencodes.MaxSortReq) (res *gencodes.MaxSortRes, err error) {
|
||||
data, err := service.SysGenCodes().MaxSort(ctx, sysin.GenCodesMaxSortInp{Id: req.Id})
|
||||
data, err := service.SysGenCodes().MaxSort(ctx, &req.GenCodesMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -68,7 +49,7 @@ func (c *cGenCodes) MaxSort(ctx context.Context, req *gencodes.MaxSortReq) (res
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cGenCodes) View(ctx context.Context, req *gencodes.ViewReq) (res *gencodes.ViewRes, err error) {
|
||||
data, err := service.SysGenCodes().View(ctx, sysin.GenCodesViewInp{Id: req.Id})
|
||||
data, err := service.SysGenCodes().View(ctx, &req.GenCodesViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -80,38 +61,26 @@ func (c *cGenCodes) View(ctx context.Context, req *gencodes.ViewReq) (res *genco
|
||||
|
||||
// List 查看列表
|
||||
func (c *cGenCodes) List(ctx context.Context, req *gencodes.ListReq) (res *gencodes.ListRes, err error) {
|
||||
var in sysin.GenCodesListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysGenCodes().List(ctx, in)
|
||||
list, totalCount, err := service.SysGenCodes().List(ctx, &req.GenCodesListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(gencodes.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
// Status 更新状态
|
||||
func (c *cGenCodes) Status(ctx context.Context, req *gencodes.StatusReq) (res *gencodes.StatusRes, err error) {
|
||||
var in sysin.GenCodesStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysGenCodes().Status(ctx, in)
|
||||
err = service.SysGenCodes().Status(ctx, &req.GenCodesStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Selects 获取指定信息
|
||||
func (c *cGenCodes) Selects(ctx context.Context, req *gencodes.SelectsReq) (res *gencodes.SelectsRes, err error) {
|
||||
data, err := service.SysGenCodes().Selects(ctx, sysin.GenCodesSelectsInp{})
|
||||
data, err := service.SysGenCodes().Selects(ctx, &req.GenCodesSelectsInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -123,7 +92,7 @@ func (c *cGenCodes) Selects(ctx context.Context, req *gencodes.SelectsReq) (res
|
||||
|
||||
// TableSelect 数据库表选项
|
||||
func (c *cGenCodes) TableSelect(ctx context.Context, req *gencodes.TableSelectReq) (res *gencodes.TableSelectRes, err error) {
|
||||
data, err := service.SysGenCodes().TableSelect(ctx, sysin.GenCodesTableSelectInp{Name: req.Name})
|
||||
data, err := service.SysGenCodes().TableSelect(ctx, &req.GenCodesTableSelectInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -134,7 +103,7 @@ func (c *cGenCodes) TableSelect(ctx context.Context, req *gencodes.TableSelectRe
|
||||
|
||||
// ColumnSelect 表字段选项
|
||||
func (c *cGenCodes) ColumnSelect(ctx context.Context, req *gencodes.ColumnSelectReq) (res *gencodes.ColumnSelectRes, err error) {
|
||||
data, err := service.SysGenCodes().ColumnSelect(ctx, sysin.GenCodesColumnSelectInp{Name: req.Name, Table: req.Table})
|
||||
data, err := service.SysGenCodes().ColumnSelect(ctx, &req.GenCodesColumnSelectInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -145,12 +114,7 @@ func (c *cGenCodes) ColumnSelect(ctx context.Context, req *gencodes.ColumnSelect
|
||||
|
||||
// ColumnList 表字段列表
|
||||
func (c *cGenCodes) ColumnList(ctx context.Context, req *gencodes.ColumnListReq) (res *gencodes.ColumnListRes, err error) {
|
||||
var in sysin.GenCodesColumnListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysGenCodes().ColumnList(ctx, in)
|
||||
data, err := service.SysGenCodes().ColumnList(ctx, &req.GenCodesColumnListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -161,16 +125,7 @@ func (c *cGenCodes) ColumnList(ctx context.Context, req *gencodes.ColumnListReq)
|
||||
|
||||
// Preview 生成预览
|
||||
func (c *cGenCodes) Preview(ctx context.Context, req *gencodes.PreviewReq) (res *gencodes.PreviewRes, err error) {
|
||||
var in sysin.GenCodesPreviewInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysGenCodes().Preview(ctx, in)
|
||||
data, err := service.SysGenCodes().Preview(ctx, &req.GenCodesPreviewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -182,15 +137,6 @@ func (c *cGenCodes) Preview(ctx context.Context, req *gencodes.PreviewReq) (res
|
||||
|
||||
// Build 生成预览
|
||||
func (c *cGenCodes) Build(ctx context.Context, req *gencodes.BuildReq) (res *gencodes.BuildRes, err error) {
|
||||
var in sysin.GenCodesBuildInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysGenCodes().Build(ctx, in)
|
||||
err = service.SysGenCodes().Build(ctx, &req.GenCodesBuildInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -8,10 +8,7 @@ package sys
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/log"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -28,54 +25,32 @@ func (c *sLog) Clear(ctx context.Context, _ *log.ClearReq) (res *log.ClearRes, e
|
||||
|
||||
// Export 导出
|
||||
func (c *sLog) Export(ctx context.Context, req *log.ExportReq) (res *log.ExportRes, err error) {
|
||||
var in sysin.LogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysLog().Export(ctx, in)
|
||||
err = service.SysLog().Export(ctx, &req.LogListInp)
|
||||
return
|
||||
}
|
||||
|
||||
// List 获取访问日志列表
|
||||
func (c *sLog) List(ctx context.Context, req *log.ListReq) (res *log.ListRes, err error) {
|
||||
var in sysin.LogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysLog().List(ctx, in)
|
||||
list, totalCount, err := service.SysLog().List(ctx, &req.LogListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(log.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *sLog) View(ctx context.Context, req *log.ViewReq) (res *log.ViewRes, err error) {
|
||||
data, err := service.SysLog().View(ctx, sysin.LogViewInp{Id: req.Id})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(log.ViewRes)
|
||||
res.LogViewModel = data
|
||||
res.LogViewModel, err = service.SysLog().View(ctx, &req.LogViewInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除
|
||||
func (c *sLog) Delete(ctx context.Context, req *log.DeleteReq) (res *log.DeleteRes, err error) {
|
||||
var in sysin.LogDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysLog().Delete(ctx, in)
|
||||
err = service.SysLog().Delete(ctx, &req.LogDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,17 +5,12 @@
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.1.1
|
||||
// @AutoGenerate Date 2023-01-19 16:57:33
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/loginlog"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,55 +21,26 @@ type cLoginLog struct{}
|
||||
|
||||
// List 查看登录日志列表
|
||||
func (c *cLoginLog) List(ctx context.Context, req *loginlog.ListReq) (res *loginlog.ListRes, err error) {
|
||||
var in sysin.LoginLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysLoginLog().List(ctx, in)
|
||||
list, totalCount, err := service.SysLoginLog().List(ctx, &req.LoginLogListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(loginlog.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出登录日志列表
|
||||
func (c *cLoginLog) Export(ctx context.Context, req *loginlog.ExportReq) (res *loginlog.ExportRes, err error) {
|
||||
var in sysin.LoginLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysLoginLog().Export(ctx, in)
|
||||
err = service.SysLoginLog().Export(ctx, &req.LoginLogListInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定登录日志信息
|
||||
func (c *cLoginLog) View(ctx context.Context, req *loginlog.ViewReq) (res *loginlog.ViewRes, err error) {
|
||||
var in sysin.LoginLogViewInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysLoginLog().View(ctx, in)
|
||||
data, err := service.SysLoginLog().View(ctx, &req.LoginLogViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -86,15 +52,6 @@ func (c *cLoginLog) View(ctx context.Context, req *loginlog.ViewReq) (res *login
|
||||
|
||||
// Delete 删除登录日志
|
||||
func (c *cLoginLog) Delete(ctx context.Context, req *loginlog.DeleteReq) (res *loginlog.DeleteRes, err error) {
|
||||
var in sysin.LoginLogDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysLoginLog().Delete(ctx, in)
|
||||
err = service.SysLoginLog().Delete(ctx, &req.LoginLogDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,13 +7,9 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/provinces"
|
||||
"hotgo/internal/library/location"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -31,33 +27,19 @@ func (c *cProvinces) Tree(ctx context.Context, _ *provinces.TreeReq) (res *provi
|
||||
|
||||
// Delete 删除
|
||||
func (c *cProvinces) Delete(ctx context.Context, req *provinces.DeleteReq) (res *provinces.DeleteRes, err error) {
|
||||
var in sysin.ProvincesDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysProvinces().Delete(ctx, in)
|
||||
err = service.SysProvinces().Delete(ctx, &req.ProvincesDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cProvinces) Edit(ctx context.Context, req *provinces.EditReq) (res *provinces.EditRes, err error) {
|
||||
var in sysin.ProvincesEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysProvinces().Edit(ctx, in)
|
||||
err = service.SysProvinces().Edit(ctx, &req.ProvincesEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cProvinces) MaxSort(ctx context.Context, req *provinces.MaxSortReq) (res *provinces.MaxSortRes, err error) {
|
||||
data, err := service.SysProvinces().MaxSort(ctx, sysin.ProvincesMaxSortInp{})
|
||||
data, err := service.SysProvinces().MaxSort(ctx, &req.ProvincesMaxSortInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -69,7 +51,7 @@ func (c *cProvinces) MaxSort(ctx context.Context, req *provinces.MaxSortReq) (re
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cProvinces) View(ctx context.Context, req *provinces.ViewReq) (res *provinces.ViewRes, err error) {
|
||||
data, err := service.SysProvinces().View(ctx, sysin.ProvincesViewInp{Id: req.Id})
|
||||
data, err := service.SysProvinces().View(ctx, &req.ProvincesViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -81,67 +63,39 @@ func (c *cProvinces) View(ctx context.Context, req *provinces.ViewReq) (res *pro
|
||||
|
||||
// List 查看列表
|
||||
func (c *cProvinces) List(ctx context.Context, req *provinces.ListReq) (res *provinces.ListRes, err error) {
|
||||
var in sysin.ProvincesListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysProvinces().List(ctx, in)
|
||||
list, totalCount, err := service.SysProvinces().List(ctx, &req.ProvincesListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(provinces.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
// Status 更新省市区状态
|
||||
func (c *cProvinces) Status(ctx context.Context, req *provinces.StatusReq) (res *provinces.StatusRes, err error) {
|
||||
var in sysin.ProvincesStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysProvinces().Status(ctx, in)
|
||||
err = service.SysProvinces().Status(ctx, &req.ProvincesStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// ChildrenList 获取省市区下级列表
|
||||
func (c *cProvinces) ChildrenList(ctx context.Context, req *provinces.ChildrenListReq) (res *provinces.ChildrenListRes, err error) {
|
||||
var in sysin.ProvincesChildrenListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysProvinces().ChildrenList(ctx, in)
|
||||
list, totalCount, err := service.SysProvinces().ChildrenList(ctx, &req.ProvincesChildrenListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(provinces.ChildrenListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// UniqueId 地区ID是否唯一
|
||||
func (c *cProvinces) UniqueId(ctx context.Context, req *provinces.UniqueIdReq) (res *provinces.UniqueIdRes, err error) {
|
||||
var in sysin.ProvincesUniqueIdInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysProvinces().UniqueId(ctx, in)
|
||||
data, err := service.SysProvinces().UniqueId(ctx, &req.ProvincesUniqueIdInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -153,12 +107,7 @@ func (c *cProvinces) UniqueId(ctx context.Context, req *provinces.UniqueIdReq) (
|
||||
|
||||
// Select 省市区选项
|
||||
func (c *cProvinces) Select(ctx context.Context, req *provinces.SelectReq) (res *provinces.SelectRes, err error) {
|
||||
var in sysin.ProvincesSelectInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysProvinces().Select(ctx, in)
|
||||
data, err := service.SysProvinces().Select(ctx, &req.ProvincesSelectInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
74
server/internal/controller/admin/sys/serve_license.go
Normal file
74
server/internal/controller/admin/sys/serve_license.go
Normal file
@@ -0,0 +1,74 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.7.6
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/servelicense"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ServeLicense = cServeLicense{}
|
||||
)
|
||||
|
||||
type cServeLicense struct{}
|
||||
|
||||
// List 查看服务授权许可列表
|
||||
func (c *cServeLicense) List(ctx context.Context, req *servelicense.ListReq) (res *servelicense.ListRes, err error) {
|
||||
list, totalCount, err := service.SysServeLicense().List(ctx, &req.ServeLicenseListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(servelicense.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出服务授权许可列表
|
||||
func (c *cServeLicense) Export(ctx context.Context, req *servelicense.ExportReq) (res *servelicense.ExportRes, err error) {
|
||||
err = service.SysServeLicense().Export(ctx, &req.ServeLicenseListInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新服务授权许可
|
||||
func (c *cServeLicense) Edit(ctx context.Context, req *servelicense.EditReq) (res *servelicense.EditRes, err error) {
|
||||
err = service.SysServeLicense().Edit(ctx, &req.ServeLicenseEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定服务授权许可信息
|
||||
func (c *cServeLicense) View(ctx context.Context, req *servelicense.ViewReq) (res *servelicense.ViewRes, err error) {
|
||||
data, err := service.SysServeLicense().View(ctx, &req.ServeLicenseViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(servelicense.ViewRes)
|
||||
res.ServeLicenseViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除服务授权许可
|
||||
func (c *cServeLicense) Delete(ctx context.Context, req *servelicense.DeleteReq) (res *servelicense.DeleteRes, err error) {
|
||||
err = service.SysServeLicense().Delete(ctx, &req.ServeLicenseDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新服务授权许可状态
|
||||
func (c *cServeLicense) Status(ctx context.Context, req *servelicense.StatusReq) (res *servelicense.StatusRes, err error) {
|
||||
err = service.SysServeLicense().Status(ctx, &req.ServeLicenseStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// AssignRouter 分配服务授权许可路由
|
||||
func (c *cServeLicense) AssignRouter(ctx context.Context, req *servelicense.AssignRouterReq) (res *servelicense.AssignRouterRes, err error) {
|
||||
err = service.SysServeLicense().AssignRouter(ctx, &req.ServeLicenseAssignRouterInp)
|
||||
return
|
||||
}
|
||||
@@ -3,17 +3,12 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/servelog"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -24,55 +19,26 @@ type cServeLog struct{}
|
||||
|
||||
// List 查看服务日志列表
|
||||
func (c *cServeLog) List(ctx context.Context, req *servelog.ListReq) (res *servelog.ListRes, err error) {
|
||||
var in sysin.ServeLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysServeLog().List(ctx, in)
|
||||
list, totalCount, err := service.SysServeLog().List(ctx, &req.ServeLogListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(servelog.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出服务日志列表
|
||||
func (c *cServeLog) Export(ctx context.Context, req *servelog.ExportReq) (res *servelog.ExportRes, err error) {
|
||||
var in sysin.ServeLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysServeLog().Export(ctx, in)
|
||||
err = service.SysServeLog().Export(ctx, &req.ServeLogListInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定服务日志信息
|
||||
func (c *cServeLog) View(ctx context.Context, req *servelog.ViewReq) (res *servelog.ViewRes, err error) {
|
||||
var in sysin.ServeLogViewInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.SysServeLog().View(ctx, in)
|
||||
data, err := service.SysServeLog().View(ctx, &req.ServeLogViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -84,15 +50,6 @@ func (c *cServeLog) View(ctx context.Context, req *servelog.ViewReq) (res *serve
|
||||
|
||||
// Delete 删除服务日志
|
||||
func (c *cServeLog) Delete(ctx context.Context, req *servelog.DeleteReq) (res *servelog.DeleteRes, err error) {
|
||||
var in sysin.ServeLogDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysServeLog().Delete(ctx, in)
|
||||
err = service.SysServeLog().Delete(ctx, &req.ServeLogDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,12 +7,8 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/smslog"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -23,41 +19,19 @@ type cSmsLog struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cSmsLog) Delete(ctx context.Context, req *smslog.DeleteReq) (res *smslog.DeleteRes, err error) {
|
||||
var in sysin.SmsLogDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysSmsLog().Delete(ctx, in)
|
||||
err = service.SysSmsLog().Delete(ctx, &req.SmsLogDeleteInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cSmsLog) Edit(ctx context.Context, req *smslog.EditReq) (res *smslog.EditRes, err error) {
|
||||
var in sysin.SmsLogEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysSmsLog().Edit(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cSmsLog) MaxSort(ctx context.Context, req *smslog.MaxSortReq) (res *smslog.MaxSortRes, err error) {
|
||||
data, err := service.SysSmsLog().MaxSort(ctx, sysin.SmsLogMaxSortInp{Id: req.Id})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(smslog.MaxSortRes)
|
||||
res.Sort = data.Sort
|
||||
err = service.SysSmsLog().Edit(ctx, &req.SmsLogEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cSmsLog) View(ctx context.Context, req *smslog.ViewReq) (res *smslog.ViewRes, err error) {
|
||||
data, err := service.SysSmsLog().View(ctx, sysin.SmsLogViewInp{Id: req.Id})
|
||||
data, err := service.SysSmsLog().View(ctx, &req.SmsLogViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -69,35 +43,19 @@ func (c *cSmsLog) View(ctx context.Context, req *smslog.ViewReq) (res *smslog.Vi
|
||||
|
||||
// List 查看列表
|
||||
func (c *cSmsLog) List(ctx context.Context, req *smslog.ListReq) (res *smslog.ListRes, err error) {
|
||||
var in sysin.SmsLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.SysSmsLog().List(ctx, in)
|
||||
list, totalCount, err := service.SysSmsLog().List(ctx, &req.SmsLogListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(smslog.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新部门状态
|
||||
// Status 更新状态
|
||||
func (c *cSmsLog) Status(ctx context.Context, req *smslog.StatusReq) (res *smslog.StatusRes, err error) {
|
||||
var in sysin.SmsLogStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysSmsLog().Status(ctx, in)
|
||||
err = service.SysSmsLog().Status(ctx, &req.SmsLogStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user