Compare commits
	
		
			15 Commits
		
	
	
		
			7f28aeb349
			...
			6552868292
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6552868292 | |||
| 7fbb5e59b7 | |||
| c880ef997e | |||
| 4e79ab7a28 | |||
| 4f56854e36 | |||
| 34d4dc8d84 | |||
| 10bcbae03e | |||
| 9d71c9a6ea | |||
| 4cdb1508a8 | |||
| 1886eadf91 | |||
| 5fe886a487 | |||
| ea3f8b0cb4 | |||
| 822d2d696b | |||
| 01399daa30 | |||
| 895b7cce11 | 
							
								
								
									
										5
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								go.mod
									
									
									
									
									
								
							| @ -6,9 +6,9 @@ require ( | ||||
| 	dubbo.apache.org/dubbo-go/v3 v3.0.2 | ||||
| 	github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 | ||||
| 	github.com/bwmarrin/snowflake v0.3.0 | ||||
| 	github.com/dubbogo/gost v1.13.2 | ||||
| 	github.com/dubbogo/grpc-go v1.42.9 | ||||
| 	github.com/dubbogo/triple v1.1.8 | ||||
| 	github.com/duke-git/lancet/v2 v2.3.6 | ||||
| 	github.com/getsentry/sentry-go v0.28.1 | ||||
| 	github.com/gin-gonic/gin v1.9.0 | ||||
| 	github.com/go-redis/redis v6.15.9+incompatible | ||||
| @ -24,6 +24,7 @@ require ( | ||||
| 	github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 | ||||
| 	github.com/uber/jaeger-client-go v2.30.0+incompatible | ||||
| 	go.uber.org/zap v1.24.0 | ||||
| 	google.golang.org/grpc v1.54.0 | ||||
| 	google.golang.org/protobuf v1.29.1 | ||||
| 	gorm.io/datatypes v1.2.5 | ||||
| 	gorm.io/driver/mysql v1.5.6 | ||||
| @ -56,6 +57,7 @@ require ( | ||||
| 	github.com/creasty/defaults v1.5.2 // indirect | ||||
| 	github.com/davecgh/go-spew v1.1.1 // indirect | ||||
| 	github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect | ||||
| 	github.com/dubbogo/gost v1.13.2 // indirect | ||||
| 	github.com/emicklei/go-restful/v3 v3.7.4 // indirect | ||||
| 	github.com/envoyproxy/go-control-plane v0.10.3 // indirect | ||||
| 	github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect | ||||
| @ -152,7 +154,6 @@ require ( | ||||
| 	golang.org/x/text v0.22.0 // indirect | ||||
| 	google.golang.org/appengine v1.6.7 // indirect | ||||
| 	google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect | ||||
| 	google.golang.org/grpc v1.54.0 // indirect | ||||
| 	gopkg.in/ini.v1 v1.67.0 // indirect | ||||
| 	gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||||
| 	gopkg.in/yaml.v2 v2.4.0 // indirect | ||||
|  | ||||
							
								
								
									
										2
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							| @ -210,6 +210,8 @@ github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3u | ||||
| github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= | ||||
| github.com/dubbogo/triple v1.1.8 h1:yE+J3W1NTZCEPa1FoX+VWZH6UF1c0+A2MGfERlU2zbI= | ||||
| github.com/dubbogo/triple v1.1.8/go.mod h1:9pgEahtmsY/avYJp3dzUQE8CMMVe1NtGBmUhfICKLJk= | ||||
| github.com/duke-git/lancet/v2 v2.3.6 h1:NKxSSh+dlgp37funvxLCf3xLBeUYa7VW1thYQP6j3Y8= | ||||
| github.com/duke-git/lancet/v2 v2.3.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= | ||||
| github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= | ||||
| github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= | ||||
| github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= | ||||
|  | ||||
							
								
								
									
										46
									
								
								internal/controller/bundleExtend.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								internal/controller/bundleExtend.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | ||||
| package controller | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"micro-bundle/internal/logic" | ||||
| 	"micro-bundle/pb/bundle" | ||||
| 
 | ||||
| 	"google.golang.org/grpc/codes" | ||||
| 	"google.golang.org/grpc/status" | ||||
| ) | ||||
| 
 | ||||
| func (b *BundleProvider) BundleExtend(_ context.Context, req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) { | ||||
| 	return logic.BundleExtend(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) BundleExtendRecordsList(_ context.Context, req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) { | ||||
| 	return logic.BundleExtendRecordsList(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) { | ||||
| 	return logic.GetBundleBalanceList(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) CreateBundleBalance(_ context.Context, req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) { | ||||
| 	return logic.CreateBundleBalance(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) AddBundleBalance(_ context.Context, req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) { | ||||
| 	return logic.AddBundleBalance(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) GetUsedRecordList(_ context.Context, req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) { | ||||
| 	return logic.GetUsedRecord(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) GetImageWorkDetail(_ context.Context, req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) { | ||||
| 	return logic.GetImageWorkDetail(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) GetVedioWorkDetail(_ context.Context, req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) { | ||||
| 	return logic.GetVedioWorkDetail(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) ToBeComfirmedWorks(_ context.Context, req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented") | ||||
| } | ||||
| @ -1,19 +0,0 @@ | ||||
| package controller | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"micro-bundle/internal/logic" | ||||
| 	"micro-bundle/pb/bundle" | ||||
| ) | ||||
| 
 | ||||
| func (b *BundleProvider) BundleExtend(_ context.Context, req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) { | ||||
| 	return logic.BundleExtend(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) BundleExtendRecordsList(_ context.Context, req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) { | ||||
| 	return logic.BundleExtendRecordsList(req) | ||||
| } | ||||
| 
 | ||||
| func (b *BundleProvider) GetBundleBalance(_ context.Context, req *bundle.GetBundleBalanceReq) (*bundle.GetBundleBalanceResp, error) { | ||||
| 	return logic.GetBundleBalance(req) | ||||
| } | ||||
| @ -1,208 +1,219 @@ | ||||
| package dao | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	"micro-bundle/internal/model" | ||||
| 	"micro-bundle/pb/bundle" | ||||
| 	"micro-bundle/pkg/app" | ||||
| 	"micro-bundle/pkg/utils" | ||||
| 	"strings" | ||||
| 	"strconv" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/duke-git/lancet/v2/datetime" | ||||
| 
 | ||||
| 	"gorm.io/gorm" | ||||
| ) | ||||
| 
 | ||||
| func AddBundleExtendRecord(data model.BundleExtensionRecords) error { | ||||
| 	return app.ModuleClients.BundleDB.Create(&data).Error | ||||
| 	return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error { | ||||
| 		if err := tx.Create(&data).Error; err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 		if data.AvailableDurationAdditional != 0 && data.TimeUnit != 0 { | ||||
| 			record := model.BundleOrderRecords{} | ||||
| 			if err := tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{CustomerID: strconv.Itoa(data.UserId)}).First(&record).Error; err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 
 | ||||
| 			expireTime, err := time.Parse(time.DateOnly, record.ExpirationTime) | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 			switch data.TimeUnit { | ||||
| 			case 1: | ||||
| 				expireTime = datetime.AddDay(expireTime, int64(data.AvailableDurationAdditional)) | ||||
| 			case 2: | ||||
| 				expireTime = datetime.AddMonth(expireTime, int64(data.AvailableDurationAdditional)) | ||||
| 			case 3: | ||||
| 				expireTime = datetime.AddYear(expireTime, int64(data.AvailableDurationAdditional)) | ||||
| 			default: | ||||
| 				return errors.New("时间单位有误") | ||||
| 			} | ||||
| 			record.ExpirationTime = expireTime.Format(time.DateOnly) | ||||
| 			err = tx.Model(&model.BundleOrderRecords{}).Save(&record).Error | ||||
| 			return err | ||||
| 		} | ||||
| 		return nil | ||||
| 	}) | ||||
| } | ||||
| 
 | ||||
| func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data []model.BundleExtendRecordItemPo, total int64, err error) { | ||||
| 	var berConditions []string | ||||
| 	var berArgs []any | ||||
| 	var bovaConditions []string | ||||
| 	var bovaArgs []any | ||||
| 	// 动态条件拼接示例
 | ||||
| 	session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_extension_records AS ber"). | ||||
| 		Select(` | ||||
| 			ber.*, | ||||
| 			u.nickname as user_name, | ||||
| 			u.tel_num as user_phone_number | ||||
| 	`).Joins("LEFT JOIN `micro-account`.`user` u on u.id = user_id") | ||||
| 	if req.User != "" { | ||||
| 		if utils.IsPhoneNumber(req.User) { | ||||
| 			berConditions = append(berConditions, "u.tel_num = ?") | ||||
| 			berArgs = append(berArgs, req.User) | ||||
| 			session = session.Where("u.tel_num = ?", req.User) | ||||
| 		} else { | ||||
| 			berConditions = append(berConditions, "u.nickname LIKE ?") | ||||
| 			berArgs = append(berArgs, "%"+req.User+"%") | ||||
| 			session = session.Where("u.nickname like ?", req.User) | ||||
| 		} | ||||
| 	} | ||||
| 	if req.Operator != "" { | ||||
| 		if utils.IsPhoneNumber(req.Operator) { | ||||
| 			berConditions = append(berConditions, "operator_phone_number = ?") | ||||
| 			berArgs = append(berArgs, "%"+req.User+"%") | ||||
| 			session = session.Where("ber.operator_phone_number = ?", req.Operator) | ||||
| 		} else { | ||||
| 			berConditions = append(berConditions, "operator_name LIKE ?") | ||||
| 			berArgs = append(berArgs, "%"+req.User+"%") | ||||
| 			session = session.Where("ber.operator_name like ?", req.Operator) | ||||
| 		} | ||||
| 	} | ||||
| 	if req.Type != 0 { | ||||
| 		switch req.Type { | ||||
| 		case 1: // 手动创建
 | ||||
| 			{ | ||||
| 				bovaConditions = append(berConditions, "bova.uuid IS NULL") | ||||
| 			} | ||||
| 		case 2: // 自行购买
 | ||||
| 			{ | ||||
| 				berConditions = append(berConditions, "ber.operator_name IS NULL") | ||||
| 			} | ||||
| 		} | ||||
| 		session = session.Where("ber.`type` = ?", req.Type) | ||||
| 	} | ||||
| 	if req.AssociatedOrderNumber != "" { | ||||
| 		bovaConditions = append(bovaConditions, "order_uuid LIKE ?") | ||||
| 		bovaArgs = append(bovaArgs, "%"+req.AssociatedOrderNumber+"%") | ||||
| 		session = session.Where("ber.associated_order_number like ?", "%"+req.AssociatedOrderNumber+"%") | ||||
| 	} | ||||
| 	if req.StartTime != 0 { | ||||
| 		berConditions = append(berConditions, "ber.created_at >= ?") | ||||
| 		berArgs = append(berArgs, time.UnixMilli(int64(req.StartTime))) | ||||
| 		bovaConditions = append(bovaConditions, "bova.created_at >= ?") | ||||
| 		bovaArgs = append(bovaArgs, time.UnixMilli(int64(req.StartTime))) | ||||
| 	} | ||||
| 	if req.EndTime != 0 { | ||||
| 		berConditions = append(berConditions, "ber.created_at <= ?") | ||||
| 		berArgs = append(berArgs, time.UnixMilli(int64(req.EndTime))) | ||||
| 		bovaConditions = append(bovaConditions, "bova.created_at <= ?") | ||||
| 		bovaArgs = append(bovaArgs, time.UnixMilli(int64(req.EndTime))) | ||||
| 	} | ||||
| 	berCWhereClause := "" | ||||
| 	if len(berConditions) > 0 { | ||||
| 		berCWhereClause = " WHERE " + strings.Join(berConditions, " AND ") | ||||
| 	} | ||||
| 	bovaCWhereClause := "" | ||||
| 	if len(berConditions) > 0 { | ||||
| 		bovaCWhereClause = " WHERE " + strings.Join(bovaConditions, " AND ") | ||||
| 	} | ||||
| 	// 拼接数据查询SQL
 | ||||
| 	sql := ` | ||||
| 	SELECT | ||||
| 		u.nickname AS user_name, | ||||
| 		u.tel_num AS user_phone_number, | ||||
| 		bova.num AS service_num, | ||||
| 		bova.service_type AS service_type, | ||||
| 		bova.order_uuid, | ||||
| 		bova.uuid AS bova_uuid, | ||||
| 		NULL AS account_additional, | ||||
| 		NULL AS images_additional, | ||||
| 		NULL AS data_additional, | ||||
| 		NULL AS video_additional, | ||||
| 		NULL AS operator_name, | ||||
| 		NULL AS operator_phone_number, | ||||
| 		bova.created_at as created_at | ||||
| 	FROM | ||||
| 		fiee_bundle.bundle_order_value_add AS bova | ||||
| 	LEFT JOIN ` + "`micro-account`.`user`" + ` u ON u.id = bova.customer_id | ||||
| 	` + bovaCWhereClause + ` | ||||
| 	UNION ALL | ||||
| 
 | ||||
| 	SELECT | ||||
| 		u.nickname AS user_name, | ||||
| 		u.tel_num AS user_phone_number, | ||||
| 		NULL AS service_num, | ||||
| 		NULL AS service_type, | ||||
| 		NULL AS order_uuid, | ||||
| 		NULL AS bova_uuid, | ||||
| 		ber.account_additional, | ||||
| 		ber.images_additional, | ||||
| 		ber.data_additional, | ||||
| 		ber.video_additional, | ||||
| 		ber.operator_name, | ||||
| 		ber.operator_phone_number, | ||||
| 		ber.created_at as created_at | ||||
| 	FROM | ||||
| 		fiee_bundle.bundle_extension_records ber | ||||
| 	LEFT JOIN ` + "`micro-account`.`user`" + ` u ON u.id = ber.user_id | ||||
| 	` + berCWhereClause + ` | ||||
| 	ORDER BY created_at DESC | ||||
| 	LIMIT ? OFFSET ?; | ||||
| 	` | ||||
| 
 | ||||
| 	// 拼接总数查询SQL
 | ||||
| 	countSql := ` | ||||
| 		SELECT COUNT(*) AS total_count FROM ( | ||||
| 			SELECT bova.created_at as created_at | ||||
| 			FROM fiee_bundle.bundle_order_value_add AS bova | ||||
| 			LEFT JOIN ` + "`micro-account`.`user`" + ` u ON u.id = bova.customer_id | ||||
| 	` + bovaCWhereClause + ` | ||||
| 			UNION ALL | ||||
| 			SELECT ber.created_at as created_at | ||||
| 			FROM fiee_bundle.bundle_extension_records ber | ||||
| 			LEFT JOIN ` + "`micro-account`.`user`" + ` u ON u.id = ber.user_id | ||||
| 	` + berCWhereClause + ` | ||||
| 		) AS total_table; | ||||
| 	` | ||||
| 
 | ||||
| 	if req.Page == 0 { | ||||
| 		req.Page = 1 | ||||
| 	} | ||||
| 	if req.PageSize == 0 { | ||||
| 		req.PageSize = 100 | ||||
| 	} | ||||
| 	offset := (req.Page - 1) * req.PageSize | ||||
| 
 | ||||
| 	// 查询总数
 | ||||
| 	err = app.ModuleClients.BundleDB.Raw(countSql, append(bovaArgs, berArgs...)...).Scan(&total).Error | ||||
| 	if err != nil { | ||||
| 		return nil, 0, err | ||||
| 	if err = session.Count(&total).Error; err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	// 查询数据
 | ||||
| 	argsWithPage := append(append(bovaArgs, berArgs...), req.PageSize, offset) | ||||
| 	err = app.ModuleClients.BundleDB.Raw(sql, argsWithPage...).Scan(&data).Error | ||||
| 	if req.Page != 0 && req.PageSize != 0 { | ||||
| 		session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize)) | ||||
| 	} | ||||
| 	err = session.Find(&data).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| func GetBundleBalance(req *bundle.GetBundleBalanceReq) (data []model.BundleBalancePo, total int64, err error) { | ||||
| 	subQuery := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_order_records"). | ||||
| 		Select("customer_id, MAX(created_at) as max_created_at"). | ||||
| 		Group("customer_id") | ||||
| 	err = subQuery.Count(&total).Error | ||||
| func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) { | ||||
| 	session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_balance AS bb"). | ||||
| 		Select(` | ||||
| 		bb .*, | ||||
| 		bor.expiration_time as expired_time, | ||||
| 		bor.bundle_name, | ||||
| 		bor.status, | ||||
| 		bor.uuid as order_uuid, | ||||
| 		u.nickname as user_name, | ||||
| 		u.tel_num as user_phone_number | ||||
| 	`). | ||||
| 		Joins("LEFT JOIN bundle_order_records bor on bor.customer_id = bb .user_id"). | ||||
| 		Joins("LEFT JOIN `micro-account`.`user` u on u.id = bb.user_id") | ||||
| 	if req.UserName != "" { | ||||
| 		session = session.Where("u.nickname like ?", "%"+req.UserName+"%") | ||||
| 	} | ||||
| 	if req.Status != 0 { | ||||
| 		session = session.Where("bor.status = ?", req.Status) | ||||
| 	} | ||||
| 	if req.ExpiredTimeEnd != 0 { | ||||
| 		session = session.Where("bor.expiration_time <= ?", time.UnixMilli(req.ExpiredTimeEnd)) | ||||
| 	} | ||||
| 	if req.ExpiredTimeStart != 0 { | ||||
| 		session = session.Where("bor.expiration_time >= ?", time.UnixMilli(req.ExpiredTimeStart)) | ||||
| 	} | ||||
| 	err = session.Count(&total).Error | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 	if req.PageSize != 0 && req.Page != 0 { | ||||
| 		subQuery = subQuery.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize)) | ||||
| 	if req.Page != 0 && req.PageSize != 0 { | ||||
| 		session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize)) | ||||
| 	} | ||||
| 	session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_order_records AS bor"). | ||||
| 		Select(` | ||||
| 		bor.customer_id as user_id, | ||||
|         u.nickname as user_name, | ||||
|         u.tel_num as user_phone_number, | ||||
|         bor.bundle_name as bundle_name, | ||||
|         bor.expiration_time as expiration_time, | ||||
|         bor.status as bundle_status, | ||||
|         bova.num as service_num, | ||||
|         bova.service_type as service_type, | ||||
|         cw.work_category as work_category, | ||||
|         cw.uuid as cw_uuid, | ||||
|         bova.uuid as bova_uuid, | ||||
| 		cma.user_id as cma_uuid, | ||||
| 		ber.id as ber_id, | ||||
| 		bova.source as oder_source, | ||||
| 		ber.account_additional, | ||||
| 		ber.images_additional, | ||||
| 		ber.data_additional, | ||||
| 		ber.video_additional | ||||
|     `). | ||||
| 		Joins("JOIN (?) t ON bor.customer_id = t.customer_id AND bor.created_at = t.max_created_at", subQuery). | ||||
| 		Joins("LEFT JOIN fiee_bundle.bundle_order_value_add bova ON bova.order_uuid = bor.uuid"). | ||||
| 		Joins("LEFT JOIN fiee_bundle.cast_work cw ON cw.artist_uuid = bor.customer_id AND cw.created_at > UNIX_TIMESTAMP(bor.created_at)"). | ||||
| 		Joins("LEFT JOIN `micro-account`.`user` u ON u.id = bor.customer_id"). | ||||
| 		Joins("LEFT JOIN fiee_bundle.cast_media_account cma ON cma.artist_uuid = u.id"). | ||||
| 		Joins("LEFT JOIN  fiee_bundle.bundle_extension_records ber ON ber.user_id = bor.customer_id"). | ||||
| 		Where("bor.customer_id != ?", "") | ||||
| 	if req.BundleName != "" { | ||||
| 		session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%") | ||||
| 	} | ||||
| 	if req.UserName != "" { | ||||
| 		session.Where("u.nickname like ?", "%"+req.UserName+"%") | ||||
| 	} | ||||
| 	if req.ExpiredTimeStart != 0 { | ||||
| 		session.Where("bor.expiration_time >= ?", req.ExpiredTimeStart) | ||||
| 	} | ||||
| 	if req.ExpiredTimeEnd != 0 { | ||||
| 		session.Where("bor.expiration_time <= ?", req.ExpiredTimeEnd) | ||||
| 	} | ||||
| 	err = session.Scan(&data).Error | ||||
| 	err = session.Find(&data).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| func AddBundleBalanceByUserId(data model.BundleBalance) error { | ||||
| 	return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error { | ||||
| 		oldData := model.BundleBalance{} | ||||
| 		if err := tx.Model(&model.BundleBalance{}).Where("user_id = ?", data.UserId).Order("created_at desc").First(&oldData).Error; err != nil { | ||||
| 			return errors.New("用户还没有套餐信息") | ||||
| 		} | ||||
| 		newData := model.BundleBalance{ | ||||
| 			Model: gorm.Model{ | ||||
| 				ID: data.Model.ID, | ||||
| 			}, | ||||
| 			UserId:                        oldData.UserId, | ||||
| 			OrderUUID:                     oldData.OrderUUID, | ||||
| 			AccountNumber:                 oldData.AccountNumber + data.AccountNumber, | ||||
| 			AccountConsumptionNumber:      oldData.AccountConsumptionNumber + data.AccountConsumptionNumber, | ||||
| 			VideoNumber:                   oldData.VideoNumber + data.VideoNumber, | ||||
| 			VideoConsumptionNumber:        oldData.VideoConsumptionNumber + data.VideoConsumptionNumber, | ||||
| 			ImageNumber:                   oldData.ImageNumber + data.ImageNumber, | ||||
| 			ImageConsumptionNumber:        oldData.ImageConsumptionNumber + data.ImageConsumptionNumber, | ||||
| 			DataAnalysisNumber:            oldData.DataAnalysisNumber + data.DataAnalysisNumber, | ||||
| 			DataAnalysisConsumptionNumber: oldData.DataAnalysisConsumptionNumber + data.DataAnalysisConsumptionNumber, | ||||
| 			ExpansionPacksNumber:          oldData.ExpansionPacksNumber + data.ExpansionPacksNumber, | ||||
| 		} | ||||
| 
 | ||||
| 		if newData.AccountConsumptionNumber > newData.AccountNumber || | ||||
| 			newData.VideoConsumptionNumber > newData.VideoNumber || | ||||
| 			newData.ImageConsumptionNumber > newData.ImageNumber || | ||||
| 			newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber { | ||||
| 			return errors.New("套餐余量不足") | ||||
| 		} | ||||
| 		return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Updates(&newData).Error | ||||
| 	}) | ||||
| } | ||||
| 
 | ||||
| func CreateBundleBalance(data model.BundleBalance) error { | ||||
| 	return app.ModuleClients.BundleDB.Create(&data).Error | ||||
| } | ||||
| 
 | ||||
| func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, total int64, err error) { | ||||
| 	session := app.ModuleClients.BundleDB.Model(&model.CostLog{}) | ||||
| 	if req.Title != "" { | ||||
| 		session = session.Where("title = ?", req.Title) | ||||
| 	} | ||||
| 	if req.Platform != 0 { | ||||
| 		session = session.Where("JSON_CONTAINS(platform_ids,?)", req.Platform) | ||||
| 	} | ||||
| 	if req.Account != 0 { | ||||
| 		session = session.Where("JSON_CONTAINS(media_names,?)", req.Account) | ||||
| 	} | ||||
| 	if req.SubmitTimeEnd != 0 { | ||||
| 		session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd)) | ||||
| 	} | ||||
| 	if req.SubmitTimeStart != 0 { | ||||
| 		session = session.Where("submit_time >= ?", time.UnixMilli(req.SubmitTimeStart)) | ||||
| 	} | ||||
| 	if req.User != "" { | ||||
| 		if utils.IsPhoneNumber(req.User) { | ||||
| 			session = session.Where("artist_phone = ?", req.User) | ||||
| 		} else { | ||||
| 			session = session.Where("artist_name like ?", "%"+req.User+"%") | ||||
| 		} | ||||
| 	} | ||||
| 	if req.Operator != "" { | ||||
| 		if utils.IsPhoneNumber(req.Operator) { | ||||
| 			session = session.Where("operator_phone = ?", req.Operator) | ||||
| 		} else { | ||||
| 			session = session.Where("operator_name like ?", "%"+req.Operator+"%") | ||||
| 		} | ||||
| 	} | ||||
| 	if req.Type != 0 { | ||||
| 		session = session.Where("work_category = ?", req.Type) | ||||
| 	} | ||||
| 	if err = session.Count(&total).Error; err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 	if req.Page != 0 && req.PageSize != 0 { | ||||
| 		session = session.Offset(int(req.Page-1) * int(req.PageSize)).Limit(int(req.PageSize)) | ||||
| 	} | ||||
| 	err = session.Find(&data).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (data model.CastWorkImage, err error) { | ||||
| 	err = app.ModuleClients.BundleDB.Where(&model.CastWorkImage{WorkUuid: req.WorkId}).First(&data).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkVideo, err error) { | ||||
| 	err = app.ModuleClients.BundleDB.Where(&model.CastWorkVideo{WorkUuid: req.WorkId}).First(&data).Error | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWork, err error) {
 | ||||
| // 	// app.ModuleClients.BundleDB.Where(&model.CastWork{
 | ||||
| // 	// 	ArtistUuid: req.ArtistUuid,
 | ||||
| // 	// })
 | ||||
| // }
 | ||||
|  | ||||
| @ -6,7 +6,6 @@ import ( | ||||
| 	"micro-bundle/pb/bundle" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/dubbogo/gost/log/logger" | ||||
| 	"github.com/jinzhu/copier" | ||||
| 	"github.com/samber/lo" | ||||
| ) | ||||
| @ -16,6 +15,16 @@ func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse | ||||
| 	if err := copier.CopyWithOption(&data, req, copier.Option{DeepCopy: true}); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	if err := dao.AddBundleBalanceByUserId(model.BundleBalance{ | ||||
| 		UserId:               int(req.UserId), | ||||
| 		VideoNumber:          int(req.VideoAdditional), | ||||
| 		ImageNumber:          int(req.ImagesAdditional), | ||||
| 		DataAnalysisNumber:   int(req.DataAdditional), | ||||
| 		AccountNumber:        int(req.AccountAdditional), | ||||
| 		ExpansionPacksNumber: 1, | ||||
| 	}); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return nil, dao.AddBundleExtendRecord(data) | ||||
| } | ||||
| 
 | ||||
| @ -24,161 +33,85 @@ func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundl | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	var result = &bundle.BundleExtendRecordsListResponse{} | ||||
| 	result.Data = lo.Map(data, func(data model.BundleExtendRecordItemPo, _ int) (ber *bundle.BundleExtendRecordItem) { | ||||
| 		ber = &bundle.BundleExtendRecordItem{} | ||||
| 		ber.CreatedAt = uint64(data.CreatedAt.UnixMilli()) | ||||
| 		ber.UserName = data.UserName | ||||
| 		ber.UserPhoneNumber = data.UserPhoneNumber | ||||
| 		if data.ServiceType == 0 { | ||||
| 			ber.AccountAdditional += uint32(data.AccountAdditional) | ||||
| 			ber.VideoAdditional += uint32(data.VideoAdditional) | ||||
| 			ber.ImagesAdditional += uint32(data.ImagesAdditional) | ||||
| 			ber.DataAdditional += uint32(data.DataAdditional) | ||||
| 			ber.OperatorName = data.OperatorName | ||||
| 			ber.OperatorPhoneNumber = data.OperatorPhoneNumber | ||||
| 			ber.Type = 1 | ||||
| 		} else { | ||||
| 			switch data.ServiceType { | ||||
| 			case 1: | ||||
| 				ber.VideoAdditional += uint32(data.ServiceNum) | ||||
| 			case 2: | ||||
| 				ber.ImagesAdditional += uint32(data.ServiceNum) | ||||
| 			case 3: | ||||
| 				ber.DataAdditional += uint32(data.ServiceNum) | ||||
| 			case 4: | ||||
| 				ber.AccountAdditional += uint32(data.ServiceNum) | ||||
| 			} | ||||
| 			ber.AssociatedOrderNumber = data.OrderUUID | ||||
| 			ber.Type = 2 | ||||
| 		} | ||||
| 		return | ||||
| 	resp := &bundle.BundleExtendRecordsListResponse{} | ||||
| 	resp.Total = total | ||||
| 	resp.Data = lo.Map(data, func(m model.BundleExtendRecordItemPo, _ int) *bundle.BundleExtendRecordItem { | ||||
| 		result := &bundle.BundleExtendRecordItem{} | ||||
| 		copier.Copy(result, &m) | ||||
| 		return result | ||||
| 	}) | ||||
| 	result.Total = total | ||||
| 	return result, err | ||||
| 	return resp, nil | ||||
| } | ||||
| 
 | ||||
| func GetBundleBalance(req *bundle.GetBundleBalanceReq) (*bundle.GetBundleBalanceResp, error) { | ||||
| 	// start := time.Now()
 | ||||
| 	// defer func() {
 | ||||
| 	// 	fmt.Printf("(time.Now().UnixMilli() - start.UnixMilli()): %v\n", (time.Now().UnixMilli() - start.UnixMilli()))
 | ||||
| 	// }()
 | ||||
| 	data, total, err := dao.GetBundleBalance(req) | ||||
| func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) { | ||||
| 	data, total, err := dao.GetBundleBalanceList(req) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	type userDataDto struct { | ||||
| 		UserID               int | ||||
| 		UserName             string | ||||
| 		UserPhoneNumber      string | ||||
| 		BundleName           string | ||||
| 		ExpirationTime       time.Time | ||||
| 		BundleStatus         int | ||||
| 		VideoCap             int | ||||
| 		ImageCap             int | ||||
| 		DataAnalysisCap      int | ||||
| 		AccountCap           int | ||||
| 		VideoUsed            int | ||||
| 		ImageUsed            int | ||||
| 		DataAnalysisUsed     int | ||||
| 		AccountUsed          int | ||||
| 		ExpansionPacksNumber int | ||||
| 	} | ||||
| 	usersMap := map[int]*userDataDto{} | ||||
| 	lo.ForEach(data, func(data model.BundleBalancePo, index int) { | ||||
| 		_, ok := usersMap[data.UserID] | ||||
| 		if !ok { | ||||
| 			usersMap[data.UserID] = &userDataDto{ | ||||
| 				UserID:          data.UserID, | ||||
| 				UserName:        data.UserName, | ||||
| 				UserPhoneNumber: data.UserPhoneNumber, | ||||
| 				BundleStatus:    data.BundleStatus, | ||||
| 				ExpirationTime:  data.ExpirationTime, | ||||
| 			} | ||||
| 		} | ||||
| 	resp := &bundle.GetBundleBalanceListResp{} | ||||
| 	resp.Total = total | ||||
| 	resp.Data = lo.Map(data, func(m model.BundleBalancePo, _ int) *bundle.BundleBalanceItem { | ||||
| 		result := &bundle.BundleBalanceItem{} | ||||
| 		copier.Copy(result, &m) | ||||
| 		t, _ := time.Parse("2006-01-02", m.ExpirationTime) | ||||
| 		result.ExpiredTime = t.UnixMilli() | ||||
| 		return result | ||||
| 	}) | ||||
| 	for _, user := range usersMap { | ||||
| 		userData := lo.Filter(data, func(data model.BundleBalancePo, _ int) bool { | ||||
| 			return data.UserID == user.UserID | ||||
| 		}) | ||||
| 		// 去重bundle_order_value_add.uuid 计算可用量
 | ||||
| 		lo.ForEach(lo.UniqBy(lo.Filter(userData, func(data model.BundleBalancePo, _ int) bool { | ||||
| 			return data.BovaUUID != nil | ||||
| 		}), func(data model.BundleBalancePo) string { | ||||
| 			return *data.BovaUUID | ||||
| 		}), func(data model.BundleBalancePo, index int) { | ||||
| 			if data.OderSource == 3 { | ||||
| 				user.ExpansionPacksNumber++ | ||||
| 			} | ||||
| 			logger.Infof("增加数据类型%v(%v),user_id:%v,uuid:%v", data.ServiceType, data.ServiceNum, data.UserID, *data.BovaUUID) | ||||
| 			switch data.ServiceType { | ||||
| 			case 1: | ||||
| 				user.VideoCap += data.ServiceNum | ||||
| 			case 2: | ||||
| 				user.ImageCap += data.ServiceNum | ||||
| 			case 3: | ||||
| 				user.DataAnalysisCap += data.ServiceNum | ||||
| 			case 4: | ||||
| 				user.AccountCap += data.ServiceNum | ||||
| 			default: | ||||
| 				logger.Warn("不存在的数据类型:", data.ServiceType) | ||||
| 			} | ||||
| 		}) | ||||
| 
 | ||||
| 		// 去重work_category.uuid 统计绑定的发布数
 | ||||
| 		lo.ForEach(lo.UniqBy(lo.Filter(userData, func(data model.BundleBalancePo, _ int) bool { | ||||
| 			return data.CwUUID != nil | ||||
| 		}), func(data model.BundleBalancePo) string { | ||||
| 			return *data.CwUUID | ||||
| 		}), func(data model.BundleBalancePo, index int) { | ||||
| 			logger.Infof("减少数据类型%v,user_id:%v,uuid:%v", data.ServiceType, data.UserID, *data.CwUUID) | ||||
| 			switch data.WorkCategory { | ||||
| 			case 1: | ||||
| 				user.ImageUsed++ | ||||
| 			case 2: | ||||
| 				user.VideoUsed++ | ||||
| 			default: | ||||
| 				logger.Warn("不存在的数据类型:", data.WorkCategory) | ||||
| 			} | ||||
| 		}) | ||||
| 
 | ||||
| 		// 去重cast_media_account.uuid 统计绑定的账号数
 | ||||
| 		user.AccountUsed += len(lo.UniqBy(lo.Filter(userData, func(data model.BundleBalancePo, _ int) bool { | ||||
| 			return data.CmaUUID != nil | ||||
| 		}), func(data model.BundleBalancePo) string { | ||||
| 			return *data.CmaUUID | ||||
| 		})) | ||||
| 
 | ||||
| 		// 去重bundle_extension_records.id 统计绑定的账号数
 | ||||
| 		lo.ForEach(lo.UniqBy(userData, func(data model.BundleBalancePo) int { | ||||
| 			return data.BerID | ||||
| 		}), func(data model.BundleBalancePo, index int) { | ||||
| 			user.ExpansionPacksNumber++ | ||||
| 			user.AccountCap += data.AccountAdditional | ||||
| 			user.VideoCap += data.VideAadditiona | ||||
| 			user.DataAnalysisCap += data.DataAdditional | ||||
| 			user.ImageCap += data.ImagesAdditional | ||||
| 		}) | ||||
| 	} | ||||
| 	result := &bundle.GetBundleBalanceResp{} | ||||
| 	result.Total = total | ||||
| 	result.Data = lo.MapToSlice(usersMap, func(_ int, user *userDataDto) *bundle.BundleBalanceItem { | ||||
| 		return &bundle.BundleBalanceItem{ | ||||
| 			UserName:                      user.UserName, | ||||
| 			UserPhoneNumber:               user.UserPhoneNumber, | ||||
| 			BundleName:                    user.BundleName, | ||||
| 			Status:                        int32(user.BundleStatus), | ||||
| 			ExpiredTime:                   user.ExpirationTime.UnixMilli(), | ||||
| 			AccountNumber:                 int32(user.AccountCap), | ||||
| 			AccountConsumptionNumber:      int32(user.AccountUsed), | ||||
| 			ImageNumber:                   int32(user.ImageCap), | ||||
| 			ImageConsumptionNumber:        int32(user.ImageUsed), | ||||
| 			VideoNumber:                   int32(user.VideoCap), | ||||
| 			VideoConsumptionNumber:        int32(user.VideoUsed), | ||||
| 			DataAnalysisNumber:            int32(user.DataAnalysisCap), | ||||
| 			DataAnalysisConsumptionNumber: int32(user.DataAnalysisUsed), | ||||
| 			ExpansionPacksNumber:          int32(user.ExpansionPacksNumber), | ||||
| 		} | ||||
| 	}) | ||||
| 	return result, nil | ||||
| 	return resp, nil | ||||
| } | ||||
| 
 | ||||
| func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) { | ||||
| 	var data model.BundleBalance | ||||
| 	if err := copier.Copy(&data, req); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return nil, dao.AddBundleBalanceByUserId(data) | ||||
| } | ||||
| 
 | ||||
| func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) { | ||||
| 	var data model.BundleBalance | ||||
| 	if err := copier.Copy(&data, req); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return nil, dao.CreateBundleBalance(data) | ||||
| } | ||||
| 
 | ||||
| func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) { | ||||
| 	data, total, err := dao.GetUsedRecord(req) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	resp := &bundle.GetUsedRecordListResp{} | ||||
| 	resp.Total = total | ||||
| 	resp.Data = lo.Map(data, func(m model.CostLog, _ int) *bundle.WorkCastItem { | ||||
| 		result := &bundle.WorkCastItem{} | ||||
| 		copier.Copy(result, &m) | ||||
| 		return result | ||||
| 	}) | ||||
| 	return resp, nil | ||||
| } | ||||
| 
 | ||||
| func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) { | ||||
| 	data, err := dao.GetImageWorkDetail(req) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	result := &bundle.GetImageWorkDetailResp{} | ||||
| 	err = copier.Copy(result, &data) | ||||
| 	return result, err | ||||
| } | ||||
| 
 | ||||
| func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) { | ||||
| 	data, err := dao.GetVedioWorkDetail(req) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	result := &bundle.GetVedioeWorkDetailResp{} | ||||
| 	err = copier.Copy(result, &data) | ||||
| 	return result, err | ||||
| } | ||||
| 
 | ||||
