Refactor: Remove deprecated gRPC service files and implement new API structure

- Deleted old gRPC service definitions in `game_grpc.pb.go` and `public.go`.
- Added new API server implementations for objectstory, player, and shop services.
- Introduced configuration files for new APIs in `etc/*.yaml`.
- Created main entry points for each service in `objectstory.go`, `player.go`, and `shop.go`.
- Removed unused user update handler and user API files.
- Added utility functions for context management and HTTP header parsing.
- Introduced PostgreSQL backup configuration in `backup/postgreSql.yaml`.
This commit is contained in:
wwweww
2026-02-28 18:35:56 +08:00
parent d2f33b4b96
commit 19cc7a778c
349 changed files with 42548 additions and 1453 deletions
+3 -1
View File
@@ -14,11 +14,13 @@ Prometheus:
# Target: k8s://juwan/<service name>.<namespace>:8080
SnowflakeRpcConf:
Target: k8s://juwan/snowflake-svc:8080
DB:
Master: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@user-db-rw.juwan:${DB_PORT}/${DB_NAME}?sslmode=disable"
Slave: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@user-db-ro.juwan:${DB_PORT}/${DB_NAME}?sslmode=disable"
Slaves: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@user-db-ro.juwan:${DB_PORT}/${DB_NAME}?sslmode=disable"
CacheConf:
+11 -2
View File
@@ -42,17 +42,26 @@ func (l *AddShopsLogic) AddShops(in *pb.AddShopsReq) (*pb.AddShopsResp, error) {
return nil, errors.New("invalid template config")
}
rating, err := decimal.NewFromString(in.Rating)
if err != nil {
return nil, errors.New("invalid rating")
}
commissionValue, err := decimal.NewFromString(in.CommissionValue)
if err != nil {
return nil, errors.New("invalid commissionValue")
}
_, err = l.svcCtx.ShopModelRO.Shops.Create().
SetID(idResp.Id).
SetOwnerID(in.OwnerId).
SetName(in.Name).
SetBanner(in.Banner).
SetDescription(in.Description).
SetRating(decimal.NewFromFloat(in.Rating)).
SetRating(rating).
SetTotalOrders(int(in.TotalOrders)).
SetPlayerCount(int(in.PlayerCount)).
SetNillableCommissionType(&in.CommissionType).
SetCommissionValue(decimal.NewFromFloat(in.CommissionValue)).
SetCommissionValue(commissionValue).
SetAllowMultiShop(in.AllowMultiShop).
SetAllowIndependentOrders(in.AllowIndependentOrders).
SetDispatchMode(in.DispatchMode).
@@ -43,11 +43,11 @@ func (l *GetShopsByIdLogic) GetShopsById(in *pb.GetShopsByIdReq) (*pb.GetShopsBy
Id: shop.ID,
OwnerId: shop.OwnerID,
Name: shop.Name,
Rating: shop.Rating.InexactFloat64(),
Rating: shop.Rating.String(),
TotalOrders: int64(shop.TotalOrders),
PlayerCount: int64(shop.PlayerCount),
CommissionType: shop.CommissionType,
CommissionValue: shop.CommissionValue.InexactFloat64(),
CommissionValue: shop.CommissionValue.String(),
AllowMultiShop: shop.AllowMultiShop,
AllowIndependentOrders: shop.AllowIndependentOrders,
DispatchMode: shop.DispatchMode,
@@ -2,8 +2,12 @@ package logic
import (
"context"
"errors"
"juwan-backend/app/shop/rpc/internal/models/predicate"
"juwan-backend/app/shop/rpc/internal/models/shopinvitations"
"juwan-backend/app/shop/rpc/internal/svc"
"juwan-backend/app/shop/rpc/pb"
"time"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -23,6 +27,65 @@ func NewSearchShopInvitationsLogic(ctx context.Context, svcCtx *svc.ServiceConte
}
func (l *SearchShopInvitationsLogic) SearchShopInvitations(in *pb.SearchShopInvitationsReq) (*pb.SearchShopInvitationsResp, error) {
// TODO: implement search logic based on the provided criteria in the request
return &pb.SearchShopInvitationsResp{}, nil
if in.Limit <= 0 {
in.Limit = 20
}
if in.Limit > 1000 {
return nil, errors.New("limit too large")
}
preds := make([]predicate.ShopInvitations, 0, 8)
if in.Id > 0 {
preds = append(preds, shopinvitations.IDEQ(in.Id))
}
if in.ShopId > 0 {
preds = append(preds, shopinvitations.ShopIDEQ(in.ShopId))
}
if in.PlayerId > 0 {
preds = append(preds, shopinvitations.PlayerIDEQ(in.PlayerId))
}
if in.Status != "" {
preds = append(preds, shopinvitations.StatusEQ(in.Status))
}
if in.InvitedBy > 0 {
preds = append(preds, shopinvitations.InvitedByEQ(in.InvitedBy))
}
if in.CreatedAt > 0 {
preds = append(preds, shopinvitations.CreatedAtGTE(time.Unix(in.CreatedAt, 0)))
}
if in.RespondedAt > 0 {
preds = append(preds, shopinvitations.RespondedAtGTE(time.Unix(in.RespondedAt, 0)))
}
query := l.svcCtx.ShopModelRO.ShopInvitations.Query()
if len(preds) > 0 {
query = query.Where(shopinvitations.And(preds...))
}
list, err := query.
Offset(int(in.Page * in.Limit)).
Limit(int(in.Limit)).
All(l.ctx)
if err != nil {
logx.Errorf("search shop invitations failed, %s", err.Error())
return nil, errors.New("search shop invitations failed")
}
result := make([]*pb.ShopInvitations, 0, len(list))
for _, item := range list {
pbItem := &pb.ShopInvitations{
Id: item.ID,
ShopId: item.ShopID,
PlayerId: item.PlayerID,
Status: item.Status,
InvitedBy: item.InvitedBy,
CreatedAt: item.CreatedAt.Unix(),
}
if item.RespondedAt != nil {
pbItem.RespondedAt = item.RespondedAt.Unix()
}
result = append(result, pbItem)
}
return &pb.SearchShopInvitationsResp{ShopInvitations: result}, nil
}
@@ -2,7 +2,12 @@ package logic
import (
"context"
"errors"
"juwan-backend/app/shop/rpc/internal/models/predicate"
"juwan-backend/app/shop/rpc/internal/models/shopplayers"
"juwan-backend/app/shop/rpc/internal/svc"
"juwan-backend/app/shop/rpc/pb"
"time"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -22,5 +27,57 @@ func NewSearchShopPlayersLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
func (l *SearchShopPlayersLogic) SearchShopPlayers(in *pb.SearchShopPlayersReq) (*pb.SearchShopPlayersResp, error) {
if in.Limit <= 0 {
in.Limit = 20
}
if in.Limit > 1000 {
return nil, errors.New("limit too large")
}
preds := make([]predicate.ShopPlayers, 0, 8)
if in.ShopId > 0 {
preds = append(preds, shopplayers.ShopIDEQ(in.ShopId))
}
if in.PlayerId > 0 {
preds = append(preds, shopplayers.PlayerIDEQ(in.PlayerId))
}
if in.IsPrimary {
preds = append(preds, shopplayers.IsPrimaryEQ(true))
}
if in.JoinedAt > 0 {
preds = append(preds, shopplayers.JoinedAtGTE(time.Unix(in.JoinedAt, 0)))
}
if in.LeftAt > 0 {
preds = append(preds, shopplayers.LeftAtGTE(time.Unix(in.LeftAt, 0)))
}
query := l.svcCtx.ShopModelRO.ShopPlayers.Query()
if len(preds) > 0 {
query = query.Where(shopplayers.And(preds...))
}
list, err := query.
Offset(int(in.Page * in.Limit)).
Limit(int(in.Limit)).
All(l.ctx)
if err != nil {
logx.Errorf("search shop players failed, %s", err.Error())
return nil, errors.New("search shop players failed")
}
result := make([]*pb.ShopPlayers, 0, len(list))
for _, item := range list {
pbItem := &pb.ShopPlayers{
ShopId: item.ShopID,
PlayerId: item.PlayerID,
IsPrimary: item.IsPrimary,
JoinedAt: item.JoinedAt.Unix(),
}
if item.LeftAt != nil {
pbItem.LeftAt = item.LeftAt.Unix()
}
result = append(result, pbItem)
}
return &pb.SearchShopPlayersResp{ShopPlayers: result}, nil
}
@@ -2,9 +2,17 @@ package logic
import (
"context"
"errors"
"juwan-backend/app/shop/rpc/internal/models/predicate"
"juwan-backend/app/shop/rpc/internal/models/shops"
"time"
"juwan-backend/app/shop/rpc/internal/svc"
"juwan-backend/app/shop/rpc/pb"
"encoding/json"
"github.com/shopspring/decimal"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -23,5 +31,112 @@ func NewSearchShopsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Searc
}
func (l *SearchShopsLogic) SearchShops(in *pb.SearchShopsReq) (*pb.SearchShopsResp, error) {
if in.Limit <= 0 {
in.Limit = 20
}
if in.Limit > 1000 {
return nil, errors.New("limit too large")
}
preds := make([]predicate.Shops, 0, 12)
if in.Id > 0 {
preds = append(preds, shops.IDEQ(in.Id))
}
if in.OwnerId > 0 {
preds = append(preds, shops.OwnerIDEQ(in.OwnerId))
}
if in.Name != "" {
preds = append(preds, shops.NameContainsFold(in.Name))
}
if in.Description != "" {
preds = append(preds, shops.DescriptionContainsFold(in.Description))
}
if in.CommissionType != "" {
preds = append(preds, shops.CommissionTypeEQ(in.CommissionType))
}
if in.DispatchMode != "" {
preds = append(preds, shops.DispatchModeEQ(in.DispatchMode))
}
if in.Rating != "" {
rating, perr := decimal.NewFromString(in.Rating)
if perr != nil {
return nil, errors.New("invalid rating")
}
preds = append(preds, shops.RatingGTE(rating))
}
if in.CommissionValue != "" {
commissionValue, perr := decimal.NewFromString(in.CommissionValue)
if perr != nil {
return nil, errors.New("invalid commissionValue")
}
preds = append(preds, shops.CommissionValueGTE(commissionValue))
}
if in.TotalOrders > 0 {
preds = append(preds, shops.TotalOrdersGTE(int(in.TotalOrders)))
}
if in.PlayerCount > 0 {
preds = append(preds, shops.PlayerCountGTE(int(in.PlayerCount)))
}
if in.AllowMultiShop {
preds = append(preds, shops.AllowMultiShopEQ(true))
}
if in.AllowIndependentOrders {
preds = append(preds, shops.AllowIndependentOrdersEQ(true))
}
if in.CreatedAt > 0 {
preds = append(preds, shops.CreatedAtGTE(time.Unix(in.CreatedAt, 0)))
}
if in.UpdatedAt > 0 {
preds = append(preds, shops.UpdatedAtGTE(time.Unix(in.UpdatedAt, 0)))
}
query := l.svcCtx.ShopModelRO.Shops.Query()
if len(preds) > 0 {
query = query.Where(shops.And(preds...))
}
list, err := query.
Offset(int(in.Page * in.Limit)).
Limit(int(in.Limit)).
All(l.ctx)
if err != nil {
logx.Errorf("search shops failed, %s", err.Error())
return nil, errors.New("search shops failed")
}
result := make([]*pb.Shops, 0, len(list))
for _, item := range list {
templateConfigBytes, err := json.Marshal(item.TemplateConfig)
if err != nil {
logx.WithContext(l.ctx).Errorf("marshal template config failed: %v", err)
continue
}
pbItem := &pb.Shops{
Id: item.ID,
OwnerId: item.OwnerID,
Name: item.Name,
Rating: item.Rating.String(),
TotalOrders: int64(item.TotalOrders),
PlayerCount: int64(item.PlayerCount),
CommissionType: item.CommissionType,
CommissionValue: item.CommissionValue.String(),
AllowMultiShop: item.AllowMultiShop,
AllowIndependentOrders: item.AllowIndependentOrders,
DispatchMode: item.DispatchMode,
Announcements: item.Announcements,
TemplateConfig: string(templateConfigBytes),
CreatedAt: item.CreatedAt.Unix(),
UpdatedAt: item.UpdatedAt.Unix(),
}
if item.Banner != nil {
pbItem.Banner = *item.Banner
}
if item.Description != nil {
pbItem.Description = *item.Description
}
result = append(result, pbItem)
}
return &pb.SearchShopsResp{Shops: result}, nil
}
@@ -3,11 +3,11 @@ package logic
import (
"context"
"errors"
"time"
"juwan-backend/app/shop/rpc/internal/models/shopinvitations"
"juwan-backend/app/shop/rpc/internal/svc"
"juwan-backend/app/shop/rpc/pb"
"github.com/jinzhu/copier"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -26,5 +26,19 @@ func NewUpdateShopInvitationsLogic(ctx context.Context, svcCtx *svc.ServiceConte
}
func (l *UpdateShopInvitationsLogic) UpdateShopInvitations(in *pb.UpdateShopInvitationsReq) (*pb.UpdateShopInvitationsResp, error) {
update, err := l.svcCtx.ShopModelRW.ShopInvitations.UpdateOneID(in.Id).
Where(shopinvitations.PlayerIDEQ(in.PlayerId)).
SetStatus(in.Status).Save(l.ctx)
if err != nil {
logx.Errorf("failed to update shop invitation: %v", err)
return nil, errors.New("failed to update shop invitation")
}
resp := &pb.ShopInvitations{}
err = copier.Copy(resp, update)
if err != nil {
logx.Errorf("failed to copy update: %v", err)
return nil, errors.New("failed to update shop invitation")
}
return &pb.UpdateShopInvitationsResp{ShopInvitations: resp}, nil
}
@@ -3,7 +3,7 @@ package logic
import (
"context"
"errors"
"juwan-backend/app/shop/rpc/internal/models"
"juwan-backend/app/shop/rpc/internal/models/predicate"
"juwan-backend/app/shop/rpc/internal/models/shopplayers"
"time"
@@ -28,5 +28,32 @@ func NewUpdateShopPlayersLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
func (l *UpdateShopPlayersLogic) UpdateShopPlayers(in *pb.UpdateShopPlayersReq) (*pb.UpdateShopPlayersResp, error) {
if in.ShopId <= 0 || in.PlayerId <= 0 {
return nil, errors.New("invalid shop_id or player_id")
}
preds := []predicate.ShopPlayers{
shopplayers.ShopIDEQ(in.ShopId),
shopplayers.PlayerIDEQ(in.PlayerId),
}
updater := l.svcCtx.ShopModelRW.ShopPlayers.Update().
Where(shopplayers.And(preds...)).
SetIsPrimary(in.IsPrimary)
if in.LeftAt > 0 {
t := time.Unix(in.LeftAt, 0)
updater = updater.SetLeftAt(t)
}
affected, err := updater.Save(l.ctx)
if err != nil {
logx.Errorf("update shop players failed, %s", err.Error())
return nil, errors.New("update shop players failed")
}
if affected == 0 {
return nil, errors.New("shop player not found")
}
return &pb.UpdateShopPlayersResp{}, nil
}
@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"errors"
"juwan-backend/app/shop/rpc/internal/models/shops"
"time"
"juwan-backend/app/shop/rpc/internal/svc"
@@ -28,5 +29,74 @@ func NewUpdateShopsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat
}
func (l *UpdateShopsLogic) UpdateShops(in *pb.UpdateShopsReq) (*pb.UpdateShopsResp, error) {
updater := l.svcCtx.ShopModelRW.Shops.UpdateOneID(in.Id)
if in.OwnerId > 0 {
updater = updater.SetOwnerID(in.OwnerId)
}
if in.Name != "" {
updater = updater.SetName(in.Name)
}
if in.Banner != "" {
updater = updater.SetBanner(in.Banner)
}
if in.Description != "" {
updater = updater.SetDescription(in.Description)
}
if in.Rating != "" {
rating, perr := decimal.NewFromString(in.Rating)
if perr != nil {
return nil, errors.New("invalid rating")
}
updater = updater.SetRating(rating)
}
if in.TotalOrders > 0 {
updater = updater.SetTotalOrders(int(in.TotalOrders))
}
if in.PlayerCount > 0 {
updater = updater.SetPlayerCount(int(in.PlayerCount))
}
if in.CommissionType != "" {
updater = updater.SetCommissionType(in.CommissionType)
}
if in.CommissionValue != "" {
commissionValue, perr := decimal.NewFromString(in.CommissionValue)
if perr != nil {
return nil, errors.New("invalid commissionValue")
}
updater = updater.SetCommissionValue(commissionValue)
}
if in.DispatchMode != "" {
updater = updater.SetDispatchMode(in.DispatchMode)
}
updater = updater.
SetAllowMultiShop(in.AllowMultiShop).
SetAllowIndependentOrders(in.AllowIndependentOrders)
if len(in.Announcements) > 0 {
updater = updater.SetAnnouncements(in.Announcements)
}
if in.TemplateConfig != "" {
var templateConfig map[string]interface{}
err := json.Unmarshal([]byte(in.TemplateConfig), &templateConfig)
if err != nil {
logx.WithContext(l.ctx).Errorf("invalid template config: %v", err)
return nil, errors.New("invalid template config")
}
updater = updater.SetTemplateConfig(templateConfig)
}
if in.UpdatedAt > 0 {
updater = updater.SetUpdatedAt(time.Unix(in.UpdatedAt, 0))
}
_, err := updater.Where(shops.IDEQ(in.Id)).Save(l.ctx)
if err != nil {
logx.WithContext(l.ctx).Errorf("update shops failed: %v", err)
return nil, errors.New("update shops failed")
}
return &pb.UpdateShopsResp{}, nil
}
+17 -2
View File
@@ -1,16 +1,19 @@
package svc
import (
"fmt"
"juwan-backend/app/shop/rpc/internal/config"
"juwan-backend/app/shop/rpc/internal/models"
"juwan-backend/app/snowflake/rpc/snowflake"
"juwan-backend/common/redisx"
"juwan-backend/common/snowflakex"
"juwan-backend/pkg/adapter"
"strings"
"time"
"ariga.io/entcache"
"entgo.io/ent/dialect/sql"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -40,10 +43,22 @@ func NewServiceContext(c config.Config) *ServiceContext {
RWDrv := entcache.NewDriver(RWConn, entcache.TTL(30*time.Second), entcache.Levels(adapter.NewRedisCache(redisCluster.Client)))
RODrv := entcache.NewDriver(ROConn, entcache.TTL(30*time.Second), entcache.Levels(adapter.NewRedisCache(redisCluster.Client)))
entLogFn := func(v ...any) {
logx.Infof("[ent][shop] %s", fmt.Sprint(v...))
}
rwModelOpts := []models.Option{models.Driver(RWDrv), models.Log(entLogFn)}
roModelOpts := []models.Option{models.Driver(RODrv), models.Log(entLogFn)}
if strings.EqualFold(c.Log.Level, "debug") {
rwModelOpts = append(rwModelOpts, models.Debug())
roModelOpts = append(roModelOpts, models.Debug())
}
return &ServiceContext{
Config: c,
Snowflake: snowflakex.NewClient(c.SnowflakeRpcConf),
ShopModelRO: models.NewClient(models.Driver(RODrv)),
ShopModelRW: models.NewClient(models.Driver(RWDrv)),
ShopModelRO: models.NewClient(roModelOpts...),
ShopModelRW: models.NewClient(rwModelOpts...),
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
conf.MustLoad(*configFile, &c, conf.UseEnv())
ctx := svc.NewServiceContext(c)
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
+88 -78
View File
@@ -327,9 +327,10 @@ func (x *UpdateShopInvitationsReq) GetRespondedAt() int64 {
}
type UpdateShopInvitationsResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
ShopInvitations *ShopInvitations `protobuf:"bytes,1,opt,name=shopInvitations,proto3" json:"shopInvitations,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateShopInvitationsResp) Reset() {
@@ -362,6 +363,13 @@ func (*UpdateShopInvitationsResp) Descriptor() ([]byte, []int) {
return file_shop_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateShopInvitationsResp) GetShopInvitations() *ShopInvitations {
if x != nil {
return x.ShopInvitations
}
return nil
}
type DelShopInvitationsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id
@@ -1295,11 +1303,11 @@ type Shops struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` //name
Banner string `protobuf:"bytes,4,opt,name=banner,proto3" json:"banner,omitempty"` //banner
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` //description
Rating float64 `protobuf:"fixed64,6,opt,name=rating,proto3" json:"rating,omitempty"` //rating
Rating string `protobuf:"bytes,6,opt,name=rating,proto3" json:"rating,omitempty"` //rating
TotalOrders int64 `protobuf:"varint,7,opt,name=totalOrders,proto3" json:"totalOrders,omitempty"` //totalOrders
PlayerCount int64 `protobuf:"varint,8,opt,name=playerCount,proto3" json:"playerCount,omitempty"` //playerCount
CommissionType string `protobuf:"bytes,9,opt,name=commissionType,proto3" json:"commissionType,omitempty"` //commissionType
CommissionValue float64 `protobuf:"fixed64,10,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
CommissionValue string `protobuf:"bytes,10,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
AllowMultiShop bool `protobuf:"varint,11,opt,name=allowMultiShop,proto3" json:"allowMultiShop,omitempty"` //allowMultiShop
AllowIndependentOrders bool `protobuf:"varint,12,opt,name=allowIndependentOrders,proto3" json:"allowIndependentOrders,omitempty"` //allowIndependentOrders
DispatchMode string `protobuf:"bytes,13,opt,name=dispatchMode,proto3" json:"dispatchMode,omitempty"` //dispatchMode
@@ -1376,11 +1384,11 @@ func (x *Shops) GetDescription() string {
return ""
}
func (x *Shops) GetRating() float64 {
func (x *Shops) GetRating() string {
if x != nil {
return x.Rating
}
return 0
return ""
}
func (x *Shops) GetTotalOrders() int64 {
@@ -1404,11 +1412,11 @@ func (x *Shops) GetCommissionType() string {
return ""
}
func (x *Shops) GetCommissionValue() float64 {
func (x *Shops) GetCommissionValue() string {
if x != nil {
return x.CommissionValue
}
return 0
return ""
}
func (x *Shops) GetAllowMultiShop() bool {
@@ -1466,11 +1474,11 @@ type AddShopsReq struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //name
Banner string `protobuf:"bytes,3,opt,name=banner,proto3" json:"banner,omitempty"` //banner
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` //description
Rating float64 `protobuf:"fixed64,5,opt,name=rating,proto3" json:"rating,omitempty"` //rating
Rating string `protobuf:"bytes,5,opt,name=rating,proto3" json:"rating,omitempty"` //rating
TotalOrders int64 `protobuf:"varint,6,opt,name=totalOrders,proto3" json:"totalOrders,omitempty"` //totalOrders
PlayerCount int64 `protobuf:"varint,7,opt,name=playerCount,proto3" json:"playerCount,omitempty"` //playerCount
CommissionType string `protobuf:"bytes,8,opt,name=commissionType,proto3" json:"commissionType,omitempty"` //commissionType
CommissionValue float64 `protobuf:"fixed64,9,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
CommissionValue string `protobuf:"bytes,9,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
AllowMultiShop bool `protobuf:"varint,10,opt,name=allowMultiShop,proto3" json:"allowMultiShop,omitempty"` //allowMultiShop
AllowIndependentOrders bool `protobuf:"varint,11,opt,name=allowIndependentOrders,proto3" json:"allowIndependentOrders,omitempty"` //allowIndependentOrders
DispatchMode string `protobuf:"bytes,12,opt,name=dispatchMode,proto3" json:"dispatchMode,omitempty"` //dispatchMode
@@ -1540,11 +1548,11 @@ func (x *AddShopsReq) GetDescription() string {
return ""
}
func (x *AddShopsReq) GetRating() float64 {
func (x *AddShopsReq) GetRating() string {
if x != nil {
return x.Rating
}
return 0
return ""
}
func (x *AddShopsReq) GetTotalOrders() int64 {
@@ -1568,11 +1576,11 @@ func (x *AddShopsReq) GetCommissionType() string {
return ""
}
func (x *AddShopsReq) GetCommissionValue() float64 {
func (x *AddShopsReq) GetCommissionValue() string {
if x != nil {
return x.CommissionValue
}
return 0
return ""
}
func (x *AddShopsReq) GetAllowMultiShop() bool {
@@ -1667,11 +1675,11 @@ type UpdateShopsReq struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` //name
Banner string `protobuf:"bytes,4,opt,name=banner,proto3" json:"banner,omitempty"` //banner
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` //description
Rating float64 `protobuf:"fixed64,6,opt,name=rating,proto3" json:"rating,omitempty"` //rating
Rating string `protobuf:"bytes,6,opt,name=rating,proto3" json:"rating,omitempty"` //rating
TotalOrders int64 `protobuf:"varint,7,opt,name=totalOrders,proto3" json:"totalOrders,omitempty"` //totalOrders
PlayerCount int64 `protobuf:"varint,8,opt,name=playerCount,proto3" json:"playerCount,omitempty"` //playerCount
CommissionType string `protobuf:"bytes,9,opt,name=commissionType,proto3" json:"commissionType,omitempty"` //commissionType
CommissionValue float64 `protobuf:"fixed64,10,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
CommissionValue string `protobuf:"bytes,10,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
AllowMultiShop bool `protobuf:"varint,11,opt,name=allowMultiShop,proto3" json:"allowMultiShop,omitempty"` //allowMultiShop
AllowIndependentOrders bool `protobuf:"varint,12,opt,name=allowIndependentOrders,proto3" json:"allowIndependentOrders,omitempty"` //allowIndependentOrders
DispatchMode string `protobuf:"bytes,13,opt,name=dispatchMode,proto3" json:"dispatchMode,omitempty"` //dispatchMode
@@ -1748,11 +1756,11 @@ func (x *UpdateShopsReq) GetDescription() string {
return ""
}
func (x *UpdateShopsReq) GetRating() float64 {
func (x *UpdateShopsReq) GetRating() string {
if x != nil {
return x.Rating
}
return 0
return ""
}
func (x *UpdateShopsReq) GetTotalOrders() int64 {
@@ -1776,11 +1784,11 @@ func (x *UpdateShopsReq) GetCommissionType() string {
return ""
}
func (x *UpdateShopsReq) GetCommissionValue() float64 {
func (x *UpdateShopsReq) GetCommissionValue() string {
if x != nil {
return x.CommissionValue
}
return 0
return ""
}
func (x *UpdateShopsReq) GetAllowMultiShop() bool {
@@ -2045,11 +2053,11 @@ type SearchShopsReq struct {
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` //name
Banner string `protobuf:"bytes,6,opt,name=banner,proto3" json:"banner,omitempty"` //banner
Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` //description
Rating float64 `protobuf:"fixed64,8,opt,name=rating,proto3" json:"rating,omitempty"` //rating
Rating string `protobuf:"bytes,8,opt,name=rating,proto3" json:"rating,omitempty"` //rating
TotalOrders int64 `protobuf:"varint,9,opt,name=totalOrders,proto3" json:"totalOrders,omitempty"` //totalOrders
PlayerCount int64 `protobuf:"varint,10,opt,name=playerCount,proto3" json:"playerCount,omitempty"` //playerCount
CommissionType string `protobuf:"bytes,11,opt,name=commissionType,proto3" json:"commissionType,omitempty"` //commissionType
CommissionValue float64 `protobuf:"fixed64,12,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
CommissionValue string `protobuf:"bytes,12,opt,name=commissionValue,proto3" json:"commissionValue,omitempty"` //commissionValue
AllowMultiShop bool `protobuf:"varint,13,opt,name=allowMultiShop,proto3" json:"allowMultiShop,omitempty"` //allowMultiShop
AllowIndependentOrders bool `protobuf:"varint,14,opt,name=allowIndependentOrders,proto3" json:"allowIndependentOrders,omitempty"` //allowIndependentOrders
DispatchMode string `protobuf:"bytes,15,opt,name=dispatchMode,proto3" json:"dispatchMode,omitempty"` //dispatchMode
@@ -2140,11 +2148,11 @@ func (x *SearchShopsReq) GetDescription() string {
return ""
}
func (x *SearchShopsReq) GetRating() float64 {
func (x *SearchShopsReq) GetRating() string {
if x != nil {
return x.Rating
}
return 0
return ""
}
func (x *SearchShopsReq) GetTotalOrders() int64 {
@@ -2168,11 +2176,11 @@ func (x *SearchShopsReq) GetCommissionType() string {
return ""
}
func (x *SearchShopsReq) GetCommissionValue() float64 {
func (x *SearchShopsReq) GetCommissionValue() string {
if x != nil {
return x.CommissionValue
}
return 0
return ""
}
func (x *SearchShopsReq) GetAllowMultiShop() bool {
@@ -2297,8 +2305,9 @@ const file_shop_proto_rawDesc = "" +
"\x06status\x18\x04 \x01(\tR\x06status\x12\x1c\n" +
"\tinvitedBy\x18\x05 \x01(\x03R\tinvitedBy\x12\x1c\n" +
"\tcreatedAt\x18\x06 \x01(\x03R\tcreatedAt\x12 \n" +
"\vrespondedAt\x18\a \x01(\x03R\vrespondedAt\"\x1b\n" +
"\x19UpdateShopInvitationsResp\"'\n" +
"\vrespondedAt\x18\a \x01(\x03R\vrespondedAt\"Z\n" +
"\x19UpdateShopInvitationsResp\x12=\n" +
"\x0fshopInvitations\x18\x01 \x01(\v2\x13.pb.ShopInvitationsR\x0fshopInvitations\"'\n" +
"\x15DelShopInvitationsReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\"\x18\n" +
"\x16DelShopInvitationsResp\"+\n" +
@@ -2361,12 +2370,12 @@ const file_shop_proto_rawDesc = "" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" +
"\x06banner\x18\x04 \x01(\tR\x06banner\x12 \n" +
"\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" +
"\x06rating\x18\x06 \x01(\x01R\x06rating\x12 \n" +
"\x06rating\x18\x06 \x01(\tR\x06rating\x12 \n" +
"\vtotalOrders\x18\a \x01(\x03R\vtotalOrders\x12 \n" +
"\vplayerCount\x18\b \x01(\x03R\vplayerCount\x12&\n" +
"\x0ecommissionType\x18\t \x01(\tR\x0ecommissionType\x12(\n" +
"\x0fcommissionValue\x18\n" +
" \x01(\x01R\x0fcommissionValue\x12&\n" +
" \x01(\tR\x0fcommissionValue\x12&\n" +
"\x0eallowMultiShop\x18\v \x01(\bR\x0eallowMultiShop\x126\n" +
"\x16allowIndependentOrders\x18\f \x01(\bR\x16allowIndependentOrders\x12\"\n" +
"\fdispatchMode\x18\r \x01(\tR\fdispatchMode\x12$\n" +
@@ -2379,11 +2388,11 @@ const file_shop_proto_rawDesc = "" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" +
"\x06banner\x18\x03 \x01(\tR\x06banner\x12 \n" +
"\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" +
"\x06rating\x18\x05 \x01(\x01R\x06rating\x12 \n" +
"\x06rating\x18\x05 \x01(\tR\x06rating\x12 \n" +
"\vtotalOrders\x18\x06 \x01(\x03R\vtotalOrders\x12 \n" +
"\vplayerCount\x18\a \x01(\x03R\vplayerCount\x12&\n" +
"\x0ecommissionType\x18\b \x01(\tR\x0ecommissionType\x12(\n" +
"\x0fcommissionValue\x18\t \x01(\x01R\x0fcommissionValue\x12&\n" +
"\x0fcommissionValue\x18\t \x01(\tR\x0fcommissionValue\x12&\n" +
"\x0eallowMultiShop\x18\n" +
" \x01(\bR\x0eallowMultiShop\x126\n" +
"\x16allowIndependentOrders\x18\v \x01(\bR\x16allowIndependentOrders\x12\"\n" +
@@ -2399,12 +2408,12 @@ const file_shop_proto_rawDesc = "" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" +
"\x06banner\x18\x04 \x01(\tR\x06banner\x12 \n" +
"\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" +
"\x06rating\x18\x06 \x01(\x01R\x06rating\x12 \n" +
"\x06rating\x18\x06 \x01(\tR\x06rating\x12 \n" +
"\vtotalOrders\x18\a \x01(\x03R\vtotalOrders\x12 \n" +
"\vplayerCount\x18\b \x01(\x03R\vplayerCount\x12&\n" +
"\x0ecommissionType\x18\t \x01(\tR\x0ecommissionType\x12(\n" +
"\x0fcommissionValue\x18\n" +
" \x01(\x01R\x0fcommissionValue\x12&\n" +
" \x01(\tR\x0fcommissionValue\x12&\n" +
"\x0eallowMultiShop\x18\v \x01(\bR\x0eallowMultiShop\x126\n" +
"\x16allowIndependentOrders\x18\f \x01(\bR\x16allowIndependentOrders\x12\"\n" +
"\fdispatchMode\x18\r \x01(\tR\fdispatchMode\x12$\n" +
@@ -2428,12 +2437,12 @@ const file_shop_proto_rawDesc = "" +
"\x04name\x18\x05 \x01(\tR\x04name\x12\x16\n" +
"\x06banner\x18\x06 \x01(\tR\x06banner\x12 \n" +
"\vdescription\x18\a \x01(\tR\vdescription\x12\x16\n" +
"\x06rating\x18\b \x01(\x01R\x06rating\x12 \n" +
"\x06rating\x18\b \x01(\tR\x06rating\x12 \n" +
"\vtotalOrders\x18\t \x01(\x03R\vtotalOrders\x12 \n" +
"\vplayerCount\x18\n" +
" \x01(\x03R\vplayerCount\x12&\n" +
"\x0ecommissionType\x18\v \x01(\tR\x0ecommissionType\x12(\n" +
"\x0fcommissionValue\x18\f \x01(\x01R\x0fcommissionValue\x12&\n" +
"\x0fcommissionValue\x18\f \x01(\tR\x0fcommissionValue\x12&\n" +
"\x0eallowMultiShop\x18\r \x01(\bR\x0eallowMultiShop\x126\n" +
"\x16allowIndependentOrders\x18\x0e \x01(\bR\x16allowIndependentOrders\x12\"\n" +
"\fdispatchMode\x18\x0f \x01(\tR\fdispatchMode\x12$\n" +
@@ -2509,47 +2518,48 @@ var file_shop_proto_goTypes = []any{
(*SearchShopsResp)(nil), // 32: pb.SearchShopsResp
}
var file_shop_proto_depIdxs = []int32{
0, // 0: pb.GetShopInvitationsByIdResp.shopInvitations:type_name -> pb.ShopInvitations
0, // 1: pb.SearchShopInvitationsResp.shopInvitations:type_name -> pb.ShopInvitations
11, // 2: pb.GetShopPlayersByIdResp.shopPlayers:type_name -> pb.ShopPlayers
11, // 3: pb.SearchShopPlayersResp.shopPlayers:type_name -> pb.ShopPlayers
22, // 4: pb.GetShopsByIdResp.shops:type_name -> pb.Shops
22, // 5: pb.SearchShopsResp.shops:type_name -> pb.Shops
1, // 6: pb.shopService.AddShopInvitations:input_type -> pb.AddShopInvitationsReq
3, // 7: pb.shopService.UpdateShopInvitations:input_type -> pb.UpdateShopInvitationsReq
5, // 8: pb.shopService.DelShopInvitations:input_type -> pb.DelShopInvitationsReq
7, // 9: pb.shopService.GetShopInvitationsById:input_type -> pb.GetShopInvitationsByIdReq
9, // 10: pb.shopService.SearchShopInvitations:input_type -> pb.SearchShopInvitationsReq
12, // 11: pb.shopService.AddShopPlayers:input_type -> pb.AddShopPlayersReq
14, // 12: pb.shopService.UpdateShopPlayers:input_type -> pb.UpdateShopPlayersReq
16, // 13: pb.shopService.DelShopPlayers:input_type -> pb.DelShopPlayersReq
18, // 14: pb.shopService.GetShopPlayersById:input_type -> pb.GetShopPlayersByIdReq
20, // 15: pb.shopService.SearchShopPlayers:input_type -> pb.SearchShopPlayersReq
23, // 16: pb.shopService.AddShops:input_type -> pb.AddShopsReq
25, // 17: pb.shopService.UpdateShops:input_type -> pb.UpdateShopsReq
27, // 18: pb.shopService.DelShops:input_type -> pb.DelShopsReq
29, // 19: pb.shopService.GetShopsById:input_type -> pb.GetShopsByIdReq
31, // 20: pb.shopService.SearchShops:input_type -> pb.SearchShopsReq
2, // 21: pb.shopService.AddShopInvitations:output_type -> pb.AddShopInvitationsResp
4, // 22: pb.shopService.UpdateShopInvitations:output_type -> pb.UpdateShopInvitationsResp
6, // 23: pb.shopService.DelShopInvitations:output_type -> pb.DelShopInvitationsResp
8, // 24: pb.shopService.GetShopInvitationsById:output_type -> pb.GetShopInvitationsByIdResp
10, // 25: pb.shopService.SearchShopInvitations:output_type -> pb.SearchShopInvitationsResp
13, // 26: pb.shopService.AddShopPlayers:output_type -> pb.AddShopPlayersResp
15, // 27: pb.shopService.UpdateShopPlayers:output_type -> pb.UpdateShopPlayersResp
17, // 28: pb.shopService.DelShopPlayers:output_type -> pb.DelShopPlayersResp
19, // 29: pb.shopService.GetShopPlayersById:output_type -> pb.GetShopPlayersByIdResp
21, // 30: pb.shopService.SearchShopPlayers:output_type -> pb.SearchShopPlayersResp
24, // 31: pb.shopService.AddShops:output_type -> pb.AddShopsResp
26, // 32: pb.shopService.UpdateShops:output_type -> pb.UpdateShopsResp
28, // 33: pb.shopService.DelShops:output_type -> pb.DelShopsResp
30, // 34: pb.shopService.GetShopsById:output_type -> pb.GetShopsByIdResp
32, // 35: pb.shopService.SearchShops:output_type -> pb.SearchShopsResp
21, // [21:36] is the sub-list for method output_type
6, // [6:21] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
0, // 0: pb.UpdateShopInvitationsResp.shopInvitations:type_name -> pb.ShopInvitations
0, // 1: pb.GetShopInvitationsByIdResp.shopInvitations:type_name -> pb.ShopInvitations
0, // 2: pb.SearchShopInvitationsResp.shopInvitations:type_name -> pb.ShopInvitations
11, // 3: pb.GetShopPlayersByIdResp.shopPlayers:type_name -> pb.ShopPlayers
11, // 4: pb.SearchShopPlayersResp.shopPlayers:type_name -> pb.ShopPlayers
22, // 5: pb.GetShopsByIdResp.shops:type_name -> pb.Shops
22, // 6: pb.SearchShopsResp.shops:type_name -> pb.Shops
1, // 7: pb.shopService.AddShopInvitations:input_type -> pb.AddShopInvitationsReq
3, // 8: pb.shopService.UpdateShopInvitations:input_type -> pb.UpdateShopInvitationsReq
5, // 9: pb.shopService.DelShopInvitations:input_type -> pb.DelShopInvitationsReq
7, // 10: pb.shopService.GetShopInvitationsById:input_type -> pb.GetShopInvitationsByIdReq
9, // 11: pb.shopService.SearchShopInvitations:input_type -> pb.SearchShopInvitationsReq
12, // 12: pb.shopService.AddShopPlayers:input_type -> pb.AddShopPlayersReq
14, // 13: pb.shopService.UpdateShopPlayers:input_type -> pb.UpdateShopPlayersReq
16, // 14: pb.shopService.DelShopPlayers:input_type -> pb.DelShopPlayersReq
18, // 15: pb.shopService.GetShopPlayersById:input_type -> pb.GetShopPlayersByIdReq
20, // 16: pb.shopService.SearchShopPlayers:input_type -> pb.SearchShopPlayersReq
23, // 17: pb.shopService.AddShops:input_type -> pb.AddShopsReq
25, // 18: pb.shopService.UpdateShops:input_type -> pb.UpdateShopsReq
27, // 19: pb.shopService.DelShops:input_type -> pb.DelShopsReq
29, // 20: pb.shopService.GetShopsById:input_type -> pb.GetShopsByIdReq
31, // 21: pb.shopService.SearchShops:input_type -> pb.SearchShopsReq
2, // 22: pb.shopService.AddShopInvitations:output_type -> pb.AddShopInvitationsResp
4, // 23: pb.shopService.UpdateShopInvitations:output_type -> pb.UpdateShopInvitationsResp
6, // 24: pb.shopService.DelShopInvitations:output_type -> pb.DelShopInvitationsResp
8, // 25: pb.shopService.GetShopInvitationsById:output_type -> pb.GetShopInvitationsByIdResp
10, // 26: pb.shopService.SearchShopInvitations:output_type -> pb.SearchShopInvitationsResp
13, // 27: pb.shopService.AddShopPlayers:output_type -> pb.AddShopPlayersResp
15, // 28: pb.shopService.UpdateShopPlayers:output_type -> pb.UpdateShopPlayersResp
17, // 29: pb.shopService.DelShopPlayers:output_type -> pb.DelShopPlayersResp
19, // 30: pb.shopService.GetShopPlayersById:output_type -> pb.GetShopPlayersByIdResp
21, // 31: pb.shopService.SearchShopPlayers:output_type -> pb.SearchShopPlayersResp
24, // 32: pb.shopService.AddShops:output_type -> pb.AddShopsResp
26, // 33: pb.shopService.UpdateShops:output_type -> pb.UpdateShopsResp
28, // 34: pb.shopService.DelShops:output_type -> pb.DelShopsResp
30, // 35: pb.shopService.GetShopsById:output_type -> pb.GetShopsByIdResp
32, // 36: pb.shopService.SearchShops:output_type -> pb.SearchShopsResp
22, // [22:37] is the sub-list for method output_type
7, // [7:22] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_shop_proto_init() }