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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user