| func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) { | ||||
| 	// data, err := dao.ToBeComfirmedWorks(req)
 | ||||
| 	return nil, nil | ||||
| } | ||||
|  | ||||
| @ -88,6 +88,7 @@ type BundleExtensionRecords struct { | ||||
| 	ImagesAdditional            uint   `gorm:"column:images_additional;type:int(11) unsigned;comment:图文额外增加" json:"images_additional"` | ||||
| 	DataAdditional              uint   `gorm:"column:data_additional;type:int(11) unsigned;comment:数据额外增加" json:"data_additional"` | ||||
| 	AvailableDurationAdditional uint   `gorm:"column:available_duration_additional;type:int(11) unsigned;comment:可用时长增加" json:"available_duration_additional"` | ||||
| 	TimeUnit                    uint   `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"` | ||||
| 	Type                        int    `gorm:"column:type;type:tinyint(4);comment:类型 0:手动操作" json:"type"` | ||||
| 	Remark                      string `gorm:"column:remark;type:text;comment:备注" json:"remark"` | ||||
| 	OperatorId                  int    `gorm:"column:operator_id;type:int(11);comment:操作人id" json:"operator_id"` | ||||
| @ -101,11 +102,8 @@ func (*BundleExtensionRecords) TableName() string { | ||||
| } | ||||
| 
 | ||||
| type BundleExtendRecordItemPo struct { | ||||
| 	UserID              uint | ||||
| 	UserName            string | ||||
| 	UserPhoneNumber     string | ||||
| 	ServiceNum          int | ||||
| 	ServiceType         int | ||||
| 	AccountAdditional   int | ||||
| 	ImagesAdditional    int | ||||
| 	DataAdditional      int | ||||
| @ -138,22 +136,40 @@ type BundleExtendRecordItemDto struct { | ||||
| } | ||||
| 
 | ||||
| type BundleBalancePo struct { | ||||
| 	UserID            int       `gorm:"column:user_id"` | ||||
| 	UserName          string    `gorm:"column:user_name"` | ||||
| 	UserPhoneNumber   string    `gorm:"column:user_phone_nmber"` | ||||
| 	BundleName        string    `gorm:"column:bundle_name"` | ||||
| 	ExpirationTime    time.Time `gorm:"column:expired_time"` | ||||
| 	BundleStatus      int       `gorm:"column:bundle_status"` | ||||
| 	ServiceNum        int       `gorm:"column:service_num"` | ||||
| 	ServiceType       int       `gorm:"column:service_type"` | ||||
| 	WorkCategory      int       `gorm:"column:work_category"` | ||||
| 	CwUUID            *string   `gorm:"column:cw_uuid"` | ||||
| 	BovaUUID          *string   `gorm:"column:bova_uuid"` | ||||
| 	CmaUUID           *string   `gorm:"column:cma_uuid"` | ||||
| 	BerID             int       `gorm:"column:ber_id"` | ||||
| 	OderSource        int       `gorm:"column:oder_source"` | ||||
| 	AccountAdditional int       `gorm:"column:account_additional"` | ||||
| 	ImagesAdditional  int       `gorm:"column:images_additional"` | ||||
| 	DataAdditional    int       `gorm:"column:data_additional"` | ||||
| 	VideAadditiona    int       `gorm:"column:video_additional"` | ||||
| 	UserId                        int    `gorm:"column:user_id"` | ||||
| 	UserName                      string `gorm:"column:user_name"` | ||||
| 	UserPhoneNumber               string `gorm:"column:user_phone_nmber"` | ||||
| 	BundleName                    string `gorm:"column:bundle_name"` | ||||
| 	ExpirationTime                string `gorm:"column:expired_time"` | ||||
| 	BundleStatus                  int    `gorm:"column:bundle_status"` | ||||
| 	OrderUUID                     string `gorm:"column:order_uuid"` | ||||
| 	AccountNumber                 int    `gorm:"column:account_number;not null"` | ||||
| 	AccountConsumptionNumber      int    `gorm:"column:account_consumption_number;not null"` | ||||
| 	VideoNumber                   int    `gorm:"column:video_number;not null"` | ||||
| 	VideoConsumptionNumber        int    `gorm:"column:video_consumption_number;not null"` | ||||
| 	ImageNumber                   int    `gorm:"column:image_number;not null"` | ||||
| 	ImageConsumptionNumber        int    `gorm:"column:image_consumption_number;not null"` | ||||
| 	DataAnalysisNumber            int    `gorm:"column:data_analysis_number;not null"` | ||||
| 	DataAnalysisConsumptionNumber int    `gorm:"column:data_analysis_consumption_number;not null"` | ||||
| 	ExpansionPacksNumber          int    `gorm:"column:expansion_packs_number;not null"` | ||||
| } | ||||
| 
 | ||||
| type BundleBalance struct { | ||||
| 	gorm.Model | ||||
| 	UserId                        int    `gorm:"column:user_id;not null"` | ||||
| 	OrderUUID                     string `gorm:"column:order_uuid;type:varchar(1024);not null"` | ||||
| 	AccountNumber                 int    `gorm:"column:account_number;not null"` | ||||
| 	AccountConsumptionNumber      int    `gorm:"column:account_consumption_number;not null"` | ||||
| 	VideoNumber                   int    `gorm:"column:video_number;not null"` | ||||
| 	VideoConsumptionNumber        int    `gorm:"column:video_consumption_number;not null"` | ||||
| 	ImageNumber                   int    `gorm:"column:image_number;not null"` | ||||
| 	ImageConsumptionNumber        int    `gorm:"column:image_consumption_number;not null"` | ||||
| 	DataAnalysisNumber            int    `gorm:"column:data_analysis_number;not null"` | ||||
| 	DataAnalysisConsumptionNumber int    `gorm:"column:data_analysis_consumption_number;not null"` | ||||
| 	ExpansionPacksNumber          int    `gorm:"column:expansion_packs_number;not null"` | ||||
| } | ||||
| 
 | ||||
| // TableName 表名称
 | ||||
| func (*BundleBalance) TableName() string { | ||||
| 	return "bundle_balance" | ||||
| } | ||||
|  | ||||
							
								
								
									
										87
									
								
								internal/model/cast.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								internal/model/cast.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,87 @@ | ||||
| package model | ||||
| 
 | ||||
| import "gorm.io/plugin/soft_delete" | ||||
| 
 | ||||
| type CostLog struct { | ||||
| 	Uuid          string `gorm:"column:uuid;type:varchar(50);NOT NULL;primary_key;" json:"id"` | ||||
| 	ArtistUuid    string `gorm:"column:artist_uuid;type:varchar(50);NOT NULL;index:idx_artist_uuid;default:'';comment:艺人ID" json:"artistUuid"` | ||||
| 	ArtistName    string `gorm:"column:artist_name;type:varchar(50);NOT NULL;default:'';comment:艺人名称" json:"artistName"` | ||||
| 	ArtistPhone   string `gorm:"column:artist_phone;type:varchar(50);NOT NULL;default:'';comment:艺人手机号" json:"artistPhone"` | ||||
| 	WorkUuid      string `gorm:"column:work_uuid;type:varchar(50);NOT NULL;index:idx_work_uuid;default:'';comment:作品uuid" json:"workUuid"` | ||||
| 	WorkCategory  uint8  `gorm:"column:work_category;type:tinyint(1);NOT NULL;default:1;comment: 1 图文 2 视频" json:"workCategory"` | ||||
| 	BundleUuid    string `gorm:"column:bundle_uuid;type:varchar(50);NOT NULL;index:idx_bundle_uuid;default:'';comment:套餐ID uuid" json:"bundleUuid"` | ||||
| 	BundleName    string `gorm:"column:bundle_name;type:varchar(50);NOT NULL;default:'';comment:套餐名称" json:"bundleName"` | ||||
| 	PlatformIDs   string `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合" json:"platformIDs"` | ||||
| 	MediaNames    string `gorm:"column:media_names;type:varchar(600);NOT NULL;default:'';comment:自媒体账号名称集合" json:"mediaNames"` | ||||
| 	MediaAccIDs   string `gorm:"column:media_acc_ids;type:varchar(600);NOT NULL;default:'';comment:自媒体账号ID集合" json:"mediaAccIDs"` | ||||
| 	WorkTitle     string `gorm:"column:work_title;type:varchar(50);NOT NULL;" json:"workTitle"` | ||||
| 	SubmitTime    string `gorm:"column:submit_time;type:varchar(50);NOT NULL;default:'';comment:提交时间" json:"submitTime"` | ||||
| 	OperatorName  string `gorm:"column:operator_name;type:varchar(50);NOT NULL;default:'';comment:操作人名称" json:"operatorName"` | ||||
| 	OperatorID    string `gorm:"column:operator_id;type:varchar(50);NOT NULL;default:'';comment:操作人ID" json:"operatorID"` | ||||
| 	OperatorPhone string `gorm:"column:operator_phone;type:varchar(50);NOT NULL;default:'';comment:操作人手机号" json:"operatorPhone"` | ||||
| 	Status        uint8  `gorm:"column:status;type:tinyint(1);NOT NULL;default:1;comment: 1 有效 2 失效" json:"status"` | ||||
| 	CreatedAt     int    `gorm:"column:created_at;type:int(11);autoCreateTime" json:"createdAt"` | ||||
| 	UpdatedAt     int    `gorm:"column:updated_at;type:int(11);autoCreateTime" json:"updatedAt"` | ||||
| 	DeletedAt     soft_delete.DeletedAt | ||||
| } | ||||
| 
 | ||||
| func (CostLog) TableName() string { | ||||
| 	return "cast_cost_log" | ||||
| } | ||||
| 
 | ||||
| type CastWorkImage struct { | ||||
| 	Uuid      string `json:"uuid" gorm:"uuid"` | ||||
| 	WorkUuid  string `json:"work_uuid" gorm:"work_uuid"`   // 作品uuid
 | ||||
| 	ImageUrls string `json:"image_urls" gorm:"image_urls"` // 图片url集合
 | ||||
| 	CreatedAt int64  `json:"created_at" gorm:"created_at"` | ||||
| 	UpdatedAt int64  `json:"updated_at" gorm:"updated_at"` | ||||
| 	DeletedAt int64  `json:"deleted_at" gorm:"deleted_at"` | ||||
| } | ||||
| 
 | ||||
| // TableName 表名称
 | ||||
| func (*CastWorkImage) TableName() string { | ||||
| 	return "cast_work_image" | ||||
| } | ||||
| 
 | ||||
| type CastWorkVideo struct { | ||||
| 	Uuid      string `json:"uuid" gorm:"uuid"` | ||||
| 	WorkUuid  string `json:"work_uuid" gorm:"work_uuid"` // 作品uuid
 | ||||
| 	CoverUrl  string `json:"cover_url" gorm:"cover_url"` // 封面url
 | ||||
| 	VideoUrl  string `json:"video_url" gorm:"video_url"` // 视频url
 | ||||
| 	CreatedAt int64  `json:"created_at" gorm:"created_at"` | ||||
| 	UpdatedAt int64  `json:"updated_at" gorm:"updated_at"` | ||||
| 	DeletedAt int64  `json:"deleted_at" gorm:"deleted_at"` | ||||
| } | ||||
| 
 | ||||
| // TableName 表名称
 | ||||
| func (*CastWorkVideo) TableName() string { | ||||
| 	return "cast_work_video" | ||||
| } | ||||
| 
 | ||||
| // CastWork undefined
 | ||||
| type CastWork struct { | ||||
| 	Uuid             string `json:"uuid" gorm:"uuid"` | ||||
| 	ArtistUuid       string `json:"artist_uuid" gorm:"artist_uuid"`               // 艺人ID
 | ||||
| 	MediaAccUserIds  string `json:"media_acc_user_ids" gorm:"media_acc_user_ids"` // 自媒体账号user_ids集合
 | ||||
| 	MediaNames       string `json:"media_names" gorm:"media_names"`               // 自媒体账号名称集合
 | ||||
| 	ArtistName       string `json:"artist_name" gorm:"artist_name"`               // 艺人名称
 | ||||
| 	ArtistPhone      string `json:"artist_phone" gorm:"artist_phone"`             // 艺人手机号
 | ||||
| 	WorkCategory     int8   `json:"work_category" gorm:"work_category"`           //  1 图文 2 视频
 | ||||
| 	SubmitTime       string `json:"submit_time" gorm:"submit_time"`               // 提交时间
 | ||||
| 	StatusUpdateTime string `json:"status_update_time" gorm:"status_update_time"` // 状态更新时间
 | ||||
| 	Status           int8   `json:"status" gorm:"status"`                         //  1 待提交 2 审核中 3 审核失败 4 待艺人确认 5 艺人驳回 6 发布成功 7 发布失败
 | ||||
| 	Title            string `json:"title" gorm:"title"` | ||||
| 	Content          string `json:"content" gorm:"content"` | ||||
| 	PublishConfig    string `json:"publish_config" gorm:"publish_config"` // 发布配置
 | ||||
| 	CreatedAt        int64  `json:"created_at" gorm:"created_at"` | ||||
| 	UpdatedAt        int64  `json:"updated_at" gorm:"updated_at"` | ||||
| 	DeletedAt        int64  `json:"deleted_at" gorm:"deleted_at"` | ||||
| 	Cost             int8   `json:"cost" gorm:"cost"`                     //  1 消耗 2 未消耗
 | ||||
| 	ConfirmRemark    string `json:"confirm_remark" gorm:"confirm_remark"` // 艺人确认备注
 | ||||
| 	ApprovalId       string `json:"approval_id" gorm:"approval_id"`       // 审批ID
 | ||||
| } | ||||
| 
 | ||||
| // TableName 表名称
 | ||||
| func (*CastWork) TableName() string { | ||||
| 	return "cast_work" | ||||
| } | ||||
							
								
								
									
										180
									
								
								pb/bundle.proto
									
									
									
									
									
								
							
							
						
						
									
										180
									
								
								pb/bundle.proto
									
									
									
									
									
								
							| @ -49,8 +49,19 @@ service Bundle { | ||||
|   // 余量管理 | ||||
|   rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展 | ||||
|   rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询 | ||||
|   rpc GetBundleBalance(GetBundleBalanceReq) returns (GetBundleBalanceResp) {} // 余量信息 | ||||
|   rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息 | ||||
|   rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息 | ||||
|   rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 创建新的余量信息 | ||||
| 
 | ||||
|   // 使用记录 | ||||
|   rpc GetUsedRecordList(GetUsedRecordListReq) returns (GetUsedRecordListResp) {} // 获取套餐使用记录列表 | ||||
|   rpc GetImageWorkDetail(GetImageWorkDetailReq) returns (GetImageWorkDetailResp) {} // 获取图文作品详情 | ||||
|   rpc GetVedioWorkDetail(GetVedioWorkDetailReq) returns (GetVedioeWorkDetailResp) {} // 获取视频作品详情 | ||||
| 
 | ||||
|   rpc ToBeComfirmedWorks(ToBeComfirmedWorksReq) returns (ToBeComfirmedWorksResp) {} // 待确认作品列表 | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| message OrderCreateRecord{ | ||||
|   string bundleUuid = 1 [json_name = "bundleUuid"]; | ||||
|   string language = 2 [json_name = "language"]; | ||||
| @ -132,6 +143,7 @@ message PackagePriceAndTimeResponse{ | ||||
|   float price = 1 [json_name = "price"]; | ||||
|   string time = 2 [json_name = "time"]; | ||||
| } | ||||
| 
 | ||||
| message CommonResponse { | ||||
|   string msg = 1 [json_name = "msg"]; | ||||
|   string uuid = 2 [json_name = "uuid"]; | ||||
| @ -450,10 +462,11 @@ message BundleExtendRequest{ | ||||
|   uint32 imagesAdditional = 4;  | ||||
|   uint32 dataAdditional = 5; | ||||
|   uint32 availableDurationAdditional = 6;  | ||||
|   string remark = 7;  | ||||
|   string associatedorderNumber = 8;  | ||||
|   string operatorName = 9;  | ||||
|   string operatorPhoneNumber = 10;  | ||||
|   uint32 timeUnit = 7; // 1 日 2 月 3年 | ||||
|   string remark = 8;  | ||||
|   string associatedorderNumber = 9;  | ||||
|   string operatorName = 10;  | ||||
|   string operatorPhoneNumber = 11;  | ||||
| } | ||||
| 
 | ||||
| message BundleExtendResponse{ | ||||
| @ -491,6 +504,16 @@ message BundleExtendRecordItem{ | ||||
|   string operatorPhoneNumber = 13;  | ||||
| } | ||||
| 
 | ||||
| message GetBundleBalanceListReq{ | ||||
|   string userName = 1; | ||||
|   int32 status = 2; | ||||
|   string bundleName = 3; | ||||
|   int64 expiredTimeStart = 4; | ||||
|   int64 expiredTimeEnd = 5; | ||||
|   int32 page = 6; | ||||
|   int32 pageSize = 7; | ||||
| } | ||||
| 
 | ||||
| message GetBundleBalanceReq{ | ||||
|   string userName = 1; | ||||
|   int32 status = 2; | ||||
| @ -502,24 +525,141 @@ message GetBundleBalanceReq{ | ||||
| } | ||||
| 
 | ||||
| message BundleBalanceItem{ | ||||
|   string userName = 1; | ||||
|   string userPhoneNumber = 2; | ||||
|   int32 status = 3; | ||||
|   string bundleName = 4; | ||||
|   int64 expiredTime = 5; | ||||
|   int32 accountNumber = 6; | ||||
|   int32 accountConsumptionNumber = 7; | ||||
|   int32 videoNumber = 8; | ||||
|   int32 videoConsumptionNumber = 9; | ||||
|   int32 imageNumber = 10; | ||||
|   int32 imageConsumptionNumber = 11; | ||||
|   int32 dataAnalysisNumber = 12; | ||||
|   int32 dataAnalysisConsumptionNumber = 13; | ||||
|   int32 expansionPacksNumber = 14; | ||||
|   int32 userId = 1; | ||||
|   string userName = 2; | ||||
|   string userPhoneNumber = 3; | ||||
|   int32 status = 4; | ||||
|   string bundleName = 5; | ||||
|   int64 expiredTime = 6; | ||||
|   int32 accountNumber = 7; | ||||
|   int32 accountConsumptionNumber = 8; | ||||
|   int32 videoNumber = 9; | ||||
|   int32 videoConsumptionNumber = 10; | ||||
|   int32 imageNumber = 11; | ||||
|   int32 imageConsumptionNumber = 12; | ||||
|   int32 dataAnalysisNumber = 13; | ||||
|   int32 dataAnalysisConsumptionNumber = 14; | ||||
|   int32 expansionPacksNumber = 15; | ||||
| } | ||||
| 
 | ||||
| message GetBundleBalanceResp{ | ||||
|   int64 total = 1; | ||||
|   repeated BundleBalanceItem data = 2; | ||||
| } | ||||
| message GetBundleBalanceListResp{ | ||||
|   int64 total = 1; | ||||
|   repeated BundleBalanceItem data = 2; | ||||
| } | ||||
| 
 | ||||
| message CreateBundleBalanceReq{ | ||||
|   int32 userId = 1; | ||||
|   string orderUUID = 2; | ||||
|   int32 accountNumber = 3;       | ||||
|   int32 accountConsumptionNumber = 4;   | ||||
|   int32 videoNumber = 5;                   | ||||
|   int32 videoConsumptionNumber = 6;        | ||||
|   int32 imageNumber = 7;                   | ||||
|   int32 imageConsumptionNumber = 8;  | ||||
|   int32 dataAnalysisNumber = 9; | ||||
|   int32 dataAnalysisConsumptionNumber = 10; | ||||
|   int32 expansionPacksNumber = 11;   | ||||
| } | ||||
| 
 | ||||
| message CreateBundleBalanceResp{ | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| message AddBundleBalanceReq{ | ||||
|   int32 id = 1; | ||||
|   int32 userId = 2; | ||||
|   string orderUUID = 3; | ||||
|   int32 accountNumber = 4;       | ||||
|   int32 accountConsumptionNumber = 5;   | ||||
|   int32 videoNumber = 6;                   | ||||
|   int32 videoConsumptionNumber = 7;        | ||||
|   int32 imageNumber = 8;                   | ||||
|   int32 imageConsumptionNumber = 9;  | ||||
|   int32 dataAnalysisNumber = 10; | ||||
|   int32 dataAnalysisConsumptionNumber = 11; | ||||
|   int32 expansionPacksNumber = 12;   | ||||
| } | ||||
| 
 | ||||
| message AddBundleBalanceResp{ | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| message GetUsedRecordListReq{ | ||||
|   string user = 1; | ||||
|   string operator = 2; | ||||
|   int32 account = 3; | ||||
|   int32 platform = 4; | ||||
|   int32 type = 5; | ||||
|   string title = 6; | ||||
|   int64 submitTimeStart = 7; | ||||
|   int64 submitTimeEnd = 8; | ||||
|   int32 page = 9; | ||||
|   int32 pageSize = 10; | ||||
| } | ||||
| 
 | ||||
| message GetUsedRecordListResp { | ||||
|   int64 total = 1; | ||||
|   repeated WorkCastItem data = 2; | ||||
| } | ||||
| 
 | ||||
| message WorkCastItem{ | ||||
|   string artistUuid = 1;     // 艺人ID | ||||
|   string artistName = 2;     // 艺人名称 | ||||
|   string artistPhone = 3;    // 艺人手机号 | ||||
|   string workUuid = 4;       // 作品uuid | ||||
|   uint32 workCategory = 5;   // 1 图文 2 视频 | ||||
|   string bundleUuid = 6;     // 套餐ID uuid | ||||
|   string bundleName = 7;     // 套餐名称 | ||||
|   string platformIDs = 8;    // 发布平台ID集合 (json 格式字符串) | ||||
|   string mediaNames = 9;     // 自媒体账号名称集合 | ||||
|   string mediaAccIDs = 10;   // 自媒体账号ID集合 | ||||
|   string workTitle = 11;     // 作品标题 | ||||
|   string submitTime = 12;    // 提交时间 | ||||
|   string operatorName = 13;  // 操作人名称 | ||||
|   string operatorPhone = 14; // 操作人手机号 | ||||
|   uint32 status = 15;        // 1 有效 2 失效 | ||||
| } | ||||
| 
 | ||||
| message GetImageWorkDetailReq { | ||||
|    string workId = 1; | ||||
| } | ||||
| 
 | ||||
| message GetVedioWorkDetailReq { | ||||
|    string workId = 1; | ||||
| } | ||||
| 
 | ||||
| message  GetImageWorkDetailResp{ | ||||
|   string workId = 1; | ||||
|   string coverUrl = 2; | ||||
|   string videoUrl = 3; | ||||
|   int64 createdAt = 4; | ||||
| } | ||||
| 
 | ||||
| message  GetVedioeWorkDetailResp{ | ||||
|   string workId = 1; | ||||
|   repeated string imageUrls = 2; | ||||
|   int64 createdAt = 3; | ||||
| } | ||||
| 
 | ||||
| message ToBeComfirmedWorksReq{ | ||||
|   string artistUuid = 1; | ||||
|   int32 page = 2; | ||||
|   int32 pageSize =3; | ||||
| } | ||||
| 
 | ||||
| message ToBeComfirmedWorksResp{ | ||||
|   string uuid = 1;       // 作品uuid | ||||
|   uint32 workCategory = 2;   // 1 图文 2 视频 | ||||
|   string platformIDs = 3;    // 发布平台ID集合 (json 格式字符串) | ||||
|   string mediaNames = 4;     // 自媒体账号名称集合 | ||||
|   string mediaAccIDs = 5;   // 自媒体账号ID集合 | ||||
|   string title = 6;     // 作品标题 | ||||
|   string content = 7;     // 作品标题 | ||||
|   string submitTime = 8;    // 提交时间 | ||||
|   string operatorName = 9;  // 操作人名称 | ||||
|   string operatorPhone = 10; // 操作人手机号 | ||||
|   uint32 status = 11;        // 1 待提交 2 审核中 3 审核失败 4 待艺人确认 5 艺人驳回 6 发布成功 7 发布失败 | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -293,6 +293,9 @@ func (this *BundleExtendRecordsListResponse) Validate() error { | ||||
| func (this *BundleExtendRecordItem) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetBundleBalanceListReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetBundleBalanceReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| @ -309,3 +312,59 @@ func (this *GetBundleBalanceResp) Validate() error { | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetBundleBalanceListResp) Validate() error { | ||||
| 	for _, item := range this.Data { | ||||
| 		if item != nil { | ||||
| 			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { | ||||
| 				return github_com_mwitkow_go_proto_validators.FieldError("Data", err) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| func (this *CreateBundleBalanceReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *CreateBundleBalanceResp) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *AddBundleBalanceReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *AddBundleBalanceResp) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetUsedRecordListReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetUsedRecordListResp) Validate() error { | ||||
| 	for _, item := range this.Data { | ||||
| 		if item != nil { | ||||
| 			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { | ||||
| 				return github_com_mwitkow_go_proto_validators.FieldError("Data", err) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| func (this *WorkCastItem) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetImageWorkDetailReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetVedioWorkDetailReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetImageWorkDetailResp) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *GetVedioeWorkDetailResp) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *ToBeComfirmedWorksReq) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
| func (this *ToBeComfirmedWorksResp) Validate() error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| // Code generated by protoc-gen-go-triple. DO NOT EDIT.
 | ||||
| // versions:
 | ||||
| // - protoc-gen-go-triple v1.0.8
 | ||||
| // - protoc             v4.24.0--rc1
 | ||||
| // - protoc             v3.20.3
 | ||||
| // source: pb/bundle.proto
 | ||||
| 
 | ||||
| package bundle | ||||
| @ -46,11 +46,11 @@ type BundleClient interface { | ||||
| 	CreateOrderAddRecord(ctx context.Context, in *OrderAddRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | ||||
| 	PackagePriceAndTime(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*PackagePriceAndTimeResponse, common.ErrorWithAttachment) | ||||
| 	OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, 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) | ||||
| @ -59,7 +59,14 @@ type BundleClient interface { | ||||
| 	// 余量管理
 | ||||
| 	BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) | ||||
| 	BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) | ||||
| 	GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) | ||||
| 	GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) | ||||
| 	CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) | ||||
| 	AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment) | ||||
| 	// 使用记录
 | ||||
| 	GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment) | ||||
| 	GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment) | ||||
| 	GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment) | ||||
| 	ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment) | ||||
| } | ||||
| 
 | ||||
| type bundleClient struct { | ||||
| @ -95,7 +102,13 @@ type BundleClientImpl struct { | ||||
| 	CalculatePrice                       func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) | ||||
| 	BundleExtend                         func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) | ||||
| 	BundleExtendRecordsList              func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||
| 	GetBundleBalance                     func(ctx context.Context, in *GetBundleBalanceReq) (*GetBundleBalanceResp, error) | ||||
| 	GetBundleBalanceList                 func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | ||||
| 	CreateBundleBalance                  func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) | ||||
| 	AddBundleBalance                     func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error) | ||||
| 	GetUsedRecordList                    func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error) | ||||
| 	GetImageWorkDetail                   func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) | ||||
| 	GetVedioWorkDetail                   func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) | ||||
| 	ToBeComfirmedWorks                   func(ctx context.Context, in *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) | ||||
| } | ||||
| 
 | ||||
