修改了关联时间字段

This commit is contained in:
2024-08-08 17:24:02 +08:00
parent fc835fbc6d
commit b2c1f0ee44
25 changed files with 141 additions and 165 deletions
+16 -17
View File
@@ -4,29 +4,28 @@ import (
"fmt"
"hepa-calc-api/api/model"
"hepa-calc-api/utils"
"time"
)
type WxDto struct {
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
OpenId string `json:"open_id"` // 用户微信标识
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *time.Time `json:"member_expire_date"` // 会员到期时间(非会员时为null)
Token string `json:"token"` // token
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
OpenId string `json:"open_id"` // 用户微信标识
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *model.LocalTime `json:"member_expire_date"` // 会员到期时间(非会员时为null)
Token string `json:"token"` // token
}
type MobileDto struct {
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
OpenId string `json:"open_id"` // 用户微信标识
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *time.Time `json:"member_expire_date"` // 会员到期时间(非会员时为null)
Token string `json:"token"` // token
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
OpenId string `json:"open_id"` // 用户微信标识
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *model.LocalTime `json:"member_expire_date"` // 会员到期时间(非会员时为null)
Token string `json:"token"` // token
}
// LoginWxDto 微信登陆
+7 -8
View File
@@ -5,7 +5,6 @@ import (
"github.com/wechatpay-apiv3/wechatpay-go/services/payments/app"
"github.com/wechatpay-apiv3/wechatpay-go/services/payments/jsapi"
"hepa-calc-api/api/model"
"time"
)
// OrderMemberDto 订单-会员
@@ -17,7 +16,7 @@ type OrderMemberDto struct {
IsDelete int `json:"is_delete"` // 用户删除状态(0:否 1:是)
PayChannel int `json:"pay_channel"` // 支付渠道(1:h5支付 2:app支付 3:会员支付)
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PayTime *time.Time `json:"pay_time"` // 支付时间
PayTime *model.LocalTime `json:"pay_time"` // 支付时间
RefundStatus int `json:"refund_status"` // 订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常 7:部分退款)
OrderNo string `json:"order_no"` // 系统订单编号
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
@@ -25,7 +24,7 @@ type OrderMemberDto struct {
CouponAmountTotal float64 `json:"coupon_amount_total"` // 优惠卷总金额
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
CancelStatus int `json:"cancel_status"` // 取消状态(0:否 1:是)
CancelTime *time.Time `json:"cancel_time"` // 订单取消时间
CancelTime *model.LocalTime `json:"cancel_time"` // 订单取消时间
CancelRemarks string `json:"cancel_remarks"` // 取消订单备注
OrderRemarks string `json:"order_remarks"` // 订单备注
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
@@ -48,9 +47,9 @@ type OrderMemberPayDto struct {
// OrderMemberPayStatusDto 会员订单支付状态
type OrderMemberPayStatusDto struct {
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
ValidDate model.LocalTime `json:"valid_date"` // 到期时间
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
ValidDate *model.LocalTime `json:"valid_date"` // 到期时间
}
// GetOrderMemberListDto 列表
@@ -126,9 +125,9 @@ func (r *OrderMemberDto) LoadSystemMember(m *model.SystemMember) *OrderMemberDto
}
// LoadValidDate 加载到期时间
func (r *OrderMemberPayStatusDto) LoadValidDate(m *time.Time) *OrderMemberPayStatusDto {
func (r *OrderMemberPayStatusDto) LoadValidDate(m *model.LocalTime) *OrderMemberPayStatusDto {
if m != nil {
r.ValidDate = model.LocalTime(*m)
r.ValidDate = m
}
return r
}
+27 -33
View File
@@ -5,32 +5,32 @@ import (
"github.com/wechatpay-apiv3/wechatpay-go/services/payments/app"
"github.com/wechatpay-apiv3/wechatpay-go/services/payments/jsapi"
"hepa-calc-api/api/model"
"time"
)
// OrderSingleDto 订单-单项
type OrderSingleDto struct {
OrderId string `json:"order_id"` // 主键id
UserId string `json:"user_id"` // 用户id
QuestionId string `json:"question_id"` // 问题id
OrderStatus int `json:"order_status"` // 订单状态(1:待支付 2:已完成 3:已取消)
IsDelete int `json:"is_delete"` // 用户删除状态(0:否 1:是)
PayChannel int `json:"pay_channel"` // 支付渠道(1:h5支付 2:app支付 3:会员支付)
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PayTime *time.Time `json:"pay_time"` // 支付时间
RefundStatus int `json:"refund_status"` // 订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常 7:部分退款)
OrderNo string `json:"order_no"` // 系统订单编号
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
AmountTotal float64 `json:"amount_total"` // 订单金额
CouponAmountTotal float64 `json:"coupon_amount_total"` // 优惠卷总金额
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
CancelStatus int `json:"cancel_status"` // 取消状态(0:否 1:是)
CancelTime *time.Time `json:"cancel_time"` // 订单取消时间
CancelRemarks string `json:"cancel_remarks"` // 取消订单备注
OrderRemarks string `json:"order_remarks"` // 订单备注
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
Question *QuestionDto `json:"question"` // 问题
OrderId string `json:"order_id"` // 主键id
UserId string `json:"user_id"` // 用户id
QuestionId string `json:"question_id"` // 问题id
OrderStatus int `json:"order_status"` // 订单状态(1:待支付 2:已完成 3:已取消)
IsDelete int `json:"is_delete"` // 用户删除状态(0:否 1:是)
PayChannel int `json:"pay_channel"` // 支付渠道(1:h5支付 2:app支付 3:会员支付)
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PayTime *model.LocalTime `json:"pay_time"` // 支付时间
RefundStatus int `json:"refund_status"` // 订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常 7:部分退款)
OrderNo string `json:"order_no"` // 系统订单编号
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
AmountTotal float64 `json:"amount_total"` // 订单金额
CouponAmountTotal float64 `json:"coupon_amount_total"` // 优惠卷总金额
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
CancelStatus int `json:"cancel_status"` // 取消状态(0:否 1:是)
CancelTime *model.LocalTime `json:"cancel_time"` // 订单取消时间
CancelRemarks string `json:"cancel_remarks"` // 取消订单备注
ValidDate *model.LocalTime `json:"valid_date"` // 到期时间
OrderRemarks string `json:"order_remarks"` // 订单备注
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
Question *QuestionDto `json:"question"` // 问题
}
// OrderSinglePayDto 单项订单支付数据
@@ -48,9 +48,9 @@ type OrderSinglePayDto struct {
// OrderSinglePayStatusDto 单项订单支付状态
type OrderSinglePayStatusDto struct {
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
ValidDate model.LocalTime `json:"valid_date"` // 到期时间
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
ValidDate *model.LocalTime `json:"valid_date"` // 到期时间
}
// GetOrderSingleListDto 列表
@@ -78,6 +78,7 @@ func GetOrderSingleListDto(m []*model.OrderSingle) []*OrderSingleDto {
CancelStatus: v.CancelStatus,
CancelTime: v.CancelTime,
CancelRemarks: v.CancelRemarks,
ValidDate: v.ValidDate,
OrderRemarks: v.OrderRemarks,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
@@ -114,6 +115,7 @@ func GetOrderSinglePayStatus(m *model.OrderSingle) *OrderSinglePayStatusDto {
return &OrderSinglePayStatusDto{
PayStatus: m.PayStatus,
PaymentAmountTotal: m.PaymentAmountTotal,
ValidDate: m.ValidDate,
}
}
@@ -124,11 +126,3 @@ func (r *OrderSingleDto) LoadQuestion(m *model.Question) *OrderSingleDto {
}
return r
}
// LoadValidDate 加载到期时间
func (r *OrderSinglePayStatusDto) LoadValidDate(m *time.Time) *OrderSinglePayStatusDto {
if m != nil {
r.ValidDate = model.LocalTime(*m)
}
return r
}
+7
View File
@@ -30,6 +30,13 @@ type QuestionDto struct {
BuyCount int `json:"buy_count"` // 被购买数量
}
// QuestionBuyStatusDto 获取问题解锁状态
type QuestionBuyStatusDto struct {
QuestionId string `json:"buy_status"` // 解锁状态(0:否 1:是)
QuestionTitle *int `json:"buy_mode"` // 解锁方式(1:单项有效期 2:会员)
ValidDate *time.Time `json:"valid_date"` // 到期时间
}
// GetQuestionDto 详情-问题
func GetQuestionDto(m *model.Question) *QuestionDto {
return &QuestionDto{
+7 -8
View File
@@ -3,18 +3,17 @@ package dto
import (
"fmt"
"hepa-calc-api/api/model"
"time"
)
// SystemMemberDto 配置-会员配置
type SystemMemberDto struct {
SystemMemberId string `json:"system_member_id"` // 主键id
MemberDays uint `json:"member_days"` // 会员天数
Price float64 `json:"price"` // 价格(原价)
DiscountPrice *float64 `json:"discount_price"` // 优惠价格
DiscountEndTime *time.Time `json:"discount_end_time"` // 优惠截止时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
SystemMemberId string `json:"system_member_id"` // 主键id
MemberDays uint `json:"member_days"` // 会员天数
Price float64 `json:"price"` // 价格(原价)
DiscountPrice *float64 `json:"discount_price"` // 优惠价格
DiscountEndTime *model.LocalTime `json:"discount_end_time"` // 优惠截止时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetSystemMemberListDto 列表
+16 -17
View File
@@ -4,27 +4,26 @@ import (
"fmt"
"hepa-calc-api/api/model"
"hepa-calc-api/utils"
"time"
)
// UserDto 用户表
type UserDto struct {
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
UserStatus int `json:"user_status"` // 状态(1:正常 2:禁用)
RegisterSource int `json:"register_source"` // 注册来源(1:app注册 2:公众号注册)
OpenId string `json:"open_id"` // 用户微信标识
UnionId string `json:"union_id"` // 微信开放平台标识
Age *uint `json:"age"` // 年龄
Sex uint `json:"sex"` // 性别(0:未知 1:男 2:女)
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *time.Time `json:"member_expire_date"` // 会员到期时间(非会员时为null)
LoginAt model.LocalTime `json:"login_at"` // 登陆时间
LoginIp string `json:"login_ip"` // 登陆ip
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
UserId string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Mobile string `json:"mobile"` // 手机号
UserStatus int `json:"user_status"` // 状态(1:正常 2:禁用)
RegisterSource int `json:"register_source"` // 注册来源(1:app注册 2:公众号注册)
OpenId string `json:"open_id"` // 用户微信标识
UnionId string `json:"union_id"` // 微信开放平台标识
Age *uint `json:"age"` // 年龄
Sex uint `json:"sex"` // 性别(0:未知 1:男 2:女)
Avatar string `json:"avatar"` // 头像
IsMember int `json:"is_member"` // 是否会员(0:否 1:是)
MemberExpireDate *model.LocalTime `json:"member_expire_date"` // 会员到期时间(非会员时为null)
LoginAt *model.LocalTime `json:"login_at"` // 登陆时间
LoginIp string `json:"login_ip"` // 登陆ip
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetUserDto 详情-问题
+11 -11
View File
@@ -6,17 +6,17 @@ import (
)
type UserCouponDto struct {
UserCouponId string `json:"user_coupon_id"` // 主键id
UserId string `json:"user_id"` // 用户id
CouponId string `json:"coupon_id"` // 优惠券id
UserCouponStatus int `json:"user_coupon_status"` // 状态(0:未使用 1:已使用 3:已过期)
IsWindows int `json:"is_windows"` // 是否已弹窗(0:否 1:是)
CouponUseDate model.LocalTime `json:"coupon_use_date"` // 使用时间
ValidStartTime model.LocalTime `json:"valid_start_time"` // 有效开始时间
ValidEndTime model.LocalTime `json:"valid_end_time"` // 过期时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
Coupon *CouponDto `json:"coupon"` // 优惠卷
UserCouponId string `json:"user_coupon_id"` // 主键id
UserId string `json:"user_id"` // 用户id
CouponId string `json:"coupon_id"` // 优惠券id
UserCouponStatus int `json:"user_coupon_status"` // 状态(0:未使用 1:已使用 3:已过期)
IsWindows int `json:"is_windows"` // 是否已弹窗(0:否 1:是)
CouponUseDate *model.LocalTime `json:"coupon_use_date"` // 使用时间
ValidStartTime *model.LocalTime `json:"valid_start_time"` // 有效开始时间
ValidEndTime *model.LocalTime `json:"valid_end_time"` // 过期时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
Coupon *CouponDto `json:"coupon"` // 优惠卷
}
// GetUserCouponDto 用户优惠卷详情