Merge branch 'sxy' into dev

This commit is contained in:
孙肖扬 2025-06-10 15:03:04 +08:00
commit 8629decdc0
7 changed files with 851 additions and 1297 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@ import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
@ -89,13 +89,6 @@ func (this *BundleDetailResponseV2) Validate() error {
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
}
}
for _, item := range this.SelectValueAddService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
}
}
}
return nil
}
func (this *OrderRecord) Validate() error {
@ -207,9 +200,9 @@ func (this *ValueAddServiceDetailRequest) Validate() error {
return nil
}
func (this *ValueAddServiceDetailResponse) Validate() error {
if this.ValueAddServiceLang != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddServiceLang); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLang", err)
if this.ValueAddService != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddService); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddService", err)
}
}
return nil

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// - protoc v5.29.2
// source: pb/bundle.proto
package bundle
@ -43,11 +43,11 @@ type BundleClient interface {
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
// 增值套餐
//增值套餐
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
// 新增值服务
//新增值服务
SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment)
ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment)
@ -255,11 +255,11 @@ type BundleServer interface {
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error)
// 增值套餐
//增值套餐
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
// 新增值服务
//新增值服务
SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error)
ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)

View File

@ -4,6 +4,7 @@ import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin"
)
@ -21,11 +22,20 @@ func BundleRouter(r *gin.RouterGroup) {
bundleClientRoute.POST("remove", bundle.DeleteBundle)
bundleClientRoute.POST("bundle-list", bundle.BundleList)
}
bundleClientRouteV2 := bundleRoute.Group("system/v2")
bundleClientRouteV2.POST("save", bundle.SaveBundleV2)
bundleClientRouteV2.POST("update/shelfStatus", bundle.HandShelf)
bundleAppRoute = bundleAppRoute.Group("common")
{
bundleAppRoute.POST("bundle-list", bundle.BundleList)
}
bundleAppRouteV2 := bundleRoute.Group("common/v2")
{
bundleAppRouteV2.POST("bundle-list", bundle.BundleListV2)
bundleAppRouteV2.POST("bundle-detail", bundle.BundleDetailV2)
}
}

View File

@ -23,6 +23,12 @@ func ValueAddBundleRouter(r *gin.RouterGroup) {
bundleClientRoute.POST("list", bundle.ValueAddBundleList)
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
}
bundleClientRouteV2 := valueAddBundleRoute.Group("system/v2")
{
bundleClientRouteV2.POST("save", bundle.SaveValueAddService)
bundleClientRouteV2.POST("list", bundle.ValueAddServiceList)
bundleClientRouteV2.POST("detail", bundle.ValueAddServiceDetail)
}
valueAddBundleAppRoute = valueAddBundleAppRoute.Group("system")
{

View File

@ -77,3 +77,66 @@ func BundleList(c *gin.Context) {
service.Success(c, res)
}
func SaveBundleV2(c *gin.Context) {
var req bundle.BundleProfile
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.SaveBundle(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleListV2(c *gin.Context) {
var req bundle.BundleListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleListV2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleDetailV2(c *gin.Context) {
var req bundle.BundleDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleDetailV2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func HandShelf(c *gin.Context) {
var req bundle.HandShelfRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.HandShelf(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}

View File

@ -67,3 +67,49 @@ func ValueAddBundleDetail(c *gin.Context) {
service.Success1(c, res.Msg, res)
}
func SaveValueAddService(c *gin.Context) {
var req bundle.ValueAddServiceLang
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.SaveValueAddService(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ValueAddServiceList(c *gin.Context) {
var req bundle.ValueAddServiceListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.ValueAddServiceList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ValueAddServiceDetail(c *gin.Context) {
var req bundle.ValueAddServiceDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.ValueAddServiceDetail(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}