初始化项目框架,完成部分接口开发
This commit is contained in:
36
internal/service/book.go
Normal file
36
internal/service/book.go
Normal file
@ -0,0 +1,36 @@
|
||||
// ================================================================================
|
||||
// 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 (
|
||||
IBook interface {
|
||||
// List retrieves a paginated list of books
|
||||
List(ctx context.Context, in *model.BookListIn) (out *model.BookListOut, err error)
|
||||
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)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localBook IBook
|
||||
)
|
||||
|
||||
func Book() IBook {
|
||||
if localBook == nil {
|
||||
panic("implement not found for interface IBook, forgot register?")
|
||||
}
|
||||
return localBook
|
||||
}
|
||||
|
||||
func RegisterBook(i IBook) {
|
||||
localBook = i
|
||||
}
|
||||
Reference in New Issue
Block a user