20 lines
419 B
Go
20 lines
419 B
Go
package storeRole
|
|
|
|
import (
|
|
"context"
|
|
"server/internal/model"
|
|
"server/internal/service"
|
|
|
|
"server/api/storeRole/v1"
|
|
)
|
|
|
|
func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
|
|
out, err := service.StoreRole().Update(ctx, &model.StoreRoleUpdateIn{Id: req.Id, Name: req.Name})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.UpdateRes{
|
|
Success: out.Success,
|
|
}, nil
|
|
}
|