| func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient { | ||||
| @ -278,10 +291,46 @@ func (c *bundleClient) BundleExtendRecordsList(ctx context.Context, in *BundleEx | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) { | ||||
| 	out := new(GetBundleBalanceResp) | ||||
| func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) { | ||||
| 	out := new(GetBundleBalanceListResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalance", in, out) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) { | ||||
| 	out := new(CreateBundleBalanceResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateBundleBalance", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment) { | ||||
| 	out := new(AddBundleBalanceResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddBundleBalance", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment) { | ||||
| 	out := new(GetUsedRecordListResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUsedRecordList", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment) { | ||||
| 	out := new(GetImageWorkDetailResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetImageWorkDetail", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment) { | ||||
| 	out := new(GetVedioeWorkDetailResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetVedioWorkDetail", in, out) | ||||
| } | ||||
| 
 | ||||
| func (c *bundleClient) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment) { | ||||
| 	out := new(ToBeComfirmedWorksResp) | ||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ToBeComfirmedWorks", in, out) | ||||
| } | ||||
| 
 | ||||
| // BundleServer is the server API for Bundle service.
 | ||||
| @ -306,11 +355,11 @@ type BundleServer interface { | ||||
| 	CreateOrderAddRecord(context.Context, *OrderAddRecord) (*CommonResponse, error) | ||||
| 	PackagePriceAndTime(context.Context, *OrderRecord) (*PackagePriceAndTimeResponse, error) | ||||
| 	OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, 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) | ||||
| @ -319,7 +368,14 @@ type BundleServer interface { | ||||
| 	// 余量管理
 | ||||
| 	BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) | ||||
| 	BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||
| 	GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) | ||||
| 	GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | ||||
| 	CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) | ||||
| 	AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) | ||||
| 	// 使用记录
 | ||||
| 	GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error) | ||||
| 	GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) | ||||
| 	GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) | ||||
| 	ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) | ||||
| 	mustEmbedUnimplementedBundleServer() | ||||
| } | ||||
| 
 | ||||
