调整表结构
This commit is contained in:
@ -2,13 +2,19 @@ package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/api/store/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
fromCtx := g.RequestFromCtx(ctx)
|
||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||
out, err := service.Store().Create(ctx, &model.StoreCreateIn{OperatorId: operatorId, OperatorRole: operatorRole, Name: req.Name})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.CreateRes{Id: out.Id}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user