完善功能
This commit is contained in:
27
internal/controller/chapter/chapter_v1_app_progress.go
Normal file
27
internal/controller/chapter/chapter_v1_app_progress.go
Normal file
@ -0,0 +1,27 @@
|
||||
package chapter
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "server/api/chapter/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) AppProgress(ctx context.Context, req *v1.AppProgressReq) (res *v1.AppProgressRes, err error) {
|
||||
userId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
out, err := service.Chapter().AppProgress(ctx, &model.ChapterAppProgressIn{
|
||||
BookId: req.BookId,
|
||||
ChapterId: req.ChapterId,
|
||||
Progress: req.Progress,
|
||||
UserId: userId,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &v1.AppProgressRes{
|
||||
Success: out.Success,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user