实现了门店员工、员工角色的接口开发
This commit is contained in:
17
internal/controller/storeRole/storeRole_v1_create.go
Normal file
17
internal/controller/storeRole/storeRole_v1_create.go
Normal file
@ -0,0 +1,17 @@
|
||||
package storeRole
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/storeRole/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
|
||||
out, err := service.StoreRole().Create(ctx, &model.StoreRoleCreateIn{Name: req.Name, StoreId: req.StoreId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.CreateRes{Id: out.Id}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user