12345678910111213141516171819202122232425262728293031323334 |
- package room
- import (
- "context"
- "microGame/app/usercenter/cmd/api/internal/svc"
- "microGame/app/usercenter/cmd/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type CreateRoomLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- // NewCreateRoomLogic create room
- func NewCreateRoomLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateRoomLogic {
- return &CreateRoomLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *CreateRoomLogic) CreateRoom(req *types.RoomInfoReq) (resp *types.RoomInfoResp, err error) {
- // 创建room
- max := 6
- if max <= 0 || max > 9 {
- max = 9 // default 9 Occupants
- }
- return
- }
|