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
+56 -45
View File
@@ -556,16 +556,16 @@ func (x *GetGamesByIdResp) GetGames() *Games {
type SearchGamesReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //page
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` //limit
Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` //id
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` //name
Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` //icon
Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"` //category
SortOrder int64 `protobuf:"varint,7,opt,name=sortOrder,proto3" json:"sortOrder,omitempty"` //sortOrder
IsActive bool `protobuf:"varint,8,opt,name=isActive,proto3" json:"isActive,omitempty"` //isActive
CreatedAt int64 `protobuf:"varint,9,opt,name=createdAt,proto3" json:"createdAt,omitempty"` //createdAt
UpdatedAt int64 `protobuf:"varint,10,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` //updatedAt
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //page
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` //limit
Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` //id
Name *string `protobuf:"bytes,4,opt,name=name,proto3,oneof" json:"name,omitempty"` //name
Icon *string `protobuf:"bytes,5,opt,name=icon,proto3,oneof" json:"icon,omitempty"` //icon
Category *string `protobuf:"bytes,6,opt,name=category,proto3,oneof" json:"category,omitempty"` //category
SortOrder *int64 `protobuf:"varint,7,opt,name=sortOrder,proto3,oneof" json:"sortOrder,omitempty"` //sortOrder
IsActive *bool `protobuf:"varint,8,opt,name=isActive,proto3,oneof" json:"isActive,omitempty"` //isActive
CreatedAt *int64 `protobuf:"varint,9,opt,name=createdAt,proto3,oneof" json:"createdAt,omitempty"` //createdAt
UpdatedAt *int64 `protobuf:"varint,10,opt,name=updatedAt,proto3,oneof" json:"updatedAt,omitempty"` //updatedAt
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -622,50 +622,50 @@ func (x *SearchGamesReq) GetId() int64 {
}
func (x *SearchGamesReq) GetName() string {
if x != nil {
return x.Name
if x != nil && x.Name != nil {
return *x.Name
}
return ""
}
func (x *SearchGamesReq) GetIcon() string {
if x != nil {
return x.Icon
if x != nil && x.Icon != nil {
return *x.Icon
}
return ""
}
func (x *SearchGamesReq) GetCategory() string {
if x != nil {
return x.Category
if x != nil && x.Category != nil {
return *x.Category
}
return ""
}
func (x *SearchGamesReq) GetSortOrder() int64 {
if x != nil {
return x.SortOrder
if x != nil && x.SortOrder != nil {
return *x.SortOrder
}
return 0
}
func (x *SearchGamesReq) GetIsActive() bool {
if x != nil {
return x.IsActive
if x != nil && x.IsActive != nil {
return *x.IsActive
}
return false
}
func (x *SearchGamesReq) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
if x != nil && x.CreatedAt != nil {
return *x.CreatedAt
}
return 0
}
func (x *SearchGamesReq) GetUpdatedAt() int64 {
if x != nil {
return x.UpdatedAt
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
@@ -754,22 +754,32 @@ const file_game_proto_rawDesc = "" +
"\x0fGetGamesByIdReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\"3\n" +
"\x10GetGamesByIdResp\x12\x1f\n" +
"\x05games\x18\x01 \x01(\v2\t.pb.GamesR\x05games\"\x84\x02\n" +
"\x05games\x18\x01 \x01(\v2\t.pb.GamesR\x05games\"\xfd\x02\n" +
"\x0eSearchGamesReq\x12\x12\n" +
"\x04page\x18\x01 \x01(\x03R\x04page\x12\x14\n" +
"\x05limit\x18\x02 \x01(\x03R\x05limit\x12\x0e\n" +
"\x02id\x18\x03 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x04 \x01(\tR\x04name\x12\x12\n" +
"\x04icon\x18\x05 \x01(\tR\x04icon\x12\x1a\n" +
"\bcategory\x18\x06 \x01(\tR\bcategory\x12\x1c\n" +
"\tsortOrder\x18\a \x01(\x03R\tsortOrder\x12\x1a\n" +
"\bisActive\x18\b \x01(\bR\bisActive\x12\x1c\n" +
"\tcreatedAt\x18\t \x01(\x03R\tcreatedAt\x12\x1c\n" +
"\x02id\x18\x03 \x01(\x03R\x02id\x12\x17\n" +
"\x04name\x18\x04 \x01(\tH\x00R\x04name\x88\x01\x01\x12\x17\n" +
"\x04icon\x18\x05 \x01(\tH\x01R\x04icon\x88\x01\x01\x12\x1f\n" +
"\bcategory\x18\x06 \x01(\tH\x02R\bcategory\x88\x01\x01\x12!\n" +
"\tsortOrder\x18\a \x01(\x03H\x03R\tsortOrder\x88\x01\x01\x12\x1f\n" +
"\bisActive\x18\b \x01(\bH\x04R\bisActive\x88\x01\x01\x12!\n" +
"\tcreatedAt\x18\t \x01(\x03H\x05R\tcreatedAt\x88\x01\x01\x12!\n" +
"\tupdatedAt\x18\n" +
" \x01(\x03R\tupdatedAt\"2\n" +
" \x01(\x03H\x06R\tupdatedAt\x88\x01\x01B\a\n" +
"\x05_nameB\a\n" +
"\x05_iconB\v\n" +
"\t_categoryB\f\n" +
"\n" +
"_sortOrderB\v\n" +
"\t_isActiveB\f\n" +
"\n" +
"_createdAtB\f\n" +
"\n" +
"_updatedAt\"2\n" +
"\x0fSearchGamesResp\x12\x1f\n" +
"\x05games\x18\x01 \x03(\v2\t.pb.GamesR\x05games2\x91\x02\n" +
"\x06public\x12-\n" +
"\x05games\x18\x01 \x03(\v2\t.pb.GamesR\x05games2\x96\x02\n" +
"\vGameService\x12-\n" +
"\bAddGames\x12\x0f.pb.AddGamesReq\x1a\x10.pb.AddGamesResp\x126\n" +
"\vUpdateGames\x12\x12.pb.UpdateGamesReq\x1a\x13.pb.UpdateGamesResp\x12-\n" +
"\bDelGames\x12\x0f.pb.DelGamesReq\x1a\x10.pb.DelGamesResp\x129\n" +
@@ -805,16 +815,16 @@ var file_game_proto_goTypes = []any{
var file_game_proto_depIdxs = []int32{
0, // 0: pb.GetGamesByIdResp.games:type_name -> pb.Games
0, // 1: pb.SearchGamesResp.games:type_name -> pb.Games
1, // 2: pb.public.AddGames:input_type -> pb.AddGamesReq
3, // 3: pb.public.UpdateGames:input_type -> pb.UpdateGamesReq
5, // 4: pb.public.DelGames:input_type -> pb.DelGamesReq
7, // 5: pb.public.GetGamesById:input_type -> pb.GetGamesByIdReq
9, // 6: pb.public.SearchGames:input_type -> pb.SearchGamesReq
2, // 7: pb.public.AddGames:output_type -> pb.AddGamesResp
4, // 8: pb.public.UpdateGames:output_type -> pb.UpdateGamesResp
6, // 9: pb.public.DelGames:output_type -> pb.DelGamesResp
8, // 10: pb.public.GetGamesById:output_type -> pb.GetGamesByIdResp
10, // 11: pb.public.SearchGames:output_type -> pb.SearchGamesResp
1, // 2: pb.GameService.AddGames:input_type -> pb.AddGamesReq
3, // 3: pb.GameService.UpdateGames:input_type -> pb.UpdateGamesReq
5, // 4: pb.GameService.DelGames:input_type -> pb.DelGamesReq
7, // 5: pb.GameService.GetGamesById:input_type -> pb.GetGamesByIdReq
9, // 6: pb.GameService.SearchGames:input_type -> pb.SearchGamesReq
2, // 7: pb.GameService.AddGames:output_type -> pb.AddGamesResp
4, // 8: pb.GameService.UpdateGames:output_type -> pb.UpdateGamesResp
6, // 9: pb.GameService.DelGames:output_type -> pb.DelGamesResp
8, // 10: pb.GameService.GetGamesById:output_type -> pb.GetGamesByIdResp
10, // 11: pb.GameService.SearchGames:output_type -> pb.SearchGamesResp
7, // [7:12] is the sub-list for method output_type
2, // [2:7] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
@@ -827,6 +837,7 @@ func file_game_proto_init() {
if File_game_proto != nil {
return
}
file_game_proto_msgTypes[9].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{