完善功能
This commit is contained in:
42
internal/service/author.go
Normal file
42
internal/service/author.go
Normal file
@ -0,0 +1,42 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IAuthor interface {
|
||||
// List retrieves a paginated list of authors
|
||||
List(ctx context.Context, in *model.AuthorListIn) (out *model.AuthorListOut, err error)
|
||||
// Create adds a new author
|
||||
Create(ctx context.Context, in *model.AuthorAddIn) (out *model.AuthorCRUDOut, err error)
|
||||
// Update edits an author
|
||||
Update(ctx context.Context, in *model.AuthorEditIn) (out *model.AuthorCRUDOut, err error)
|
||||
// Delete removes an author by id
|
||||
Delete(ctx context.Context, in *model.AuthorDelIn) (out *model.AuthorCRUDOut, err error)
|
||||
// Apply 允许用户申请成为作者
|
||||
Apply(ctx context.Context, in *model.AuthorApplyIn) (out *model.AuthorApplyOut, err error)
|
||||
Detail(ctx context.Context, in *model.AuthorDetailIn) (out *model.AuthorDetailOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localAuthor IAuthor
|
||||
)
|
||||
|
||||
func Author() IAuthor {
|
||||
if localAuthor == nil {
|
||||
panic("implement not found for interface IAuthor, forgot register?")
|
||||
}
|
||||
return localAuthor
|
||||
}
|
||||
|
||||
func RegisterAuthor(i IAuthor) {
|
||||
localAuthor = i
|
||||
}
|
||||
@ -17,6 +17,17 @@ type (
|
||||
Create(ctx context.Context, in *model.BookAddIn) (out *model.BookCRUDOut, err error)
|
||||
Update(ctx context.Context, in *model.BookEditIn) (out *model.BookCRUDOut, err error)
|
||||
Delete(ctx context.Context, in *model.BookDelIn) (out *model.BookCRUDOut, err error)
|
||||
// AppList retrieves book list for app
|
||||
AppList(ctx context.Context, in *model.BookAppListIn) (out *model.BookAppListOut, err error)
|
||||
// AppRate rates a book for app
|
||||
AppRate(ctx context.Context, in *model.BookAppRateIn) (out *model.BookAppRateOut, err error)
|
||||
// AppDetail retrieves book detail for app
|
||||
AppDetail(ctx context.Context, in *model.BookAppDetailIn) (out *model.BookAppDetailOut, err error)
|
||||
MyList(ctx context.Context, in *model.MyBookListIn) (out *model.MyBookListOut, err error)
|
||||
// SetFeatured: 单独修改书籍的精选状态
|
||||
SetFeatured(ctx context.Context, in *model.BookSetFeaturedIn) (out *model.BookCRUDOut, err error)
|
||||
// SetRecommended: 单独修改书籍的推荐状态
|
||||
SetRecommended(ctx context.Context, in *model.BookSetRecommendedIn) (out *model.BookCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
35
internal/service/bookshelve.go
Normal file
35
internal/service/bookshelve.go
Normal file
@ -0,0 +1,35 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IBookshelve interface {
|
||||
// Add 添加书架
|
||||
Add(ctx context.Context, in *model.BookshelveAddIn) (out *model.BookshelveCRUDOut, err error)
|
||||
// Delete 批量删除书架
|
||||
Delete(ctx context.Context, in *model.BookshelveDelIn) (out *model.BookshelveCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localBookshelve IBookshelve
|
||||
)
|
||||
|
||||
func Bookshelve() IBookshelve {
|
||||
if localBookshelve == nil {
|
||||
panic("implement not found for interface IBookshelve, forgot register?")
|
||||
}
|
||||
return localBookshelve
|
||||
}
|
||||
|
||||
func RegisterBookshelve(i IBookshelve) {
|
||||
localBookshelve = i
|
||||
}
|
||||
@ -14,9 +14,20 @@ type (
|
||||
IChapter interface {
|
||||
// List retrieves a paginated list of chapters
|
||||
List(ctx context.Context, in *model.ChapterListIn) (out *model.ChapterListOut, err error)
|
||||
// Create creates a new chapter
|
||||
Create(ctx context.Context, in *model.ChapterAddIn) (out *model.ChapterCRUDOut, err error)
|
||||
// Update updates an existing chapter
|
||||
Update(ctx context.Context, in *model.ChapterEditIn) (out *model.ChapterCRUDOut, err error)
|
||||
// Delete deletes a chapter by ID
|
||||
Delete(ctx context.Context, in *model.ChapterDelIn) (out *model.ChapterCRUDOut, err error)
|
||||
// AppList retrieves chapter list for app without content
|
||||
AppList(ctx context.Context, in *model.ChapterAppListIn) (out *model.ChapterAppListOut, err error)
|
||||
// AppDetail retrieves chapter detail for app
|
||||
AppDetail(ctx context.Context, in *model.ChapterAppDetailIn) (out *model.ChapterAppDetailOut, err error)
|
||||
// AppPurchase purchases chapter for app
|
||||
AppPurchase(ctx context.Context, in *model.ChapterAppPurchaseIn) (out *model.ChapterAppPurchaseOut, err error)
|
||||
// AppProgress uploads reading progress for app
|
||||
AppProgress(ctx context.Context, in *model.ChapterAppProgressIn) (out *model.ChapterAppProgressOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IReadRecord interface {
|
||||
// List retrieves a paginated list of read records
|
||||
List(ctx context.Context, in *model.ReadRecordListIn) (out *model.ReadRecordListOut, err error)
|
||||
// Create adds a new read record
|
||||
Create(ctx context.Context, in *model.ReadRecordAddIn) (out *model.ReadRecordCRUDOut, err error)
|
||||
// Delete removes a read record by id
|
||||
Delete(ctx context.Context, in *model.ReadRecordDelIn) (out *model.ReadRecordCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localReadRecord IReadRecord
|
||||
)
|
||||
|
||||
func ReadRecord() IReadRecord {
|
||||
if localReadRecord == nil {
|
||||
panic("implement not found for interface IReadRecord, forgot register?")
|
||||
}
|
||||
return localReadRecord
|
||||
}
|
||||
|
||||
func RegisterReadRecord(i IReadRecord) {
|
||||
localReadRecord = i
|
||||
}
|
||||
39
internal/service/user_follow_author.go
Normal file
39
internal/service/user_follow_author.go
Normal file
@ -0,0 +1,39 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IUserFollowAuthor interface {
|
||||
// List retrieves a paginated list of user follow authors
|
||||
List(ctx context.Context, in *model.UserFollowAuthorListIn) (out *model.UserFollowAuthorListOut, err error)
|
||||
// Create adds a new user follow author
|
||||
Create(ctx context.Context, in *model.UserFollowAuthorAddIn) (out *model.UserFollowAuthorCRUDOut, err error)
|
||||
// Delete removes a user follow author by id
|
||||
Delete(ctx context.Context, in *model.UserFollowAuthorDelIn) (out *model.UserFollowAuthorCRUDOut, err error)
|
||||
// Unfollow removes a user follow author by userId and authorId
|
||||
Unfollow(ctx context.Context, userId int64, authorId int64) (out *model.UserFollowAuthorCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localUserFollowAuthor IUserFollowAuthor
|
||||
)
|
||||
|
||||
func UserFollowAuthor() IUserFollowAuthor {
|
||||
if localUserFollowAuthor == nil {
|
||||
panic("implement not found for interface IUserFollowAuthor, forgot register?")
|
||||
}
|
||||
return localUserFollowAuthor
|
||||
}
|
||||
|
||||
func RegisterUserFollowAuthor(i IUserFollowAuthor) {
|
||||
localUserFollowAuthor = i
|
||||
}
|
||||
35
internal/service/user_read_history.go
Normal file
35
internal/service/user_read_history.go
Normal file
@ -0,0 +1,35 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IUserReadHistory interface {
|
||||
// Add 添加历史记录
|
||||
Add(ctx context.Context, in *model.UserReadHistoryAddIn) (out *model.UserReadHistoryCRUDOut, err error)
|
||||
// Delete 批量删除历史记录
|
||||
Delete(ctx context.Context, in *model.UserReadHistoryDelIn) (out *model.UserReadHistoryCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localUserReadHistory IUserReadHistory
|
||||
)
|
||||
|
||||
func UserReadHistory() IUserReadHistory {
|
||||
if localUserReadHistory == nil {
|
||||
panic("implement not found for interface IUserReadHistory, forgot register?")
|
||||
}
|
||||
return localUserReadHistory
|
||||
}
|
||||
|
||||
func RegisterUserReadHistory(i IUserReadHistory) {
|
||||
localUserReadHistory = i
|
||||
}
|
||||
37
internal/service/user_read_record.go
Normal file
37
internal/service/user_read_record.go
Normal file
@ -0,0 +1,37 @@
|
||||
// ================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// You can delete these comments if you wish manually maintain this interface file.
|
||||
// ================================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type (
|
||||
IUserReadRecord interface {
|
||||
// List retrieves a paginated list of user read records
|
||||
List(ctx context.Context, in *model.UserReadRecordListIn) (out *model.UserReadRecordListOut, err error)
|
||||
// Create adds a new user read record
|
||||
Create(ctx context.Context, in *model.UserReadRecordAddIn) (out *model.UserReadRecordCRUDOut, err error)
|
||||
// Delete removes user read records by userId and bookIds
|
||||
Delete(ctx context.Context, in *model.UserReadRecordDelIn) (out *model.UserReadRecordCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localUserReadRecord IUserReadRecord
|
||||
)
|
||||
|
||||
func UserReadRecord() IUserReadRecord {
|
||||
if localUserReadRecord == nil {
|
||||
panic("implement not found for interface IUserReadRecord, forgot register?")
|
||||
}
|
||||
return localUserReadRecord
|
||||
}
|
||||
|
||||
func RegisterUserReadRecord(i IUserReadRecord) {
|
||||
localUserReadRecord = i
|
||||
}
|
||||
Reference in New Issue
Block a user