mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-09 02:33:43 +08:00
This commit is contained in:
74
server/internal/controller/admin/admin/cash.go
Normal file
74
server/internal/controller/admin/admin/cash.go
Normal file
@@ -0,0 +1,74 @@
|
||||
// Package admin
|
||||
// @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
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/cash"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
Cash = cCash{}
|
||||
)
|
||||
|
||||
type cCash struct{}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cCash) View(ctx context.Context, req *cash.ViewReq) (*cash.ViewRes, error) {
|
||||
data, err := service.AdminCash().View(ctx, adminin.CashViewInp{Id: req.Id})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var res cash.ViewRes
|
||||
res.CashViewModel = data
|
||||
return &res, nil
|
||||
}
|
||||
|
||||
// List 查看列表
|
||||
func (c *cCash) List(ctx context.Context, req *cash.ListReq) (res *cash.ListRes, err error) {
|
||||
var in adminin.CashListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list, totalCount, err := service.AdminCash().List(ctx, in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res = new(cash.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Apply 申请提现
|
||||
func (c *cCash) Apply(ctx context.Context, req *cash.ApplyReq) (res *cash.ApplyRes, err error) {
|
||||
err = service.AdminCash().Apply(ctx, adminin.CashApplyInp{
|
||||
Money: req.Money,
|
||||
MemberId: contexts.GetUserId(ctx),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Payment 提现打款处理
|
||||
func (c *cCash) Payment(ctx context.Context, req *cash.PaymentReq) (res *cash.PaymentRes, err error) {
|
||||
err = service.AdminCash().Payment(ctx, adminin.CashPaymentInp{
|
||||
Id: req.Id,
|
||||
Status: req.Status,
|
||||
Msg: req.Msg,
|
||||
})
|
||||
return
|
||||
}
|
||||
74
server/internal/controller/admin/admin/credits_log.go
Normal file
74
server/internal/controller/admin/admin/credits_log.go
Normal file
@@ -0,0 +1,74 @@
|
||||
// Package admin
|
||||
// @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.5.3
|
||||
// @AutoGenerate Date 2023-04-15 15:59:58
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/creditslog"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
CreditsLog = cCreditsLog{}
|
||||
)
|
||||
|
||||
type cCreditsLog struct{}
|
||||
|
||||
// List 查看资产变动列表
|
||||
func (c *cCreditsLog) List(ctx context.Context, req *creditslog.ListReq) (res *creditslog.ListRes, err error) {
|
||||
var in adminin.CreditsLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.AdminCreditsLog().List(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(creditslog.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出资产变动列表
|
||||
func (c *cCreditsLog) Export(ctx context.Context, req *creditslog.ExportReq) (res *creditslog.ExportRes, err error) {
|
||||
var in adminin.CreditsLogListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminCreditsLog().Export(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Option 获取变动状态选项
|
||||
func (c *cCreditsLog) Option(ctx context.Context, req *creditslog.OptionReq) (res *creditslog.OptionRes, err error) {
|
||||
res = &creditslog.OptionRes{
|
||||
CreditType: consts.CreditTypeOptions,
|
||||
CreditGroup: consts.CreditGroupOptions,
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package admin
|
||||
|
||||
import (
|
||||
@@ -11,6 +10,7 @@ import (
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/dept"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -105,3 +105,23 @@ func (c *cDept) Status(ctx context.Context, req *dept.StatusReq) (res *dept.Stat
|
||||
err = service.AdminDept().Status(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Option 获取部门选项树
|
||||
func (c *cDept) Option(ctx context.Context, req *dept.OptionReq) (res *dept.OptionRes, err error) {
|
||||
var in adminin.DeptOptionInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.AdminDept().Option(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(dept.OptionRes)
|
||||
res.DeptOptionModel = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package admin
|
||||
|
||||
import (
|
||||
@@ -175,19 +174,6 @@ func (c *cMember) Edit(ctx context.Context, req *member.EditReq) (res *member.Ed
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cMember) MaxSort(ctx context.Context, req *member.MaxSortReq) (res *member.MaxSortRes, err error) {
|
||||
var in = adminin.MemberMaxSortInp{Id: req.Id}
|
||||
data, err := service.AdminMember().MaxSort(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(member.MaxSortRes)
|
||||
res.Sort = data.Sort
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定信息
|
||||
func (c *cMember) View(ctx context.Context, req *member.ViewReq) (res *member.ViewRes, err error) {
|
||||
data, err := service.AdminMember().View(ctx, adminin.MemberViewInp{Id: req.Id})
|
||||
@@ -253,3 +239,33 @@ func (c *cMember) Select(ctx context.Context, req *member.SelectReq) (res *membe
|
||||
res = (*member.SelectRes)(&data)
|
||||
return
|
||||
}
|
||||
|
||||
// AddBalance 增加余额
|
||||
func (c *cMember) AddBalance(ctx context.Context, req *member.AddBalanceReq) (res *member.AddBalanceRes, err error) {
|
||||
var in adminin.MemberAddBalanceInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminMember().AddBalance(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// AddIntegral 增加积分
|
||||
func (c *cMember) AddIntegral(ctx context.Context, req *member.AddIntegralReq) (res *member.AddIntegralRes, err error) {
|
||||
var in adminin.MemberAddIntegralInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminMember().AddIntegral(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/menu"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -21,30 +18,6 @@ var (
|
||||
|
||||
type cMenu struct{}
|
||||
|
||||
// RoleList 查询角色菜单列表
|
||||
func (c *cMenu) RoleList(ctx context.Context, req *menu.RoleListReq) (res *menu.RoleListRes, err error) {
|
||||
var in adminin.MenuRoleListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.AdminMenu().RoleList(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(menu.RoleListRes)
|
||||
res.CheckedKeys = data.CheckedKeys
|
||||
res.Menus = data.Menus
|
||||
return
|
||||
}
|
||||
|
||||
// SearchList 查询菜单列表
|
||||
func (c *cMenu) SearchList(ctx context.Context, req *menu.SearchListReq) (res *menu.SearchListRes, err error) {
|
||||
res, err = service.AdminMenu().SearchList(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cMenu) MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error) {
|
||||
res, err = service.AdminMenu().MaxSort(ctx, req)
|
||||
|
||||
190
server/internal/controller/admin/admin/order.go
Normal file
190
server/internal/controller/admin/admin/order.go
Normal file
@@ -0,0 +1,190 @@
|
||||
// Package admin
|
||||
// @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
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/order"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
Order = cOrder{}
|
||||
)
|
||||
|
||||
type cOrder struct{}
|
||||
|
||||
// AcceptRefund 受理申请退款
|
||||
func (c *cOrder) AcceptRefund(ctx context.Context, req *order.AcceptRefundReq) (res *order.AcceptRefundRes, err error) {
|
||||
var in adminin.OrderAcceptRefundInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().AcceptRefund(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// ApplyRefund 申请退款
|
||||
func (c *cOrder) ApplyRefund(ctx context.Context, req *order.ApplyRefundReq) (res *order.ApplyRefundRes, err error) {
|
||||
var in adminin.OrderApplyRefundInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().ApplyRefund(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Option 获取订单状态选项
|
||||
func (c *cOrder) Option(ctx context.Context, req *order.OptionReq) (res *order.OptionRes, err error) {
|
||||
res = &order.OptionRes{
|
||||
Status: consts.OrderStatusOptions,
|
||||
AcceptRefundStatus: consts.OrderAcceptRefundOptions,
|
||||
PayType: consts.PayTypeOptions,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Create 创建充值订单
|
||||
func (c *cOrder) Create(ctx context.Context, req *order.CreateReq) (res *order.CreateRes, err error) {
|
||||
var in adminin.OrderCreateInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.AdminOrder().Create(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(order.CreateRes)
|
||||
res.OrderCreateModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// List 查看充值订单列表
|
||||
func (c *cOrder) List(ctx context.Context, req *order.ListReq) (res *order.ListRes, err error) {
|
||||
var in adminin.OrderListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.AdminOrder().List(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(order.ListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出充值订单列表
|
||||
func (c *cOrder) Export(ctx context.Context, req *order.ExportReq) (res *order.ExportRes, err error) {
|
||||
var in adminin.OrderListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().Export(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新充值订单
|
||||
func (c *cOrder) Edit(ctx context.Context, req *order.EditReq) (res *order.EditRes, err error) {
|
||||
var in adminin.OrderEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().Edit(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定充值订单信息
|
||||
func (c *cOrder) View(ctx context.Context, req *order.ViewReq) (res *order.ViewRes, err error) {
|
||||
var in adminin.OrderViewInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := service.AdminOrder().View(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(order.ViewRes)
|
||||
res.OrderViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除充值订单
|
||||
func (c *cOrder) Delete(ctx context.Context, req *order.DeleteReq) (res *order.DeleteRes, err error) {
|
||||
var in adminin.OrderDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().Delete(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新充值订单状态
|
||||
func (c *cOrder) Status(ctx context.Context, req *order.StatusReq) (res *order.StatusRes, err error) {
|
||||
var in adminin.OrderStatusInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminOrder().Status(ctx, in)
|
||||
return
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package admin
|
||||
|
||||
import (
|
||||
|
||||
49
server/internal/controller/admin/common/wechat.go
Normal file
49
server/internal/controller/admin/common/wechat.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Package common
|
||||
// @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
|
||||
package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/common"
|
||||
"hotgo/internal/model/input/commonin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
Wechat = cWechat{}
|
||||
)
|
||||
|
||||
type cWechat struct{}
|
||||
|
||||
func (c *cWechat) Authorize(ctx context.Context, req *common.WechatAuthorizeReq) (res *common.WechatAuthorizeRes, err error) {
|
||||
var in commonin.WechatAuthorizeInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = service.CommonWechat().Authorize(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cWechat) AuthorizeCall(ctx context.Context, req *common.WechatAuthorizeCallReq) (res *common.WechatAuthorizeCallRes, err error) {
|
||||
var in commonin.WechatAuthorizeCallInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = service.CommonWechat().AuthorizeCall(ctx, in)
|
||||
return
|
||||
}
|
||||
64
server/internal/controller/admin/pay/refund.go
Normal file
64
server/internal/controller/admin/pay/refund.go
Normal file
@@ -0,0 +1,64 @@
|
||||
// Package pay
|
||||
// @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.5.3
|
||||
// @AutoGenerate Date 2023-04-15 15:59:58
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/pay"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
Refund = cRefund{}
|
||||
)
|
||||
|
||||
type cRefund struct{}
|
||||
|
||||
// List 查看交易退款列表
|
||||
func (c *cRefund) List(ctx context.Context, req *pay.RefundListReq) (res *pay.RefundListRes, err error) {
|
||||
var in payin.PayRefundListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, totalCount, err := service.PayRefund().List(ctx, in)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(pay.RefundListRes)
|
||||
res.List = list
|
||||
res.PageCount = form.CalPageCount(totalCount, req.PerPage)
|
||||
res.Page = req.Page
|
||||
res.PerPage = req.PerPage
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出交易退款列表
|
||||
func (c *cRefund) Export(ctx context.Context, req *pay.RefundExportReq) (res *pay.RefundExportRes, err error) {
|
||||
var in payin.PayRefundListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.PayRefund().Export(ctx, in)
|
||||
return
|
||||
}
|
||||
@@ -56,3 +56,10 @@ func (c *cConfig) TypeSelect(ctx context.Context, req *config.TypeSelectReq) (re
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetCash 获取指定分组的配置
|
||||
func (c *cConfig) GetCash(ctx context.Context, req *config.GetCashReq) (res *config.GetCashRes, err error) {
|
||||
res = new(config.GetCashRes)
|
||||
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, sysin.GetConfigInp{Group: "cash"})
|
||||
return
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sys
|
||||
|
||||
import (
|
||||
@@ -12,6 +11,7 @@ import (
|
||||
"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/internal/service"
|
||||
)
|
||||
@@ -24,23 +24,23 @@ type cCron struct{}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cCron) Delete(ctx context.Context, req *cron.DeleteReq) (res *cron.DeleteRes, err error) {
|
||||
var in sysin.CronDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
var in = new(msgin.CronDelete)
|
||||
if err = gconv.Scan(req, &in.CronDeleteInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCron().Delete(ctx, in)
|
||||
err = service.TCPServer().CronDelete(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cCron) Edit(ctx context.Context, req *cron.EditReq) (res *cron.EditRes, err error) {
|
||||
var in sysin.CronEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
var in = new(msgin.CronEdit)
|
||||
if err = gconv.Scan(req, &in.CronEditInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.SysCron().Edit(ctx, in)
|
||||
err = service.TCPServer().CronEdit(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -105,10 +105,11 @@ func (c *cCron) OnlineExec(ctx context.Context, req *cron.OnlineExecReq) (res *c
|
||||
return nil, gerror.New("定时任务ID不能为空")
|
||||
}
|
||||
|
||||
var in sysin.OnlineExecInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
var in = new(msgin.CronOnlineExec)
|
||||
if err = gconv.Scan(req, &in.OnlineExecInp); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return res, service.SysCron().OnlineExec(ctx, in)
|
||||
err = service.TCPServer().CronOnlineExec(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.1.4
|
||||
// @AutoGenerate Date 2023-02-20 16:41:58
|
||||
//
|
||||
// @AutoGenerate Version 2.5.3
|
||||
// @AutoGenerate Date 2023-04-28 15:28:40
|
||||
package sys
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user