| @ -412,8 +468,26 @@ func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequ | ||||
| func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalance not implemented") | ||||
| func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method AddBundleBalance not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetUsedRecordList not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetImageWorkDetail not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetVedioWorkDetail not implemented") | ||||
| } | ||||
| func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) { | ||||
| 	return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented") | ||||
| } | ||||
| func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) { | ||||
| 	s.proxyImpl = impl | ||||
| @ -1255,8 +1329,8 @@ func _Bundle_BundleExtendRecordsList_Handler(srv interface{}, ctx context.Contex | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(GetBundleBalanceReq) | ||||
| func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(GetBundleBalanceListReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| @ -1268,7 +1342,181 @@ func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("GetBundleBalance", args, invAttachment) | ||||
| 	invo := invocation.NewRPCInvocation("GetBundleBalanceList", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_CreateBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(CreateBundleBalanceReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("CreateBundleBalance", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_AddBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(AddBundleBalanceReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("AddBundleBalance", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_GetUsedRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(GetUsedRecordListReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("GetUsedRecordList", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_GetImageWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(GetImageWorkDetailReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("GetImageWorkDetail", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_GetVedioWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(GetVedioWorkDetailReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("GetVedioWorkDetail", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	info := &grpc_go.UnaryServerInfo{ | ||||
| 		Server:     srv, | ||||
| 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||
| 	} | ||||
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| 	} | ||||
| 	return interceptor(ctx, in, info, handler) | ||||
| } | ||||
| 
 | ||||
| func _Bundle_ToBeComfirmedWorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||
| 	in := new(ToBeComfirmedWorksReq) | ||||
| 	if err := dec(in); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||
| 	args := []interface{}{} | ||||
| 	args = append(args, in) | ||||
| 	md, _ := metadata.FromIncomingContext(ctx) | ||||
| 	invAttachment := make(map[string]interface{}, len(md)) | ||||
| 	for k, v := range md { | ||||
| 		invAttachment[k] = v | ||||
| 	} | ||||
| 	invo := invocation.NewRPCInvocation("ToBeComfirmedWorks", args, invAttachment) | ||||
| 	if interceptor == nil { | ||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||
| 		return result, result.Error() | ||||
| @ -1404,8 +1652,32 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{ | ||||
| 			Handler:    _Bundle_BundleExtendRecordsList_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "GetBundleBalance", | ||||
| 			Handler:    _Bundle_GetBundleBalance_Handler, | ||||
| 			MethodName: "GetBundleBalanceList", | ||||
| 			Handler:    _Bundle_GetBundleBalanceList_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "CreateBundleBalance", | ||||
| 			Handler:    _Bundle_CreateBundleBalance_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "AddBundleBalance", | ||||
| 			Handler:    _Bundle_AddBundleBalance_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "GetUsedRecordList", | ||||
| 			Handler:    _Bundle_GetUsedRecordList_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "GetImageWorkDetail", | ||||
| 			Handler:    _Bundle_GetImageWorkDetail_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "GetVedioWorkDetail", | ||||
| 			Handler:    _Bundle_GetVedioWorkDetail_Handler, | ||||
| 		}, | ||||
| 		{ | ||||
| 			MethodName: "ToBeComfirmedWorks", | ||||
| 			Handler:    _Bundle_ToBeComfirmedWorks_Handler, | ||||
| 		}, | ||||
| 	}, | ||||
| 	Streams:  []grpc_go.StreamDesc{}, | ||||
|  | ||||
| @ -53,6 +53,7 @@ func loadMysqlConn(conn string) *gorm.DB { | ||||
| 		&model.ValueAddServiceHistory{}, | ||||
| 		&model.BundleOrderValueAdd{}, | ||||
| 		&model.BundleExtensionRecords{}, | ||||
| 		&model.BundleBalance{}, | ||||
| 	) | ||||
| 
 | ||||
| 	if err != nil { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user