书籍列表接口新增参数
This commit is contained in:
24
internal/controller/task/task_v1_edit.go
Normal file
24
internal/controller/task/task_v1_edit.go
Normal file
@ -0,0 +1,24 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "server/api/task/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error) {
|
||||
out, err := service.Task().Edit(ctx, &model.TaskEditIn{
|
||||
Id: req.Id,
|
||||
TaskType: req.TaskType,
|
||||
Title: req.Title,
|
||||
Description: req.Description,
|
||||
RewardPoints: req.RewardPoints,
|
||||
Status: req.Status,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.EditRes{Success: out.Success}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user