完善功能
This commit is contained in:
21
internal/controller/author/author_v1_del.go
Normal file
21
internal/controller/author/author_v1_del.go
Normal file
@ -0,0 +1,21 @@
|
||||
package author
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "server/api/author/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error) {
|
||||
out, err := service.Author().Delete(ctx, &model.AuthorDelIn{
|
||||
Id: req.Id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &v1.DelRes{
|
||||
Success: out.Success,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user