build 🥇初始化构建

This commit is contained in:
孙晓龙
2024-07-05 17:12:34 +08:00
parent e76b67752c
commit af71511c35
130 changed files with 328 additions and 2696 deletions

View File

@@ -27,8 +27,7 @@ type CardInfoCreateReq struct {
AppleAccountRecord
}
type CardInfoCreateRes struct {
}
type CardInfoCreateRes struct{}
type CardInfoUpdateReq struct {
g.Meta `path:"/cardInfo/AppleCard/account/update" tags:"苹果礼品卡账户" method:"put" summary:"修改苹果账户"`
@@ -45,8 +44,7 @@ type CardInfoDeleteReq struct {
commonApi.CommonStrId
}
type CardInfoDeleteRes struct {
}
type CardInfoDeleteRes struct{}
type CardInfoDownloadTemplateReq struct {
g.Meta `path:"/cardInfo/AppleCard/account/downloadTemplate" tags:"苹果礼品卡账户" method:"get" summary:"下载导入模板"`

View File

@@ -80,8 +80,7 @@ type RechargeItunesCallbackReq struct {
Remark string `json:"remark" description:"备注"`
}
type RechargeItunesCallbackRes struct {
}
type RechargeItunesCallbackRes struct{}
// CallBackOrderManualReq 这个是回调订单给别人
type CallBackOrderManualReq struct {
@@ -90,8 +89,7 @@ type CallBackOrderManualReq struct {
ID int64 `json:"id" description:"充值ID"`
}
type CallBackOrderManualRes struct {
}
type CallBackOrderManualRes struct{}
type RechargeOrderModifyActualAmountReq struct {
g.Meta `path:"/cardInfo/appleCard/rechargeOrder/modifyActualAmount" tags:"轮询处理礼品卡" method:"post" summary:"手动处理金额" deprecated:"true"`
@@ -99,16 +97,14 @@ type RechargeOrderModifyActualAmountReq struct {
ActualAmount float64 `json:"actualAmount" v:"required#金额不能为空" description:"金额"`
}
type RechargeOrderModifyActualAmountRes struct {
}
type RechargeOrderModifyActualAmountRes struct{}
type RechargeDuplicatedCardPassReq struct {
g.Meta `path:"/cardInfo/appleCard/rechargeOrder/setOrderSucceed" tags:"轮询处理礼品卡" method:"post" summary:"手动处理订单"`
OrderNo string `json:"orderNo" v:"required#订单ID不能为空" description:"订单ID"`
}
type RechargeDuplicatedCardPassRes struct {
}
type RechargeDuplicatedCardPassRes struct{}
// RechargeListDownloadReq 礼品卡订单记录
type RechargeListDownloadReq struct {

View File

@@ -7,8 +7,7 @@ type EntranceParamsReq struct {
Name string `json:"name" description:"通道名称"`
}
type EntranceWithID struct {
}
type EntranceWithID struct{}
type Entrance struct {
Name string `json:"name" description:"通道名称"`

View File

@@ -12,6 +12,7 @@ import (
type ISysUserV1 interface {
UserLoginOut(ctx context.Context, req *v1.UserLoginOutReq) (res *v1.UserLoginOutRes, err error)
UserMenusGet(ctx context.Context, req *v1.UserMenusGetReq) (res *v1.UserMenusGetRes, err error)
UserSearch(ctx context.Context, req *v1.UserSearchReq) (res *v1.UserSearchRes, err error)
UserGetParams(ctx context.Context, req *v1.UserGetParamsReq) (res *v1.UserGetParamsRes, err error)
UserAdd(ctx context.Context, req *v1.UserAddReq) (res *v1.UserAddRes, err error)

View File

@@ -30,7 +30,6 @@ type SysUserPostInfoRes struct {
type SysUserSimpleRes struct {
Id uint64 `orm:"id" json:"id"` //
Avatar string `orm:"avatar" json:"avatar"` // 头像
Sex int `orm:"sex" json:"sex"` // 性别
UserName string `orm:"user_name" json:"userName"` // 用户名
UserNickname string `orm:"user_nickname" json:"userNickname"` // 用户昵称

View File

@@ -72,8 +72,7 @@ type UserEditReq struct {
Password string `p:"password" v:"required#密码不能为空"`
}
type UserEditRes struct {
}
type UserEditRes struct{}
type UserGetEditReq struct {
g.Meta `path:"/user/getEdit" tags:"用户管理" method:"get" summary:"获取用户信息"`
@@ -94,8 +93,7 @@ type UserChangePwdReq struct {
NewPassword string `p:"newPassword" v:"required#新密码不能为空"`
}
type UserChangePwdRes struct {
}
type UserChangePwdRes struct{}
// UserStatusReq 设置用户状态参数
type UserStatusReq struct {
@@ -104,16 +102,14 @@ type UserStatusReq struct {
UserStatus uint `p:"status" v:"required#用户状态不能为空"`
}
type UserStatusRes struct {
}
type UserStatusRes struct{}
type UserDeleteReq struct {
g.Meta `path:"/user/delete" tags:"用户管理" method:"delete" summary:"删除用户"`
commonApi.CommonStrId
}
type UserDeleteRes struct {
}
type UserDeleteRes struct{}
type UserGetByIdsReq struct {
g.Meta `path:"/user/getUsers" tags:"用户管理" method:"get" summary:"同时获取多个用户"`

View File

@@ -12,13 +12,13 @@ type SysAuthRuleInfoRes struct {
Weigh int `orm:"weigh" json:"weigh"` // 权重
IsHide uint `orm:"is_hide" json:"isHide"` // 显示状态
IsCached uint `orm:"is_cached" json:"isCached"` // 是否缓存
IsAffix uint `orm:"is_affix" json:"isAffix"` //是否固定
IsAffix uint `orm:"is_affix" json:"isAffix"` // 是否固定
Path string `orm:"path" json:"path"` // 路由地址
Redirect string `orm:"redirect" json:"redirect"` // 跳转路由
Component string `orm:"component" json:"component"` // 组件路径
IsIframe uint `orm:"is_iframe" json:"isIframe"` // 是否iframe
IsLink uint `orm:"is_link" json:"isLink"` // 是否外链 1是 0否
LinkUrl string `orm:"link_url" json:"linkUrl"` //链接地址
LinkUrl string `orm:"link_url" json:"linkUrl"` // 链接地址
}
// SysAuthRuleTreeRes 菜单树形结构

View File

@@ -14,8 +14,7 @@ type RuleSearchReq struct {
Component string `p:"component"`
}
type RuleSearchRes struct {
}
type RuleSearchRes struct{}
type RuleListRes struct {
g.Meta `mime:"application/json"`
@@ -45,8 +44,7 @@ type RuleAddReq struct {
LinkUrl string `p:"linkUrl"`
}
type RuleAddRes struct {
}
type RuleAddRes struct{}
type RuleGetParamsReq struct {
g.Meta `path:"/menu/getParams" tags:"菜单管理" method:"get" summary:"获取添加、编辑菜单相关参数"`
@@ -95,8 +93,7 @@ type RuleUpdateReq struct {
LinkUrl string `p:"linkUrl"`
}
type RuleUpdateRes struct {
}
type RuleUpdateRes struct{}
type RuleDeleteReq struct {
g.Meta `path:"/menu/delete" tags:"菜单管理" method:"delete" summary:"删除菜单"`
@@ -104,5 +101,4 @@ type RuleDeleteReq struct {
Ids []int `p:"ids" v:"required#菜单id必须"`
}
type RuleDeleteRes struct {
}
type RuleDeleteRes struct{}

View File

@@ -10,8 +10,8 @@ import (
type RoleListReq struct {
g.Meta `path:"/role/list" tags:"角色管理" method:"get" summary:"角色列表"`
RoleName string `p:"roleName"` //参数名称
Status string `p:"roleStatus"` //状态
RoleName string `p:"roleName"` // 参数名称
Status string `p:"roleStatus"` // 状态
commonApi.CommonPageReq
}
@@ -38,8 +38,7 @@ type RoleAddReq struct {
MenuIds []uint `p:"menuIds"`
}
type RoleAddRes struct {
}
type RoleAddRes struct{}
type RoleGetReq struct {
g.Meta `path:"/role/get" tags:"角色管理" method:"get" summary:"获取角色信息"`
@@ -62,13 +61,11 @@ type RoleEditReq struct {
MenuIds []uint `p:"menuIds"`
}
type RoleEditRes struct {
}
type RoleEditRes struct{}
type RoleDeleteReq struct {
g.Meta `path:"/role/delete" tags:"角色管理" method:"delete" summary:"删除角色"`
Ids []int64 `p:"ids" v:"required#角色id不能为空"`
}
type RoleDeleteRes struct {
}
type RoleDeleteRes struct{}

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ package cmd
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gcmd"
@@ -47,7 +48,7 @@ var Main = gcmd.Command{
group.Bind(apple_card_info.NewV1())
})
//注册轮询任务
// 注册轮询任务
cron.RegisterCron(ctx)
s.Run()

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
v1 "kami/api/apple_card_info/v1"
"kami/internal/consts"
"kami/internal/err_handler"

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
v1 "kami/api/apple_card_info/v1"
"kami/internal/err_handler"
"kami/internal/model"

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
v1 "kami/api/apple_card_info/v1"
"kami/internal/err_handler"
"kami/internal/model"
@@ -17,7 +18,7 @@ func (c *ControllerV1) CardInfoCreate(ctx context.Context, req *v1.CardInfoCreat
err = err_handler.WrapError(ctx, gcode.CodeDbOperationError, err, "获取账号失败")
return
}
//判断是否重复
// 判断是否重复
if dataEntity.Id != "" {
err = err_handler.WrapError(ctx, err_handler.ErrAppleAccountRepeat, err, "")
return

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
v1 "kami/api/apple_card_info/v1"
"kami/api/commonApi"
"kami/internal/model"

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
"kami/internal/consts"
v1 "kami/api/apple_card_info/v1"

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
"kami/internal/consts"
"kami/internal/err_handler"
"kami/internal/model"
@@ -27,7 +28,7 @@ func (c *ControllerV1) RechargeDuplicatedCardPass(ctx context.Context, req *v1.R
return nil, err_handler.WrapError(ctx, gcode.CodeNotFound, nil, "金额异议订单不存在")
}
_ = orderService.UpdateActualAmount(ctx, data.OrderNo, previousOrder.ActualAmount, consts.AppleRechargeOrderSuccess, "金额异议订单二次回调")
//添加一条记录
// 添加一条记录
_ = orderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: data.AccountId,
OrderNo: data.OrderNo,

View File

@@ -3,6 +3,7 @@ package apple_card_info
import (
"context"
"fmt"
v1 "kami/api/apple_card_info/v1"
"kami/internal/consts"
"kami/internal/err_handler"
@@ -27,9 +28,9 @@ func (c *ControllerV1) RechargeHandler(ctx context.Context, req *v1.RechargeHand
res = &v1.RechargeHandlerRes{}
return
}
//获取符合条件的用户
accountInfo, err := appleAccountService.GetAccordingAccount(ctx)
if err != nil || accountInfo.Id == "" {
// 获取符合条件的用户
accountInfo, err := appleAccountService.GetAccordingAccount(ctx, req.MachineID)
if err != nil || accountInfo == nil || accountInfo.Id == "" {
err = err_handler.WrapError(ctx, gcode.CodeNotFound, err, "获取账户失败")
return
}
@@ -38,7 +39,7 @@ func (c *ControllerV1) RechargeHandler(ctx context.Context, req *v1.RechargeHand
err = err_handler.WrapError(ctx, gcode.CodeInternalError, err, "分配账户失败")
return
}
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.ModifyOrderStatus(ctx, orderNoEntity.OrderNo, consts.AppleRechargeOrderProcessing, "", nil)
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: accountInfo.Id,
@@ -49,7 +50,7 @@ func (c *ControllerV1) RechargeHandler(ctx context.Context, req *v1.RechargeHand
Remark: fmt.Sprintf("分配账户:%s", accountInfo.Account),
}, nil)
//1分半分钟以后执行
// 1分半分钟以后执行
_, _ = gcron.AddOnce(ctx, "@every 90s", func(ctx context.Context) {
glog.Info(ctx, fmt.Sprintf("执行定时任务,订单号:%s", orderNoEntity.OrderNo))
rechargeOrderSchema, err2 := rechargeOrderService.GetOneByOrderNo(ctx, orderNoEntity.OrderNo)
@@ -59,7 +60,7 @@ func (c *ControllerV1) RechargeHandler(ctx context.Context, req *v1.RechargeHand
}
if rechargeOrderSchema.Status == int(consts.AppleRechargeOrderProcessing) {
_ = rechargeOrderService.ModifyOrderStatus(ctx, orderNoEntity.OrderNo, consts.AppleRechargeOrderWaiting, "", nil)
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: accountInfo.Id,
OrderNo: orderNoEntity.OrderNo,

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
"kami/api/commonApi"
"kami/internal/model/entity"
"kami/internal/service"

View File

@@ -3,6 +3,7 @@ package apple_card_info
import (
"context"
"fmt"
"github.com/gogf/gf/v2/os/gcron"
"github.com/gogf/gf/v2/os/glog"
v1 "kami/api/apple_card_info/v1"
@@ -32,9 +33,9 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
switch req.Status {
case consts.AppleRechargeItunesStatusWrongPassword:
_ = appleAccountService.ModifyStatus(ctx, orderEntity.AccountId, consts.AppleAccountWrongPassword)
//重新设为待调度状态
// 重新设为待调度状态
_ = rechargeOrderService.ModifyOrderStatus(ctx, orderEntity.OrderNo, consts.AppleRechargeOrderWaiting, "账号密码错误", nil)
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: orderEntity.AccountId,
OrderNo: orderEntity.OrderNo,
@@ -47,9 +48,9 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
if req.Status == consts.AppleRechargeItunesRefundWithAccountLimited {
req.Remark = fmt.Sprintf("%s%s", "账号受到限制", req.Remark)
}
//退回
// 退回
_ = rechargeOrderService.ModifyOrderStatus(ctx, orderEntity.OrderNo, consts.AppleRechargeOrderWaiting, "订单退回", nil)
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: orderEntity.AccountId,
OrderNo: orderEntity.OrderNo,
@@ -61,11 +62,11 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
if req.Status == consts.AppleRechargeItunesRefundWithAccountLimited {
_ = appleAccountService.ModifyStatus(ctx, orderEntity.AccountId, consts.AppleAccountLimited)
}
//移除之前的定时器
// 移除之前的定时器
case consts.AppleRechargeItunesStatusSuccess:
//如果当前订单已经处理成功,则不处理
// 如果当前订单已经处理成功,则不处理
if orderEntity.Status == int(consts.AppleRechargeOrderSuccess) || orderEntity.Status == int(consts.AppleRechargeOrderAmountDifferent) {
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: orderEntity.AccountId,
OrderNo: orderEntity.OrderNo,
@@ -91,7 +92,7 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
}
t := consts.AppleRechargeOrderAmountDifferent
orderDifferentEntity, err2 := rechargeOrderService.QueryOneByCardPass(ctx, orderEntity.CardPass, &t)
//满足条件,有存在有异议的订单
// 满足条件,有存在有异议的订单
if err2 == nil && orderDifferentEntity.Id != 0 && orderDifferentEntity.Id != orderEntity.Id {
req.Remark = fmt.Sprintf("%s%s", req.Remark, "金额异议")
} else {
@@ -104,7 +105,7 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
}, nil)
}
orderEntity, _ = rechargeOrderService.GetOneByOrderNo(ctx, req.OrderNo)
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: orderEntity.AccountId,
OrderNo: orderEntity.OrderNo,
@@ -115,9 +116,9 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
}, nil)
_ = rechargeOrderService.CallBackOrderToUpstream(ctx, orderEntity)
case consts.AppleRechargeItunesStatusFail, consts.AppleRechargeItunesStatusFailWithWrongCode, consts.AppleRechargeItunesStatusFailWithRepeatCharge:
//如果当前订单已经处理失败,则不处理
// 如果当前订单已经处理失败,则不处理
if orderEntity.Status == int(consts.AppleRechargeOrderFail) {
//添加一条记录
// 添加一条记录
_ = rechargeOrderService.AddHistory(ctx, model.AppleCardRechargeHistoryInput{
AccountID: orderEntity.AccountId,
OrderNo: orderEntity.OrderNo,
@@ -128,7 +129,7 @@ func (c *ControllerV1) RechargeItunesCallback(ctx context.Context, req *v1.Recha
}, nil)
return
}
//添加一条记录
// 添加一条记录
req.Remark = fmt.Sprintf("卡密:%s面额%.2f", orderEntity.CardPass, orderEntity.CardAmount)
operationStr := consts.AppleRechargeOperationItunesFail
remark := ""

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
v1 "kami/api/apple_card_info/v1"
"kami/api/commonApi"
"kami/internal/err_handler"

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"github.com/gogf/gf/v2/frame/g"
"github.com/xuri/excelize/v2"
"kami/api/apple_card_info/v1"

View File

@@ -2,11 +2,12 @@ package apple_card_info
import (
"bytes"
"os"
"testing"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/glog"
"github.com/xuri/excelize/v2"
"os"
"testing"
)
func TestControllerV1_RechargeListDownload(t *testing.T) {

View File

@@ -2,13 +2,13 @@ package apple_card_info
import (
"context"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"kami/api/apple_card_info/v1"
)
func (c *ControllerV1) RechargeOrderModifyActualAmount(ctx context.Context, req *v1.RechargeOrderModifyActualAmountReq) (res *v1.RechargeOrderModifyActualAmountRes, err error) {
return res, gerror.NewCode(gcode.CodeNotSupported)
//rechargeOrderService := service.RechargeHistory()
//orderEntity, err := rechargeOrderService.GetOneByOrderNo(ctx, req.OrderNo, 0)

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
"kami/internal/err_handler"
"kami/utility/utils"

View File

@@ -2,6 +2,7 @@ package apple_card_info
import (
"context"
"kami/internal/consts"
"kami/internal/service"

View File

@@ -6,7 +6,6 @@ import (
v1 "kami/api/authority/v1"
"kami/internal/model"
"kami/internal/service"
)
func (c *ControllerV1) MenuCreate(ctx context.Context, req *v1.MenuCreateReq) (res *v1.MenuCreateRes, err error) {

View File

@@ -6,7 +6,6 @@ import (
v1 "kami/api/channel/v1"
"kami/internal/model"
"kami/internal/service"
)
func (c *ControllerV1) EntranceUpdate(ctx context.Context, req *v1.EntranceUpdateReq) (res *v1.EntranceUpdateRes, err error) {

View File

@@ -2,6 +2,7 @@ package merchant
import (
"context"
"github.com/gogf/gf/v2/crypto/gmd5"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gerror"

View File

@@ -6,7 +6,6 @@ import (
"kami/api/merchant/v1"
"kami/internal/model"
"kami/internal/service"
)
func (c *ControllerV1) MerchantConfigUpdate(ctx context.Context, req *v1.MerchantConfigUpdateReq) (res *v1.MerchantConfigUpdateRes, err error) {

View File

@@ -3,6 +3,7 @@ package merchant
import (
"context"
"errors"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"kami/internal/consts"

View File

@@ -2,13 +2,14 @@ package order
import (
"context"
"math"
"github.com/gogf/gf/v2/errors/gcode"
"kami/api/commonApi"
"kami/api/order/v1"
"kami/internal/err_handler"
"kami/internal/model"
"kami/internal/service"
"math"
)
func (c *ControllerV1) OrderSummaryGetList(ctx context.Context, req *v1.OrderSummaryGetListReq) (res *v1.OrderSummaryGetListRes, err error) {

View File

@@ -2,6 +2,7 @@ package sysUser
import (
"context"
"kami/utility/token"
"kami/api/sysUser/v1"

View File

@@ -2,6 +2,7 @@ package sys_user_login
import (
"context"
"github.com/gogf/gf/v2/errors/gcode"
"kami/internal/err_handler"
@@ -12,15 +13,13 @@ import (
)
func (c *ControllerV1) UserLogin(ctx context.Context, req *v1.UserLoginReq) (res *v1.UserLoginRes, err error) {
var (
tokenStr string
)
//判断验证码是否正确
var tokenStr string
// 判断验证码是否正确
if !service.Captcha().VerifyString(req.VerifyKey, req.VerifyCode) {
err = err_handler.WrapError(ctx, gcode.CodeNotAuthorized, err, "验证码错误")
return
}
//userAgent := utils.GetUserAgent(ctx)
// userAgent := utils.GetUserAgent(ctx)
user, err := service.SysUser().GetAdminUserByUsernamePassword(ctx,
&model.UserLoginInput{Username: req.Username, Password: req.Password},
)
@@ -51,7 +50,7 @@ func (c *ControllerV1) UserLogin(ctx context.Context, req *v1.UserLoginReq) (res
if err != nil {
err = err_handler.WrapError(ctx, gcode.CodeInternalError, err, "生成token失败")
}
//获取用户菜单数据
// 获取用户菜单数据
res = &v1.UserLoginRes{
Token: tokenStr,
}

View File

@@ -2,6 +2,7 @@ package validation
import (
"context"
"github.com/gogf/gf/v2/errors/gcode"
"kami/internal/err_handler"

View File

@@ -20,46 +20,48 @@ type V1CardAppleRechargeInfoDao struct {
// V1CardAppleRechargeInfoColumns defines and stores column names for table card_apple_recharge_info.
type V1CardAppleRechargeInfoColumns struct {
Id string //
OrderNo string // 订单号
AccountId string //
AccountName string //
CardNo string // 卡号
CardPass string // 卡密
Balance string // 余额
CardAmount string // 卡面充值金额
Status string // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
ActualAmount string // 实际充值金额
CallbackUrl string //
CallbackCount string // itunes回调次数
CreatedUserId string // 创建者ID
Attach string //
Remark string //
CreatedAt string // 创建日期
UpdatedAt string // 更新日期
DeletedAt string // 删除日期
Id string //
OrderNo string // 订单号
AccountId string //
AccountName string //
CardNo string // 卡号
CardPass string // 卡密
Balance string // 余额
CardAmount string // 卡面充值金额
Status string // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
ActualAmount string // 实际充值金额
CallbackUrl string //
CallbackCount string // itunes回调次数
CreatedUserId string // 创建者ID
Attach string //
Remark string //
CreatedAt string // 创建日期
UpdatedAt string // 更新日期
DeletedAt string // 删除日期
DistributionCount string // 分配次数
}
// v1CardAppleRechargeInfoColumns holds the columns for table card_apple_recharge_info.
var v1CardAppleRechargeInfoColumns = V1CardAppleRechargeInfoColumns{
Id: "id",
OrderNo: "order_no",
AccountId: "account_id",
AccountName: "account_name",
CardNo: "card_no",
CardPass: "card_pass",
Balance: "balance",
CardAmount: "card_amount",
Status: "status",
ActualAmount: "actual_amount",
CallbackUrl: "callback_url",
CallbackCount: "callback_count",
CreatedUserId: "created_user_id",
Attach: "attach",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
Id: "id",
OrderNo: "order_no",
AccountId: "account_id",
AccountName: "account_name",
CardNo: "card_no",
CardPass: "card_pass",
Balance: "balance",
CardAmount: "card_amount",
Status: "status",
ActualAmount: "actual_amount",
CallbackUrl: "callback_url",
CallbackCount: "callback_count",
CreatedUserId: "created_user_id",
Attach: "attach",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
DistributionCount: "distribution_count",
}
// NewV1CardAppleRechargeInfoDao creates and returns a new DAO object for table data access.

View File

@@ -1,97 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2CardAppleRechargeInfoDao is the data access object for table card_apple_recharge_info.
type V2CardAppleRechargeInfoDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2CardAppleRechargeInfoColumns // columns contains all the column names of Table for convenient usage.
}
// V2CardAppleRechargeInfoColumns defines and stores column names for table card_apple_recharge_info.
type V2CardAppleRechargeInfoColumns struct {
Id string //
OrderNo string // 订单号
AccountId string //
CardNo string // 卡号
CardPass string // 卡密
Balance string // 余额
Amount string // 充值金额
Status string // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
CreatedAt string // 创建日期
UpdatedAt string // 更新日期
DeletedAt string // 删除日期
CallbackUrl string //
Attach string //
}
// v2CardAppleRechargeInfoColumns holds the columns for table card_apple_recharge_info.
var v2CardAppleRechargeInfoColumns = V2CardAppleRechargeInfoColumns{
Id: "id",
OrderNo: "order_no",
AccountId: "account_id",
CardNo: "card_no",
CardPass: "card_pass",
Balance: "balance",
Amount: "amount",
Status: "status",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
CallbackUrl: "callback_url",
Attach: "attach",
}
// NewV2CardAppleRechargeInfoDao creates and returns a new DAO object for table data access.
func NewV2CardAppleRechargeInfoDao() *V2CardAppleRechargeInfoDao {
return &V2CardAppleRechargeInfoDao{
group: "default",
table: "card_apple_recharge_info",
columns: v2CardAppleRechargeInfoColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2CardAppleRechargeInfoDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2CardAppleRechargeInfoDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2CardAppleRechargeInfoDao) Columns() V2CardAppleRechargeInfoColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2CardAppleRechargeInfoDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2CardAppleRechargeInfoDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2CardAppleRechargeInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,145 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2OrderInfoDao is the data access object for table order_info.
type V2OrderInfoDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2OrderInfoColumns // columns contains all the column names of Table for convenient usage.
}
// V2OrderInfoColumns defines and stores column names for table order_info.
type V2OrderInfoColumns struct {
Id string // 主键,自增
MerchantOrderId string // 下游商户提交过来的订单id
ShopName string // 商品名称
OrderPeriod string // 订单有效时间,小时制
BankOrderId string // 平台自身的订单id
BankTransId string // 上游返回的订单id
OrderAmount string // 订单提交金额
ShowAmount string // 展示在用户面前待支付的金额
FactAmount string // 实际支付金额
RollPoolCode string // 轮询产品编码
RollPoolName string // 轮询产品名称
RoadUid string // 通道uid
RoadName string // 通道名称
PayProductCode string // 支付产品编码
PayProductName string // 支付产品名称
PayTypeCode string // 支付类型编码
PayTypeName string // 支付类型名称
OsType string // 平台类型苹果app-0 安卓app-1苹果H5-3安卓H5-4pc-5
Status string // 等待支付-wait,支付成功-success, 支付失败-failed
Refund string // 退款-yes 没有退款-no
RefundTime string // 退款时间
Freeze string // 冻结-yes 没有-no
FreezeTime string // 冻结时间
Unfreeze string // 解冻-yes没有-no
UnfreezeTime string // 解冻时间
NotifyUrl string // 订单回调给下游的地址
MerchantUid string // 商户uid表示订单是哪个商户的
MerchantName string // 商户名称
AgentUid string // 代理uid表示该商户是谁的代理
AgentName string // 代理名称
Response string // 上游返回的结果
UpdateTime string // 更新时间
CreateTime string // 创建时间
ExValue string //
CardData string //
Operator string //
CardReturnData string //
}
// v2OrderInfoColumns holds the columns for table order_info.
var v2OrderInfoColumns = V2OrderInfoColumns{
Id: "id",
MerchantOrderId: "merchant_order_id",
ShopName: "shop_name",
OrderPeriod: "order_period",
BankOrderId: "bank_order_id",
BankTransId: "bank_trans_id",
OrderAmount: "order_amount",
ShowAmount: "show_amount",
FactAmount: "fact_amount",
RollPoolCode: "roll_pool_code",
RollPoolName: "roll_pool_name",
RoadUid: "road_uid",
RoadName: "road_name",
PayProductCode: "pay_product_code",
PayProductName: "pay_product_name",
PayTypeCode: "pay_type_code",
PayTypeName: "pay_type_name",
OsType: "os_type",
Status: "status",
Refund: "refund",
RefundTime: "refund_time",
Freeze: "freeze",
FreezeTime: "freeze_time",
Unfreeze: "unfreeze",
UnfreezeTime: "unfreeze_time",
NotifyUrl: "notify_url",
MerchantUid: "merchant_uid",
MerchantName: "merchant_name",
AgentUid: "agent_uid",
AgentName: "agent_name",
Response: "response",
UpdateTime: "update_time",
CreateTime: "create_time",
ExValue: "ex_value",
CardData: "card_data",
Operator: "operator",
CardReturnData: "card_return_data",
}
// NewV2OrderInfoDao creates and returns a new DAO object for table data access.
func NewV2OrderInfoDao() *V2OrderInfoDao {
return &V2OrderInfoDao{
group: "default",
table: "order_info",
columns: v2OrderInfoColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2OrderInfoDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2OrderInfoDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2OrderInfoDao) Columns() V2OrderInfoColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2OrderInfoDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2OrderInfoDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2OrderInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,89 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2OrderNotifyLogDao is the data access object for table order_notify_log.
type V2OrderNotifyLogDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2OrderNotifyLogColumns // columns contains all the column names of Table for convenient usage.
}
// V2OrderNotifyLogColumns defines and stores column names for table order_notify_log.
type V2OrderNotifyLogColumns struct {
Id string // 主键,自增
OrderId string // 系统订单id
Status string // 状态字段
Num string // 回调次数
Url string // 回调的url
Response string // 回调返回的结果
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 删除时间
}
// v2OrderNotifyLogColumns holds the columns for table order_notify_log.
var v2OrderNotifyLogColumns = V2OrderNotifyLogColumns{
Id: "id",
OrderId: "order_id",
Status: "status",
Num: "num",
Url: "url",
Response: "response",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2OrderNotifyLogDao creates and returns a new DAO object for table data access.
func NewV2OrderNotifyLogDao() *V2OrderNotifyLogDao {
return &V2OrderNotifyLogDao{
group: "default",
table: "order_notify_log",
columns: v2OrderNotifyLogColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2OrderNotifyLogDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2OrderNotifyLogDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2OrderNotifyLogDao) Columns() V2OrderNotifyLogColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2OrderNotifyLogDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2OrderNotifyLogDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2OrderNotifyLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,117 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2RoadInfoDao is the data access object for table road_info.
type V2RoadInfoDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2RoadInfoColumns // columns contains all the column names of Table for convenient usage.
}
// V2RoadInfoColumns defines and stores column names for table road_info.
type V2RoadInfoColumns struct {
Id string // 主键,自增
Name string // 通道名称
PayType string // 支付类型
ServiceFee string // 代付手续费
TotalLimit string // 通道总额度
AllowedMm string // 允许面额
StartHour string // 通道开始时间
EndHour string // 通道结束时间
TodayIncome string // 当天的收入
TotalIncome string // 通道总收入
TodayProfit string // 当天的收益
TotalProfit string // 通道总收益
Balance string // 通道的余额
RequestAll string // 请求总次数
RequestSuccess string // 请求成功次数
TodayRequestAll string //
TodayRequestSuccess string //
Params string // 参数json格式
Remark string // 备注
Status string //
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 删除时间
}
// v2RoadInfoColumns holds the columns for table road_info.
var v2RoadInfoColumns = V2RoadInfoColumns{
Id: "id",
Name: "name",
PayType: "pay_type",
ServiceFee: "service_fee",
TotalLimit: "total_limit",
AllowedMm: "allowed_mm",
StartHour: "start_hour",
EndHour: "end_hour",
TodayIncome: "today_income",
TotalIncome: "total_income",
TodayProfit: "today_profit",
TotalProfit: "total_profit",
Balance: "balance",
RequestAll: "request_all",
RequestSuccess: "request_success",
TodayRequestAll: "today_request_all",
TodayRequestSuccess: "today_request_success",
Params: "params",
Remark: "remark",
Status: "status",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2RoadInfoDao creates and returns a new DAO object for table data access.
func NewV2RoadInfoDao() *V2RoadInfoDao {
return &V2RoadInfoDao{
group: "default",
table: "road_info",
columns: v2RoadInfoColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2RoadInfoDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2RoadInfoDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2RoadInfoDao) Columns() V2RoadInfoColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2RoadInfoDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2RoadInfoDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2RoadInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,97 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2SysAuthRuleDao is the data access object for table sys_auth_rule.
type V2SysAuthRuleDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2SysAuthRuleColumns // columns contains all the column names of Table for convenient usage.
}
// V2SysAuthRuleColumns defines and stores column names for table sys_auth_rule.
type V2SysAuthRuleColumns struct {
Id string //
Pid string // 父ID
Name string // 规则名称
Title string // 规则名称
MenuType string // 类型 0目录 1菜单 2按钮
Weigh string // 权重
IsHide string // 显示状态
Path string // 路由地址
IdAdmin string // 是否管理员独享 1是2.否
Component string // 组件路径
CreatedAt string // 创建日期
UpdatedAt string // 修改日期
DeletedAt string //
}
// v2SysAuthRuleColumns holds the columns for table sys_auth_rule.
var v2SysAuthRuleColumns = V2SysAuthRuleColumns{
Id: "id",
Pid: "pid",
Name: "name",
Title: "title",
MenuType: "menu_type",
Weigh: "weigh",
IsHide: "is_hide",
Path: "path",
IdAdmin: "id_admin",
Component: "component",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2SysAuthRuleDao creates and returns a new DAO object for table data access.
func NewV2SysAuthRuleDao() *V2SysAuthRuleDao {
return &V2SysAuthRuleDao{
group: "default",
table: "sys_auth_rule",
columns: v2SysAuthRuleColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2SysAuthRuleDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2SysAuthRuleDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2SysAuthRuleDao) Columns() V2SysAuthRuleColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2SysAuthRuleDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2SysAuthRuleDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2SysAuthRuleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,91 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2SysConfigDao is the data access object for table sys_config.
type V2SysConfigDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2SysConfigColumns // columns contains all the column names of Table for convenient usage.
}
// V2SysConfigColumns defines and stores column names for table sys_config.
type V2SysConfigColumns struct {
ConfigId string // 参数主键
ConfigName string // 参数名称
ConfigKey string // 参数键名
ConfigValue string // 参数键值
ConfigType string // 系统内置Y是 N否
CreateBy string // 创建者
UpdateBy string // 更新者
Remark string // 备注
CreatedAt string // 创建时间
UpdatedAt string // 修改时间
}
// v2SysConfigColumns holds the columns for table sys_config.
var v2SysConfigColumns = V2SysConfigColumns{
ConfigId: "config_id",
ConfigName: "config_name",
ConfigKey: "config_key",
ConfigValue: "config_value",
ConfigType: "config_type",
CreateBy: "create_by",
UpdateBy: "update_by",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewV2SysConfigDao creates and returns a new DAO object for table data access.
func NewV2SysConfigDao() *V2SysConfigDao {
return &V2SysConfigDao{
group: "default",
table: "sys_config",
columns: v2SysConfigColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2SysConfigDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2SysConfigDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2SysConfigDao) Columns() V2SysConfigColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2SysConfigDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2SysConfigDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2SysConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,99 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2SysOperLogDao is the data access object for table sys_oper_log.
type V2SysOperLogDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2SysOperLogColumns // columns contains all the column names of Table for convenient usage.
}
// V2SysOperLogColumns defines and stores column names for table sys_oper_log.
type V2SysOperLogColumns struct {
OperId string // 日志主键
Title string // 模块标题
BusinessType string // 业务类型0其它 1新增 2修改 3删除
Method string // 方法名称
RequestMethod string // 请求方式
OperatorType string // 操作类别0其它 1后台用户 2手机端用户
OperName string // 操作人员
DeptName string // 部门名称
OperUrl string // 请求URL
OperIp string // 主机地址
OperLocation string // 操作地点
OperParam string // 请求参数
ErrorMsg string // 错误消息
OperTime string // 操作时间
}
// v2SysOperLogColumns holds the columns for table sys_oper_log.
var v2SysOperLogColumns = V2SysOperLogColumns{
OperId: "oper_id",
Title: "title",
BusinessType: "business_type",
Method: "method",
RequestMethod: "request_method",
OperatorType: "operator_type",
OperName: "oper_name",
DeptName: "dept_name",
OperUrl: "oper_url",
OperIp: "oper_ip",
OperLocation: "oper_location",
OperParam: "oper_param",
ErrorMsg: "error_msg",
OperTime: "oper_time",
}
// NewV2SysOperLogDao creates and returns a new DAO object for table data access.
func NewV2SysOperLogDao() *V2SysOperLogDao {
return &V2SysOperLogDao{
group: "default",
table: "sys_oper_log",
columns: v2SysOperLogColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2SysOperLogDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2SysOperLogDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2SysOperLogDao) Columns() V2SysOperLogColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2SysOperLogDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2SysOperLogDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2SysOperLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,77 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2SysRoleDao is the data access object for table sys_role.
type V2SysRoleDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2SysRoleColumns // columns contains all the column names of Table for convenient usage.
}
// V2SysRoleColumns defines and stores column names for table sys_role.
type V2SysRoleColumns struct {
Id string //
Name string //
Desc string //
}
// v2SysRoleColumns holds the columns for table sys_role.
var v2SysRoleColumns = V2SysRoleColumns{
Id: "id",
Name: "name",
Desc: "desc_",
}
// NewV2SysRoleDao creates and returns a new DAO object for table data access.
func NewV2SysRoleDao() *V2SysRoleDao {
return &V2SysRoleDao{
group: "default",
table: "sys_role",
columns: v2SysRoleColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2SysRoleDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2SysRoleDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2SysRoleDao) Columns() V2SysRoleColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2SysRoleDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2SysRoleDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2SysRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,77 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2SysRolePermissionDao is the data access object for table sys_role_permission.
type V2SysRolePermissionDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2SysRolePermissionColumns // columns contains all the column names of Table for convenient usage.
}
// V2SysRolePermissionColumns defines and stores column names for table sys_role_permission.
type V2SysRolePermissionColumns struct {
Id string //
Rid string // 角色ID
Aid string // AuthID
}
// v2SysRolePermissionColumns holds the columns for table sys_role_permission.
var v2SysRolePermissionColumns = V2SysRolePermissionColumns{
Id: "id",
Rid: "rid",
Aid: "aid",
}
// NewV2SysRolePermissionDao creates and returns a new DAO object for table data access.
func NewV2SysRolePermissionDao() *V2SysRolePermissionDao {
return &V2SysRolePermissionDao{
group: "default",
table: "sys_role_permission",
columns: v2SysRolePermissionColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2SysRolePermissionDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2SysRolePermissionDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2SysRolePermissionDao) Columns() V2SysRolePermissionColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2SysRolePermissionDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2SysRolePermissionDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2SysRolePermissionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,87 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2UserDao is the data access object for table user.
type V2UserDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2UserColumns // columns contains all the column names of Table for convenient usage.
}
// V2UserColumns defines and stores column names for table user.
type V2UserColumns struct {
Id string // ID
Username string // 账号
Password string // 密码
IsAdmin string // 是否是管理员
Phone string // 手机号
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// v2UserColumns holds the columns for table user.
var v2UserColumns = V2UserColumns{
Id: "id",
Username: "username",
Password: "password",
IsAdmin: "is_admin",
Phone: "phone",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2UserDao creates and returns a new DAO object for table data access.
func NewV2UserDao() *V2UserDao {
return &V2UserDao{
group: "default",
table: "user",
columns: v2UserColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2UserDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2UserDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2UserDao) Columns() V2UserColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2UserDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2UserDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2UserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,93 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2UserLoginLogDao is the data access object for table user_login_log.
type V2UserLoginLogDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2UserLoginLogColumns // columns contains all the column names of Table for convenient usage.
}
// V2UserLoginLogColumns defines and stores column names for table user_login_log.
type V2UserLoginLogColumns struct {
Id string //
UserId string //
Name string // 登录名
IpAddr string // 登录IP
LoginLocation string // 登录地点
UserAgent string //
Browser string //
Os string //
CreatedAt string // 登录时间
Status string // 登录状态 1登录成功2登录失败
Message string //
}
// v2UserLoginLogColumns holds the columns for table user_login_log.
var v2UserLoginLogColumns = V2UserLoginLogColumns{
Id: "id",
UserId: "user_id",
Name: "name",
IpAddr: "ip_addr",
LoginLocation: "login_location",
UserAgent: "user_agent",
Browser: "browser",
Os: "os",
CreatedAt: "created_at",
Status: "status",
Message: "message",
}
// NewV2UserLoginLogDao creates and returns a new DAO object for table data access.
func NewV2UserLoginLogDao() *V2UserLoginLogDao {
return &V2UserLoginLogDao{
group: "default",
table: "user_login_log",
columns: v2UserLoginLogColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2UserLoginLogDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2UserLoginLogDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2UserLoginLogDao) Columns() V2UserLoginLogColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2UserLoginLogDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2UserLoginLogDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2UserLoginLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,85 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2UserRoadDao is the data access object for table user_road.
type V2UserRoadDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2UserRoadColumns // columns contains all the column names of Table for convenient usage.
}
// V2UserRoadColumns defines and stores column names for table user_road.
type V2UserRoadColumns struct {
Id string //
UserId string // 用户ID
RoadId string // 通道ID
NetMargin string //
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// v2UserRoadColumns holds the columns for table user_road.
var v2UserRoadColumns = V2UserRoadColumns{
Id: "id",
UserId: "user_id",
RoadId: "road_id",
NetMargin: "net_margin",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2UserRoadDao creates and returns a new DAO object for table data access.
func NewV2UserRoadDao() *V2UserRoadDao {
return &V2UserRoadDao{
group: "default",
table: "user_road",
columns: v2UserRoadColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2UserRoadDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2UserRoadDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2UserRoadDao) Columns() V2UserRoadColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2UserRoadDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2UserRoadDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2UserRoadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,87 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2UserWalletDao is the data access object for table user_wallet.
type V2UserWalletDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2UserWalletColumns // columns contains all the column names of Table for convenient usage.
}
// V2UserWalletColumns defines and stores column names for table user_wallet.
type V2UserWalletColumns struct {
Id string //
UserId string // 用户ID
Status string // 钱包状态 0冻结1运行
Surplus string // 余额
PendingSurplus string // 待结算金额
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// v2UserWalletColumns holds the columns for table user_wallet.
var v2UserWalletColumns = V2UserWalletColumns{
Id: "id",
UserId: "user_id",
Status: "status",
Surplus: "surplus",
PendingSurplus: "pending_surplus",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2UserWalletDao creates and returns a new DAO object for table data access.
func NewV2UserWalletDao() *V2UserWalletDao {
return &V2UserWalletDao{
group: "default",
table: "user_wallet",
columns: v2UserWalletColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2UserWalletDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2UserWalletDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2UserWalletDao) Columns() V2UserWalletColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2UserWalletDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2UserWalletDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2UserWalletDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -1,87 +0,0 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// V2UserWalletLogDao is the data access object for table user_wallet_log.
type V2UserWalletLogDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns V2UserWalletLogColumns // columns contains all the column names of Table for convenient usage.
}
// V2UserWalletLogColumns defines and stores column names for table user_wallet_log.
type V2UserWalletLogColumns struct {
Id string // ID
UserId string // 用户ID
UserWalletId string // 用户钱包ID
Value string // 操作金额
Operation string // 操作 1.扣款
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// v2UserWalletLogColumns holds the columns for table user_wallet_log.
var v2UserWalletLogColumns = V2UserWalletLogColumns{
Id: "id",
UserId: "user_id",
UserWalletId: "user_wallet_id",
Value: "value",
Operation: "operation",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewV2UserWalletLogDao creates and returns a new DAO object for table data access.
func NewV2UserWalletLogDao() *V2UserWalletLogDao {
return &V2UserWalletLogDao{
group: "default",
table: "user_wallet_log",
columns: v2UserWalletLogColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *V2UserWalletLogDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *V2UserWalletLogDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *V2UserWalletLogDao) Columns() V2UserWalletLogColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *V2UserWalletLogDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *V2UserWalletLogDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *V2UserWalletLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -17,11 +17,9 @@ type v1CardAppleAccountInfoDao struct {
internalV1CardAppleAccountInfoDao
}
var (
// V1CardAppleAccountInfo is globally public accessible object for table card_apple_account_info operations.
V1CardAppleAccountInfo = v1CardAppleAccountInfoDao{
internal.NewV1CardAppleAccountInfoDao(),
}
)
// V1CardAppleAccountInfo is globally public accessible object for table card_apple_account_info operations.
var V1CardAppleAccountInfo = v1CardAppleAccountInfoDao{
internal.NewV1CardAppleAccountInfoDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1CardAppleAccountInfoHistoryDao struct {
internalV1CardAppleAccountInfoHistoryDao
}
var (
// V1CardAppleAccountInfoHistory is globally public accessible object for table card_apple_account_info_history operations.
V1CardAppleAccountInfoHistory = v1CardAppleAccountInfoHistoryDao{
internal.NewV1CardAppleAccountInfoHistoryDao(),
}
)
// V1CardAppleAccountInfoHistory is globally public accessible object for table card_apple_account_info_history operations.
var V1CardAppleAccountInfoHistory = v1CardAppleAccountInfoHistoryDao{
internal.NewV1CardAppleAccountInfoHistoryDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1CardAppleHistoryInfoDao struct {
internalV1CardAppleHistoryInfoDao
}
var (
// V1CardAppleHistoryInfo is globally public accessible object for table card_apple_history_info operations.
V1CardAppleHistoryInfo = v1CardAppleHistoryInfoDao{
internal.NewV1CardAppleHistoryInfoDao(),
}
)
// V1CardAppleHistoryInfo is globally public accessible object for table card_apple_history_info operations.
var V1CardAppleHistoryInfo = v1CardAppleHistoryInfoDao{
internal.NewV1CardAppleHistoryInfoDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1CardAppleRechargeInfoDao struct {
internalV1CardAppleRechargeInfoDao
}
var (
// V1CardAppleRechargeInfo is globally public accessible object for table card_apple_recharge_info operations.
V1CardAppleRechargeInfo = v1CardAppleRechargeInfoDao{
internal.NewV1CardAppleRechargeInfoDao(),
}
)
// V1CardAppleRechargeInfo is globally public accessible object for table card_apple_recharge_info operations.
var V1CardAppleRechargeInfo = v1CardAppleRechargeInfoDao{
internal.NewV1CardAppleRechargeInfoDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1OrderInfoDao struct {
internalV1OrderInfoDao
}
var (
// V1OrderInfo is globally public accessible object for table order_info operations.
V1OrderInfo = v1OrderInfoDao{
internal.NewV1OrderInfoDao(),
}
)
// V1OrderInfo is globally public accessible object for table order_info operations.
var V1OrderInfo = v1OrderInfoDao{
internal.NewV1OrderInfoDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1SysAuthRuleDao struct {
internalV1SysAuthRuleDao
}
var (
// V1SysAuthRule is globally public accessible object for table sys_auth_rule operations.
V1SysAuthRule = v1SysAuthRuleDao{
internal.NewV1SysAuthRuleDao(),
}
)
// V1SysAuthRule is globally public accessible object for table sys_auth_rule operations.
var V1SysAuthRule = v1SysAuthRuleDao{
internal.NewV1SysAuthRuleDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1SysCasbinRuleDao struct {
internalV1SysCasbinRuleDao
}
var (
// V1SysCasbinRule is globally public accessible object for table sys_casbin_rule operations.
V1SysCasbinRule = v1SysCasbinRuleDao{
internal.NewV1SysCasbinRuleDao(),
}
)
// V1SysCasbinRule is globally public accessible object for table sys_casbin_rule operations.
var V1SysCasbinRule = v1SysCasbinRuleDao{
internal.NewV1SysCasbinRuleDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1SysRoleDao struct {
internalV1SysRoleDao
}
var (
// V1SysRole is globally public accessible object for table sys_role operations.
V1SysRole = v1SysRoleDao{
internal.NewV1SysRoleDao(),
}
)
// V1SysRole is globally public accessible object for table sys_role operations.
var V1SysRole = v1SysRoleDao{
internal.NewV1SysRoleDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1SysUserDao struct {
internalV1SysUserDao
}
var (
// V1SysUser is globally public accessible object for table sys_user operations.
V1SysUser = v1SysUserDao{
internal.NewV1SysUserDao(),
}
)
// V1SysUser is globally public accessible object for table sys_user operations.
var V1SysUser = v1SysUserDao{
internal.NewV1SysUserDao(),
}
// Fill with you ideas below.

View File

@@ -17,11 +17,9 @@ type v1SysUserLoginLogDao struct {
internalV1SysUserLoginLogDao
}
var (
// V1SysUserLoginLog is globally public accessible object for table sys_user_login_log operations.
V1SysUserLoginLog = v1SysUserLoginLogDao{
internal.NewV1SysUserLoginLogDao(),
}
)
// V1SysUserLoginLog is globally public accessible object for table sys_user_login_log operations.
var V1SysUserLoginLog = v1SysUserLoginLogDao{
internal.NewV1SysUserLoginLogDao(),
}
// Fill with you ideas below.

View File

@@ -1,27 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2CardAppleRechargeInfoDao is internal type for wrapping internal DAO implements.
type internalV2CardAppleRechargeInfoDao = *internal.V2CardAppleRechargeInfoDao
// v2CardAppleRechargeInfoDao is the data access object for table card_apple_recharge_info.
// You can define custom methods on it to extend its functionality as you wish.
type v2CardAppleRechargeInfoDao struct {
internalV2CardAppleRechargeInfoDao
}
var (
// V2CardAppleRechargeInfo is globally public accessible object for table card_apple_recharge_info operations.
V2CardAppleRechargeInfo = v2CardAppleRechargeInfoDao{
internal.NewV2CardAppleRechargeInfoDao(),
}
)
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2OrderInfoDao is internal type for wrapping internal DAO implements.
type internalV2OrderInfoDao = *internal.V2OrderInfoDao
// v2OrderInfoDao is the data access object for table order_info.
// You can define custom methods on it to extend its functionality as you wish.
type v2OrderInfoDao struct {
internalV2OrderInfoDao
}
// V2OrderInfo is globally public accessible object for table order_info operations.
var V2OrderInfo = v2OrderInfoDao{
internal.NewV2OrderInfoDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2OrderNotifyLogDao is internal type for wrapping internal DAO implements.
type internalV2OrderNotifyLogDao = *internal.V2OrderNotifyLogDao
// v2OrderNotifyLogDao is the data access object for table order_notify_log.
// You can define custom methods on it to extend its functionality as you wish.
type v2OrderNotifyLogDao struct {
internalV2OrderNotifyLogDao
}
// V2OrderNotifyLog is globally public accessible object for table order_notify_log operations.
var V2OrderNotifyLog = v2OrderNotifyLogDao{
internal.NewV2OrderNotifyLogDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2RoadInfoDao is internal type for wrapping internal DAO implements.
type internalV2RoadInfoDao = *internal.V2RoadInfoDao
// v2RoadInfoDao is the data access object for table road_info.
// You can define custom methods on it to extend its functionality as you wish.
type v2RoadInfoDao struct {
internalV2RoadInfoDao
}
// V2RoadInfo is globally public accessible object for table road_info operations.
var V2RoadInfo = v2RoadInfoDao{
internal.NewV2RoadInfoDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2SysAuthRuleDao is internal type for wrapping internal DAO implements.
type internalV2SysAuthRuleDao = *internal.V2SysAuthRuleDao
// v2SysAuthRuleDao is the data access object for table sys_auth_rule.
// You can define custom methods on it to extend its functionality as you wish.
type v2SysAuthRuleDao struct {
internalV2SysAuthRuleDao
}
// V2SysAuthRule is globally public accessible object for table sys_auth_rule operations.
var V2SysAuthRule = v2SysAuthRuleDao{
internal.NewV2SysAuthRuleDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2SysConfigDao is internal type for wrapping internal DAO implements.
type internalV2SysConfigDao = *internal.V2SysConfigDao
// v2SysConfigDao is the data access object for table sys_config.
// You can define custom methods on it to extend its functionality as you wish.
type v2SysConfigDao struct {
internalV2SysConfigDao
}
// V2SysConfig is globally public accessible object for table sys_config operations.
var V2SysConfig = v2SysConfigDao{
internal.NewV2SysConfigDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2SysOperLogDao is internal type for wrapping internal DAO implements.
type internalV2SysOperLogDao = *internal.V2SysOperLogDao
// v2SysOperLogDao is the data access object for table sys_oper_log.
// You can define custom methods on it to extend its functionality as you wish.
type v2SysOperLogDao struct {
internalV2SysOperLogDao
}
// V2SysOperLog is globally public accessible object for table sys_oper_log operations.
var V2SysOperLog = v2SysOperLogDao{
internal.NewV2SysOperLogDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2SysRoleDao is internal type for wrapping internal DAO implements.
type internalV2SysRoleDao = *internal.V2SysRoleDao
// v2SysRoleDao is the data access object for table sys_role.
// You can define custom methods on it to extend its functionality as you wish.
type v2SysRoleDao struct {
internalV2SysRoleDao
}
// V2SysRole is globally public accessible object for table sys_role operations.
var V2SysRole = v2SysRoleDao{
internal.NewV2SysRoleDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2SysRolePermissionDao is internal type for wrapping internal DAO implements.
type internalV2SysRolePermissionDao = *internal.V2SysRolePermissionDao
// v2SysRolePermissionDao is the data access object for table sys_role_permission.
// You can define custom methods on it to extend its functionality as you wish.
type v2SysRolePermissionDao struct {
internalV2SysRolePermissionDao
}
// V2SysRolePermission is globally public accessible object for table sys_role_permission operations.
var V2SysRolePermission = v2SysRolePermissionDao{
internal.NewV2SysRolePermissionDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2UserDao is internal type for wrapping internal DAO implements.
type internalV2UserDao = *internal.V2UserDao
// v2UserDao is the data access object for table user.
// You can define custom methods on it to extend its functionality as you wish.
type v2UserDao struct {
internalV2UserDao
}
// V2User is globally public accessible object for table user operations.
var V2User = v2UserDao{
internal.NewV2UserDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2UserLoginLogDao is internal type for wrapping internal DAO implements.
type internalV2UserLoginLogDao = *internal.V2UserLoginLogDao
// v2UserLoginLogDao is the data access object for table user_login_log.
// You can define custom methods on it to extend its functionality as you wish.
type v2UserLoginLogDao struct {
internalV2UserLoginLogDao
}
// V2UserLoginLog is globally public accessible object for table user_login_log operations.
var V2UserLoginLog = v2UserLoginLogDao{
internal.NewV2UserLoginLogDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2UserRoadDao is internal type for wrapping internal DAO implements.
type internalV2UserRoadDao = *internal.V2UserRoadDao
// v2UserRoadDao is the data access object for table user_road.
// You can define custom methods on it to extend its functionality as you wish.
type v2UserRoadDao struct {
internalV2UserRoadDao
}
// V2UserRoad is globally public accessible object for table user_road operations.
var V2UserRoad = v2UserRoadDao{
internal.NewV2UserRoadDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2UserWalletDao is internal type for wrapping internal DAO implements.
type internalV2UserWalletDao = *internal.V2UserWalletDao
// v2UserWalletDao is the data access object for table user_wallet.
// You can define custom methods on it to extend its functionality as you wish.
type v2UserWalletDao struct {
internalV2UserWalletDao
}
// V2UserWallet is globally public accessible object for table user_wallet operations.
var V2UserWallet = v2UserWalletDao{
internal.NewV2UserWalletDao(),
}
// Fill with you ideas below.

View File

@@ -1,25 +0,0 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"kami/internal/dao/internal"
)
// internalV2UserWalletLogDao is internal type for wrapping internal DAO implements.
type internalV2UserWalletLogDao = *internal.V2UserWalletLogDao
// v2UserWalletLogDao is the data access object for table user_wallet_log.
// You can define custom methods on it to extend its functionality as you wish.
type v2UserWalletLogDao struct {
internalV2UserWalletLogDao
}
// V2UserWalletLog is globally public accessible object for table user_wallet_log operations.
var V2UserWalletLog = v2UserWalletLogDao{
internal.NewV2UserWalletLogDao(),
}
// Fill with you ideas below.

View File

@@ -2,6 +2,7 @@ package account
import (
"context"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/database/gdb"

View File

@@ -3,6 +3,8 @@ package apple_card_account
import (
"context"
"database/sql"
"fmt"
"kami/api/commonApi"
"github.com/gogf/gf/errors/gcode"
@@ -20,6 +22,7 @@ import (
"kami/internal/model/do"
"kami/internal/model/entity"
"kami/internal/service"
"kami/utility/cache"
"kami/utility/config"
"kami/utility/utils"
)
@@ -86,7 +89,7 @@ func (a *sAppleAccount) AddWalletAmount(ctx context.Context, input model.AppleCa
if accountEntity.TodayRechargeAmount+input.Amount > consts.AppleCardMaxRechargeAmount {
accountEntity.Status = int(consts.AppleAccountLimited)
}
//冻结账号
// 冻结账号
if input.Amount < consts.AppleCardMinRechargeAmount {
accountEntity.Status = int(consts.AppleAccountForbiddenByLowRecharge)
}
@@ -192,13 +195,22 @@ func (a *sAppleAccount) IsUnscopedTodayRepeatedByName(ctx context.Context, accou
}
// GetAccordingAccount 轮播,获取符合条件的第一个账户
func (a *sAppleAccount) GetAccordingAccount(ctx context.Context) (data entity.V1CardAppleAccountInfo, err error) {
err = dao.V1CardAppleAccountInfo.Ctx(ctx).DB(config.GetDatabaseV1()).
Where(dao.V1CardAppleAccountInfo.Columns().Status, consts.AppleAccountNormal).
OrderAsc(dao.V1CardAppleAccountInfo.Columns().CreatedAt).Scan(&data)
if gerror.Equal(err, sql.ErrNoRows) {
err = nil
func (a *sAppleAccount) GetAccordingAccount(ctx context.Context, machineId string) (data *entity.V1CardAppleAccountInfo, err error) {
// 往缓存里设置当前操作账号
v, err := cache.NewCache().Get(ctx, fmt.Sprintf("Machine:%s", machineId))
if err != nil {
return
}
m := dao.V1CardAppleAccountInfo.Ctx(ctx).DB(config.GetDatabaseV1())
if !v.IsNil() {
m = m.Where(dao.V1CardAppleAccountInfo.Columns().CreatedUserId, v.String())
}
err = m.Where(dao.V1CardAppleAccountInfo.Columns().Status, consts.AppleAccountNormal).
OrderAsc(dao.V1CardAppleAccountInfo.Columns().CreatedAt).Limit(1).Scan(&data)
// 查询不到当前用户下的其余订单,查找最早的订单
if data == nil || data.Id == "" {
}
cache.NewCache().Set(ctx, fmt.Sprintf("Machine:%s", machineId), data, 0)
return
}
@@ -228,7 +240,7 @@ func (a *sAppleAccount) GetListByStatus(ctx context.Context, status consts.Apple
// ResetStatus 重置账号状态
func (a *sAppleAccount) ResetStatus(ctx context.Context) (err error) {
err = config.GetDatabaseV1().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
//所有账户今日交易量和交易订单金额清零
// 所有账户今日交易量和交易订单金额清零
_, err2 := dao.V1CardAppleAccountInfo.Ctx(ctx).TX(tx).DB(config.GetDatabaseV1()).
Update(do.V1CardAppleAccountInfo{
TodayRechargeAmount: 0,
@@ -237,7 +249,7 @@ func (a *sAppleAccount) ResetStatus(ctx context.Context) (err error) {
if err != nil {
return err2
}
//所有交易满额的账户取消限制
// 所有交易满额的账户取消限制
_, err2 = dao.V1CardAppleAccountInfo.Ctx(ctx).TX(tx).DB(config.GetDatabaseV1()).
Where(dao.V1CardAppleAccountInfo.Columns().Status, consts.AppleAccountLimited).
Update(do.V1CardAppleAccountInfo{

View File

@@ -1,13 +1,14 @@
package apple_card_account
import (
"testing"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"kami/api/commonApi"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/test/gtest"
"kami/internal/model"
"testing"
)
func Test_sAppleAccount_AddWalletAmount(t *testing.T) {

View File

@@ -5,10 +5,11 @@ import (
"database/sql"
"fmt"
"io"
"time"
"kami/internal/err_handler"
"kami/utility/pool"
"kami/utility/utils"
"time"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/util/grand"
@@ -42,8 +43,7 @@ func New() *sRechargeHistory {
return &sRechargeHistory{}
}
type sRechargeHistory struct {
}
type sRechargeHistory struct{}
// List 获取充值列表
func (h *sRechargeHistory) List(ctx context.Context, input model.AppleCardRechargeParamsInput) (total int, data []entity.V1CardAppleRechargeInfo, err error) {
@@ -123,7 +123,7 @@ func (h *sRechargeHistory) AddRechargeOrder(ctx context.Context, input model.App
orderNo = h.generateOrderNo(ctx)
status := consts.AppleRechargeOrderWaiting
operation := consts.AppleRechargeOperationCreated
//处理二次提交的订单
// 处理二次提交的订单
if targetEntity, _ := h.QueryOneByCardPass(ctx, input.CardPass, nil); targetEntity.Id != 0 && targetEntity.Status == int(consts.AppleRechargeOrderAmountDifferent) {
status = consts.AppleRechargeOrderCardNoOrCardPassDuplicated
operation = consts.AppleRechargeOperationDuplicatedOrder
@@ -164,12 +164,23 @@ func (h *sRechargeHistory) AddRechargeOrder(ctx context.Context, input model.App
// DistributionAccordingAccount 给指定订单分配一个账户
func (h *sRechargeHistory) DistributionAccordingAccount(ctx context.Context, accountId, accountName, orderNo string) (err error) {
_, err = dao.V1CardAppleRechargeInfo.Ctx(ctx).DB(config.GetDatabaseV1()).
Where(dao.V1CardAppleRechargeInfo.Columns().OrderNo, orderNo).
Update(do.V1CardAppleRechargeInfo{
m := dao.V1CardAppleRechargeInfo.Ctx(ctx).DB(config.GetDatabaseV1()).Where(dao.V1CardAppleRechargeInfo.Columns().OrderNo, orderNo)
err = m.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
_, err2 := m.Update(do.V1CardAppleRechargeInfo{
AccountId: accountId,
AccountName: accountName,
})
if err2 != nil {
return err2
}
_, err2 = m.Update(g.Map{
dao.V1CardAppleRechargeInfo.Columns().DistributionCount: gdb.Counter{
Field: dao.V1CardAppleRechargeInfo.Columns().DistributionCount,
Value: 1,
},
})
return err2
})
return err
}
@@ -314,7 +325,7 @@ func (h *sRechargeHistory) GetRechargeDetails(ctx context.Context, orderNo strin
// GetListByStatus 获取指定状态的订单
func (h *sRechargeHistory) GetListByStatus(ctx context.Context, statusList []consts.AppleRechargeOrderStatus) (data entity.V1CardAppleRechargeInfo, err error) {
//切片
// 切片
err = dao.V1CardAppleRechargeInfo.Ctx(ctx).DB(config.GetDatabaseV1()).
WhereIn(dao.V1CardAppleRechargeInfo.Columns().Status, statusList).
Scan(&data)

View File

@@ -2,8 +2,9 @@ package apple_card_recharge_history
import (
"fmt"
"github.com/gogf/gf/v2/os/gctx"
"testing"
"github.com/gogf/gf/v2/os/gctx"
)
func Test_sRechargeHistory_ValidateCardPass(t *testing.T) {

View File

@@ -18,8 +18,8 @@ func New() *sCaptcha {
driver: &base64Captcha.DriverMath{
Height: 30,
Width: 88,
//NoiseCount: 10,
//ShowLineOptions: 10,
// NoiseCount: 10,
// ShowLineOptions: 10,
Fonts: []string{"chromohv.ttf"},
},
store: base64Captcha.DefaultMemStore,

View File

@@ -10,7 +10,6 @@ import (
"kami/internal/model"
"kami/internal/model/entity"
"kami/utility/lib/libErr"
)
func (s *sEntrance) AddUserEntrance(ctx context.Context, data model.EntranceUserRoadInput) error {

View File

@@ -17,7 +17,6 @@ import (
"kami/internal/service"
"kami/utility/config"
"kami/utility/utils"
)
func init() {

View File

@@ -3,6 +3,7 @@ package order
import (
"context"
"fmt"
"kami/internal/dao"
"kami/internal/model"
"kami/internal/service"

View File

@@ -2,13 +2,14 @@ package order
import (
"fmt"
"testing"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
"kami/api/commonApi"
v1 "kami/api/order/v1"
"kami/internal/model"
"github.com/gogf/gf/v2/os/gctx"
"testing"
)
func Test_sOrderSummary_GetList(t *testing.T) {
@@ -23,6 +24,5 @@ func Test_sOrderSummary_GetList(t *testing.T) {
})
for _, v := range result {
fmt.Println(fmt.Sprintf("%+v", v))
}
}

View File

@@ -3,6 +3,7 @@ package sysAuthRule
import (
"context"
"fmt"
"kami/internal/dao"
"kami/internal/model"
"kami/internal/model/do"
@@ -25,8 +26,7 @@ func New() *sSysAuthRule {
return &sSysAuthRule{}
}
type sSysAuthRule struct {
}
type sSysAuthRule struct{}
func (s *sSysAuthRule) GetMenuListSearch(ctx context.Context, req *model.RuleSearchInput) (res []*model.SysAuthRuleInfoOutput, err error) {
m := dao.V1SysAuthRule.Ctx(ctx).DB(config.GetDatabaseV1())
@@ -47,7 +47,7 @@ func (s *sSysAuthRule) GetIsMenuList(ctx context.Context) ([]*model.SysAuthRuleI
if err != nil {
return nil, err
}
var gList = make([]*model.SysAuthRuleInfoOutput, 0, len(list))
gList := make([]*model.SysAuthRuleInfoOutput, 0, len(list))
for _, v := range list {
if v.MenuType == 0 || v.MenuType == 1 {
gList = append(gList, v)
@@ -69,7 +69,7 @@ func (s *sSysAuthRule) GetMenuList(ctx context.Context) (list []*model.SysAuthRu
// 从数据库获取所有菜单
func (s *sSysAuthRule) getMenuListFromDb(ctx context.Context) (value interface{}, err error) {
var v []*model.SysAuthRuleInfoOutput
//从数据库获取
// 从数据库获取
err = dao.V1SysAuthRule.Ctx(ctx).
Fields(model.SysAuthRuleInfoOutput{}).Order("weigh desc,id asc").Scan(&v)
value = v
@@ -82,7 +82,7 @@ func (s *sSysAuthRule) GetIsButtonList(ctx context.Context) ([]*model.SysAuthRul
if err != nil {
return nil, err
}
var gList = make([]*model.SysAuthRuleInfoOutput, 0, len(list))
gList := make([]*model.SysAuthRuleInfoOutput, 0, len(list))
for _, v := range list {
if v.MenuType == 2 {
gList = append(gList, v)
@@ -98,7 +98,7 @@ func (s *sSysAuthRule) Add(ctx context.Context, req *model.RuleAddReq) (err erro
return
}
err = config.GetDatabaseV1().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
//菜单数据
// 菜单数据
ruleId, err := dao.V1SysAuthRule.Ctx(ctx).TX(tx).DB(config.GetDatabaseV1()).
InsertAndGetId(do.V1SysAuthRule{
Pid: req.Pid,
@@ -217,7 +217,7 @@ func (s *sSysAuthRule) UpdateRoleRule(ctx context.Context, ruleId uint, roleIds
if err != nil {
return
}
//删除旧权限
// 删除旧权限
_, err = enforcer.RemoveFilteredPolicy(1, gconv.String(ruleId))
if err != nil {
return
@@ -268,7 +268,7 @@ func (s *sSysAuthRule) DeleteMenuByIds(ctx context.Context, ids []int) (err erro
return err
}
casbinService := service.Casbin()
//删除权限
// 删除权限
enforcer, err := casbinService.CasbinEnforcer(ctx)
if err != nil {
return err

View File

@@ -2,6 +2,8 @@ package sys_casbin
import (
"context"
"sync"
"github.com/casbin/casbin/v2"
"github.com/casbin/casbin/v2/model"
"github.com/casbin/casbin/v2/persist"
@@ -10,7 +12,6 @@ import (
"kami/internal/dao"
"kami/internal/model/entity"
"kami/internal/service"
"sync"
)
func init() {
@@ -142,7 +143,8 @@ func (s *sCasbin) RemovePolicies(sec string, ptype string, rules [][]string) err
// RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (s *sCasbin) RemoveFilteredPolicy(sec, ptype string,
fieldIndex int, fieldValues ...string) error {
fieldIndex int, fieldValues ...string,
) error {
line := &entity.V1SysCasbinRule{}
line.Ptype = ptype
if fieldIndex <= 0 && 0 < fieldIndex+len(fieldValues) {

View File

@@ -27,7 +27,7 @@ func (s *sSysLoginLog) Invoke(ctx context.Context, data *model.LoginLogParams) {
_ = s.Pool.Add(
ctx,
func(ctx context.Context) {
//写入日志数据
// 写入日志数据
service.SysUser().LoginLog(ctx, data)
},
)

View File

@@ -2,6 +2,7 @@ package sysRule
import (
"context"
"kami/internal/dao"
"kami/internal/model"
"kami/internal/model/do"
@@ -23,8 +24,7 @@ func New() *sSysRole {
return &sSysRole{}
}
type sSysRole struct {
}
type sSysRole struct{}
func (s *sSysRole) GetRoleListSearch(ctx context.Context, req *model.RoleListInput) (res *model.RoleListOutput, err error) {
res = new(model.RoleListOutput)
@@ -58,7 +58,7 @@ func (s *sSysRole) GetRoleList(ctx context.Context) (list []*entity.V1SysRole, e
// 从数据库获取所有角色
func (s *sSysRole) getRoleListFromDb(ctx context.Context) (value interface{}, err error) {
var v []*entity.V1SysRole
//从数据库获取
// 从数据库获取
err = dao.V1SysRole.Ctx(ctx).DB(config.GetDatabaseV1()).
OrderAsc(dao.V1SysRole.Columns().ListOrder).
OrderAsc(dao.V1SysRole.Columns().Id).
@@ -103,7 +103,7 @@ func (s *sSysRole) AddRole(ctx context.Context, req *model.RoleAddInput) (err er
if err2 != nil {
return
}
//添加角色权限
// 添加角色权限
err2 = s.AddRoleRule(ctx, req.MenuIds, roleId)
if err2 != nil {
return
@@ -148,14 +148,14 @@ func (s *sSysRole) EditRole(ctx context.Context, req *model.RoleEditInput) (err
if err != nil {
return
}
//删除角色权限
// 删除角色权限
err = s.DelRoleRule(ctx, req.Id)
if err != nil {
return
}
//添加角色权限
// 添加角色权限
err = s.AddRoleRule(ctx, req.MenuIds, req.Id)
//清除缓存
// 清除缓存
return
}
@@ -166,14 +166,14 @@ func (s *sSysRole) DeleteByIds(ctx context.Context, ids []int64) (err error) {
if err != nil {
return err
}
//删除角色权限
// 删除角色权限
for _, v := range ids {
err = s.DelRoleRule(ctx, v)
if err != nil {
return err
}
}
//清除缓存
// 清除缓存
return nil
})
return

View File

@@ -3,6 +3,7 @@ package sysUser
import (
"context"
"fmt"
v1 "kami/api/sys_user_login/v1"
"kami/internal/dao"
"kami/internal/err_handler"
@@ -33,7 +34,7 @@ func init() {
}
type sSysUser struct {
casBinUserPrefix string //CasBin 用户id前缀
casBinUserPrefix string // CasBin 用户id前缀
}
func New() *sSysUser {
@@ -60,7 +61,7 @@ func (s *sSysUser) GetAdminUserByUsernamePassword(ctx context.Context, req *mode
err = gerror.NewCode(gcode.CodeNotAuthorized, "账户名错误")
return
}
//验证密码
// 验证密码
if utils.EncryptPassword(req.Password, user.UserSalt) != user.UserPassword {
err = gerror.NewCode(gcode.CodeNotAuthorized, "密码错误")
return
@@ -96,7 +97,7 @@ func (s *sSysUser) LoginLog(ctx context.Context, params *model.LoginLogParams) {
_, err := dao.V1SysUserLoginLog.Ctx(ctx).DB(config.GetDatabaseV1()).Insert(&do.V1SysUserLoginLog{
LoginName: params.Username,
IpAddr: params.Ip,
//LoginLocation: utils.GetCityByIp(params.Ip),
// LoginLocation: utils.GetCityByIp(params.Ip),
Browser: browser,
Os: ua.OS(),
Status: params.Status,
@@ -123,7 +124,7 @@ func (s *sSysUser) LoginLog(ctx context.Context, params *model.LoginLogParams) {
// GetAdminRules 获取用户菜单数据
func (s *sSysUser) GetAdminRules(ctx context.Context, userId string) (menuList []*model.UserMenus, permissions []string, err error) {
isSuperAdmin := false
//获取无需验证权限的用户id
// 获取无需验证权限的用户id
s.NotCheckAuthAdminIds(ctx).Iterator(func(v interface{}) bool {
if v == userId {
isSuperAdmin = true
@@ -131,7 +132,7 @@ func (s *sSysUser) GetAdminRules(ctx context.Context, userId string) (menuList [
}
return true
})
//获取用户菜单数据
// 获取用户菜单数据
allRoles, err := service.SysRole().GetRoleList(ctx)
if err != nil {
return
@@ -146,9 +147,9 @@ func (s *sSysUser) GetAdminRules(ctx context.Context, userId string) (menuList [
name[k] = v.Name
roleIds[k] = v.Id
}
//获取菜单信息
// 获取菜单信息
if isSuperAdmin {
//超管获取所有菜单
// 超管获取所有菜单
permissions = []string{"*/*/*"}
menuList, err = s.GetAllMenus(ctx)
if err != nil {
@@ -195,14 +196,14 @@ func (s *sSysUser) GetAdminRoleIds(ctx context.Context, userId string) (roleIds
if err != nil {
return
}
//查询关联角色规则
// 查询关联角色规则
groupPolicy, err := enforcer.GetFilteredGroupingPolicy(0, fmt.Sprintf("%s%d", s.casBinUserPrefix, userId))
if err != nil {
return
}
if len(groupPolicy) > 0 {
roleIds = make([]uint, len(groupPolicy))
//得到角色id的切片
// 得到角色id的切片
for k, v := range groupPolicy {
roleIds[k] = gconv.Uint(v[1])
}
@@ -211,7 +212,7 @@ func (s *sSysUser) GetAdminRoleIds(ctx context.Context, userId string) (roleIds
}
func (s *sSysUser) GetAllMenus(ctx context.Context) (menus []*model.UserMenus, err error) {
//获取所有开启的菜单
// 获取所有开启的菜单
var allMenus []*model.SysAuthRuleInfoOutput
allMenus, err = service.SysAuthRule().GetIsMenuList(ctx)
if err != nil {
@@ -228,7 +229,7 @@ func (s *sSysUser) GetAllMenus(ctx context.Context) (menus []*model.UserMenus, e
}
func (s *sSysUser) GetAdminMenusByRoleIds(ctx context.Context, roleIds []uint) (menus []*model.UserMenus, err error) {
//获取角色对应的菜单id
// 获取角色对应的菜单id
casbinService := service.Casbin()
enforcer, err := casbinService.CasbinEnforcer(ctx)
if err != nil {
@@ -236,7 +237,7 @@ func (s *sSysUser) GetAdminMenusByRoleIds(ctx context.Context, roleIds []uint) (
}
menuIds := map[int64]int64{}
for _, roleId := range roleIds {
//查询当前权限
// 查询当前权限
gp, err2 := enforcer.GetFilteredPolicy(0, gconv.String(roleId))
if err2 != nil {
return menus, err2
@@ -246,7 +247,7 @@ func (s *sSysUser) GetAdminMenusByRoleIds(ctx context.Context, roleIds []uint) (
menuIds[mid] = mid
}
}
//获取所有开启的菜单
// 获取所有开启的菜单
allMenus, err := service.SysAuthRule().GetIsMenuList(ctx)
if err != nil {
return
@@ -300,7 +301,7 @@ func (s *sSysUser) setMenuData(menu *model.UserMenu, entity *model.SysAuthRuleIn
}
func (s *sSysUser) GetPermissions(ctx context.Context, roleIds []uint) (userButtons []string, err error) {
//获取角色对应的菜单id
// 获取角色对应的菜单id
casbinService := service.Casbin()
enforcer, err := casbinService.CasbinEnforcer(ctx)
if err != nil {
@@ -308,7 +309,7 @@ func (s *sSysUser) GetPermissions(ctx context.Context, roleIds []uint) (userButt
}
menuIds := map[int64]int64{}
for _, roleId := range roleIds {
//查询当前权限
// 查询当前权限
gp, err2 := enforcer.GetFilteredPolicy(0, gconv.String(roleId))
if err2 != nil {
return userButtons, err2
@@ -318,7 +319,7 @@ func (s *sSysUser) GetPermissions(ctx context.Context, roleIds []uint) (userButt
menuIds[mid] = mid
}
}
//获取所有开启的按钮
// 获取所有开启的按钮
allButtons, err := service.SysAuthRule().GetIsButtonList(ctx)
if err != nil {
return
@@ -395,7 +396,7 @@ func (s *sSysUser) Edit(ctx context.Context, req *model.UserEditInput) (err erro
// if err != nil {
// return err
// }
//设置用户所属角色信息
// 设置用户所属角色信息
// err = s.EditUserRole(ctx, req.RoleIds, req.UserId)
// if err != nil {
// return err
@@ -428,7 +429,7 @@ func (s *sSysUser) EditUserRole(ctx context.Context, roleIds []int64, userId int
if err != nil {
return
}
//删除用户旧角色信息
// 删除用户旧角色信息
_, _ = enforcer.RemoveFilteredGroupingPolicy(0, fmt.Sprintf("%s%d", s.casBinUserPrefix, userId))
for _, v := range roleIds {
_, err = enforcer.AddGroupingPolicy(fmt.Sprintf("%s%d", s.casBinUserPrefix, userId), gconv.String(v))
@@ -466,12 +467,12 @@ func (s *sSysUser) UserNameOrMobileExists(ctx context.Context, userName string,
// GetEditUser 获取编辑用户信息
func (s *sSysUser) GetEditUser(ctx context.Context, id string) (res *model.UserGetEditOutput, err error) {
res = new(model.UserGetEditOutput)
//获取用户信息
// 获取用户信息
res.User, err = s.GetUserInfoById(ctx, id)
if err != nil {
return
}
//获取已选择的角色信息
// 获取已选择的角色信息
res.CheckedRoleIds, err = s.GetAdminRoleIds(ctx, id)
return
}
@@ -479,10 +480,10 @@ func (s *sSysUser) GetEditUser(ctx context.Context, id string) (res *model.UserG
// GetUserInfoById 通过Id获取用户信息
func (s *sSysUser) GetUserInfoById(ctx context.Context, id string, withPwd ...bool) (user *entity.V1SysUser, err error) {
if len(withPwd) > 0 && withPwd[0] {
//用户用户信息
// 用户用户信息
err = dao.V1SysUser.Ctx(ctx).DB(config.GetDatabaseV1()).Where(dao.V1SysUser.Columns().Id, id).Scan(&user)
} else {
//用户用户信息
// 用户用户信息
err = dao.V1SysUser.Ctx(ctx).DB(config.GetDatabaseV1()).Where(dao.V1SysUser.Columns().Id, id).
FieldsEx(dao.V1SysUser.Columns().UserPassword, dao.V1SysUser.Columns().UserSalt).Scan(&user)
}
@@ -522,7 +523,7 @@ func (s *sSysUser) Delete(ctx context.Context, ids []string) (err error) {
return err
}
casbinService := service.Casbin()
//删除对应权限
// 删除对应权限
enforcer, err2 := casbinService.CasbinEnforcer(ctx)
if err2 != nil {
return err2
@@ -546,6 +547,13 @@ func (s *sSysUser) GetUsers(ctx context.Context, ids []int) (users []*model.SysU
return
}
// 获取所有用户
func (s *sSysUser) GetUsersAll(ctx context.Context) (users []*model.SysUserSimpleOutput, err error) {
err = dao.V1SysUser.Ctx(ctx).DB(config.GetDatabaseV1()).OrderAsc(dao.V1SysUser.Columns().Id).
Scan(&users)
return
}
func (s *sSysUser) GetUserIdFromToken(ctx context.Context) (needAuth bool, userId string, err error) {
tokenFrom := g.RequestFromCtx(ctx).Request.Header.Get("tokenFrom")
needAuth = false

View File

@@ -32,7 +32,6 @@ func (c *sUserCenter) GetUserByUserNameOrPhone(ctx context.Context, userInfo ent
err = dao.V2User.Ctx(ctx).
Where(dao.V2User.Columns().Username, userInfo.Username).
WhereOr(dao.V2User.Columns().Phone, userInfo.Phone).Scan(&user)
if err != nil {
return user, gerror.New("用户查找失败")
}

View File

@@ -1,10 +1,11 @@
package middleware
import (
"kami/internal/err_handler"
"strconv"
"time"
"kami/internal/err_handler"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/net/ghttp"
@@ -76,7 +77,7 @@ func iFrameAuth(r *ghttp.Request) gcode.Code {
glog.Error(ctx, "解析Token错误", tokenStr, err)
return gcode.New(err_handler.ErrTokenError.Code(), "Token格式错误!", nil)
}
//字符串转数字
// 字符串转数字
timestamp, err := strconv.ParseInt(string(tokenByte), 10, 64)
if err != nil {
glog.Error(ctx, "解析Token错误", tokenStr, err)

View File

@@ -83,7 +83,7 @@ type AppleCardAccountHistoryInput struct {
Amount float64 `json:"amount"`
BalanceBeforeItunes float64 `json:"balanceBefore" description:"充值前金额"`
BalanceFromItunes float64 `json:"balanceFromItunes" description:"itunes充值金额"`
//BalanceFromAutoincrement float64 `json:"balanceFromAutoincrement" description:"itunes计算充值金额"`
// BalanceFromAutoincrement float64 `json:"balanceFromAutoincrement" description:"itunes计算充值金额"`
TransactionType string `json:"transactionType" description:"交易类型"`
Description string `json:"description"`
}

View File

@@ -11,23 +11,24 @@ import (
// V1CardAppleRechargeInfo is the golang structure of table card_apple_recharge_info for DAO operations like Where/Data.
type V1CardAppleRechargeInfo struct {
g.Meta `orm:"table:card_apple_recharge_info, do:true"`
Id interface{} //
OrderNo interface{} // 订单号
AccountId interface{} //
AccountName interface{} //
CardNo interface{} // 卡号
CardPass interface{} // 卡密
Balance interface{} // 余额
CardAmount interface{} // 卡面充值金额
Status interface{} // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
ActualAmount interface{} // 实际充值金额
CallbackUrl interface{} //
CallbackCount interface{} // itunes回调次数
CreatedUserId interface{} // 创建者ID
Attach interface{} //
Remark interface{} //
CreatedAt *gtime.Time // 创建日期
UpdatedAt *gtime.Time // 更新日期
DeletedAt *gtime.Time // 删除日期
g.Meta `orm:"table:card_apple_recharge_info, do:true"`
Id interface{} //
OrderNo interface{} // 订单号
AccountId interface{} //
AccountName interface{} //
CardNo interface{} // 卡号
CardPass interface{} // 卡密
Balance interface{} // 余额
CardAmount interface{} // 卡面充值金额
Status interface{} // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
ActualAmount interface{} // 实际充值金额
CallbackUrl interface{} //
CallbackCount interface{} // itunes回调次数
CreatedUserId interface{} // 创建者ID
Attach interface{} //
Remark interface{} //
CreatedAt *gtime.Time // 创建日期
UpdatedAt *gtime.Time // 更新日期
DeletedAt *gtime.Time // 删除日期
DistributionCount interface{} // 分配次数
}

View File

@@ -1,28 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2CardAppleRechargeInfo is the golang structure of table card_apple_recharge_info for DAO operations like Where/Data.
type V2CardAppleRechargeInfo struct {
g.Meta `orm:"table:card_apple_recharge_info, do:true"`
Id interface{} //
OrderNo interface{} // 订单号
AccountId interface{} //
CardNo interface{} // 卡号
CardPass interface{} // 卡密
Balance interface{} // 余额
Amount interface{} // 充值金额
Status interface{} // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
CreatedAt *gtime.Time // 创建日期
UpdatedAt *gtime.Time // 更新日期
DeletedAt *gtime.Time // 删除日期
CallbackUrl interface{} //
Attach interface{} //
}

View File

@@ -1,52 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2OrderInfo is the golang structure of table order_info for DAO operations like Where/Data.
type V2OrderInfo struct {
g.Meta `orm:"table:order_info, do:true"`
Id interface{} // 主键,自增
MerchantOrderId interface{} // 下游商户提交过来的订单id
ShopName interface{} // 商品名称
OrderPeriod interface{} // 订单有效时间,小时制
BankOrderId interface{} // 平台自身的订单id
BankTransId interface{} // 上游返回的订单id
OrderAmount interface{} // 订单提交金额
ShowAmount interface{} // 展示在用户面前待支付的金额
FactAmount interface{} // 实际支付金额
RollPoolCode interface{} // 轮询产品编码
RollPoolName interface{} // 轮询产品名称
RoadUid interface{} // 通道uid
RoadName interface{} // 通道名称
PayProductCode interface{} // 支付产品编码
PayProductName interface{} // 支付产品名称
PayTypeCode interface{} // 支付类型编码
PayTypeName interface{} // 支付类型名称
OsType interface{} // 平台类型苹果app-0 安卓app-1苹果H5-3安卓H5-4pc-5
Status interface{} // 等待支付-wait,支付成功-success, 支付失败-failed
Refund interface{} // 退款-yes 没有退款-no
RefundTime interface{} // 退款时间
Freeze interface{} // 冻结-yes 没有-no
FreezeTime interface{} // 冻结时间
Unfreeze interface{} // 解冻-yes没有-no
UnfreezeTime interface{} // 解冻时间
NotifyUrl interface{} // 订单回调给下游的地址
MerchantUid interface{} // 商户uid表示订单是哪个商户的
MerchantName interface{} // 商户名称
AgentUid interface{} // 代理uid表示该商户是谁的代理
AgentName interface{} // 代理名称
Response interface{} // 上游返回的结果
UpdateTime *gtime.Time // 更新时间
CreateTime *gtime.Time // 创建时间
ExValue interface{} //
CardData interface{} //
Operator interface{} //
CardReturnData interface{} //
}

View File

@@ -1,24 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2OrderNotifyLog is the golang structure of table order_notify_log for DAO operations like Where/Data.
type V2OrderNotifyLog struct {
g.Meta `orm:"table:order_notify_log, do:true"`
Id interface{} // 主键,自增
OrderId interface{} // 系统订单id
Status interface{} // 状态字段
Num interface{} // 回调次数
Url interface{} // 回调的url
Response interface{} // 回调返回的结果
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 删除时间
}

View File

@@ -1,38 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2RoadInfo is the golang structure of table road_info for DAO operations like Where/Data.
type V2RoadInfo struct {
g.Meta `orm:"table:road_info, do:true"`
Id interface{} // 主键,自增
Name interface{} // 通道名称
PayType interface{} // 支付类型
ServiceFee interface{} // 代付手续费
TotalLimit interface{} // 通道总额度
AllowedMm interface{} // 允许面额
StartHour interface{} // 通道开始时间
EndHour interface{} // 通道结束时间
TodayIncome interface{} // 当天的收入
TotalIncome interface{} // 通道总收入
TodayProfit interface{} // 当天的收益
TotalProfit interface{} // 通道总收益
Balance interface{} // 通道的余额
RequestAll interface{} // 请求总次数
RequestSuccess interface{} // 请求成功次数
TodayRequestAll interface{} //
TodayRequestSuccess interface{} //
Params interface{} // 参数json格式
Remark interface{} // 备注
Status interface{} //
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 删除时间
}

View File

@@ -1,28 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2SysAuthRule is the golang structure of table sys_auth_rule for DAO operations like Where/Data.
type V2SysAuthRule struct {
g.Meta `orm:"table:sys_auth_rule, do:true"`
Id interface{} //
Pid interface{} // 父ID
Name interface{} // 规则名称
Title interface{} // 规则名称
MenuType interface{} // 类型 0目录 1菜单 2按钮
Weigh interface{} // 权重
IsHide interface{} // 显示状态
Path interface{} // 路由地址
IdAdmin interface{} // 是否管理员独享 1是2.否
Component interface{} // 组件路径
CreatedAt *gtime.Time // 创建日期
UpdatedAt *gtime.Time // 修改日期
DeletedAt *gtime.Time //
}

View File

@@ -1,25 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2SysConfig is the golang structure of table sys_config for DAO operations like Where/Data.
type V2SysConfig struct {
g.Meta `orm:"table:sys_config, do:true"`
ConfigId interface{} // 参数主键
ConfigName interface{} // 参数名称
ConfigKey interface{} // 参数键名
ConfigValue interface{} // 参数键值
ConfigType interface{} // 系统内置Y是 N否
CreateBy interface{} // 创建者
UpdateBy interface{} // 更新者
Remark interface{} // 备注
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 修改时间
}

View File

@@ -1,29 +0,0 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// V2SysOperLog is the golang structure of table sys_oper_log for DAO operations like Where/Data.
type V2SysOperLog struct {
g.Meta `orm:"table:sys_oper_log, do:true"`
OperId interface{} // 日志主键
Title interface{} // 模块标题
BusinessType interface{} // 业务类型0其它 1新增 2修改 3删除
Method interface{} // 方法名称
RequestMethod interface{} // 请求方式
OperatorType interface{} // 操作类别0其它 1后台用户 2手机端用户
OperName interface{} // 操作人员
DeptName interface{} // 部门名称
OperUrl interface{} // 请求URL
OperIp interface{} // 主机地址
OperLocation interface{} // 操作地点
OperParam interface{} // 请求参数
ErrorMsg interface{} // 错误消息
OperTime *gtime.Time // 操作时间
}

Some files were not shown because too many files have changed in this diff Show More