init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
@@ -0,0 +1,34 @@
package userwatchrecordserver
import (
"91jd-server/app/service/vidhelpser"
"91jd-server/common/stderr"
"91jd-server/models/v/userwatchrecordmod"
"91jd-server/models/v/vidmod"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func List(uid uint64, req *userwatchrecordmod.ListRequest) (interface{}, stderr.Code) {
list, err := userwatchrecordmod.List(req.Filter(uid), req.Options())
if err != nil {
return nil, stderr.ErrDbQueryError
}
listLen := len(list)
var out userwatchrecordmod.ListResponse
if listLen > int(req.PageSize) {
out.HasNext = true
list = list[:len(list)-1]
listLen--
}
if listLen == 0 {
out.WorkList = []*vidmod.VideoInfoResp{}
return out, stderr.Success
}
videoIds := make([]primitive.ObjectID, listLen)
for i, record := range list {
videoIds[i] = record.VideoID
}
out.WorkList = vidhelpser.GetVideoListByIDsNoStatus(uid, videoIds)
return out, stderr.Success
}