初始化项目框架,完成部分接口开发
This commit is contained in:
34
internal/service/admin.go
Normal file
34
internal/service/admin.go
Normal file
@ -0,0 +1,34 @@
|
||||
// ================================================================================
|
||||
// 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 (
|
||||
IAdmin interface {
|
||||
Login(ctx context.Context, in *model.AdminLoginIn) (out *model.AdminLoginOut, err error)
|
||||
Info(ctx context.Context, in *model.AdminInfoIn) (out *model.AdminInfoOut, err error)
|
||||
EditPass(ctx context.Context, in *model.AdminEditPassIn) (out *model.AdminEditPassOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localAdmin IAdmin
|
||||
)
|
||||
|
||||
func Admin() IAdmin {
|
||||
if localAdmin == nil {
|
||||
panic("implement not found for interface IAdmin, forgot register?")
|
||||
}
|
||||
return localAdmin
|
||||
}
|
||||
|
||||
func RegisterAdmin(i IAdmin) {
|
||||
localAdmin = i
|
||||
}
|
||||
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
|
||||
}
|
||||
36
internal/service/category.go
Normal file
36
internal/service/category.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 (
|
||||
ICategory interface {
|
||||
// List retrieves a paginated list of categories
|
||||
List(ctx context.Context, in *model.CategoryListIn) (out *model.CategoryListOut, err error)
|
||||
Create(ctx context.Context, in *model.CategoryAddIn) (out *model.CategoryCRUDOut, err error)
|
||||
Update(ctx context.Context, in *model.CategoryEditIn) (out *model.CategoryCRUDOut, err error)
|
||||
Delete(ctx context.Context, in *model.CategoryDelIn) (out *model.CategoryCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localCategory ICategory
|
||||
)
|
||||
|
||||
func Category() ICategory {
|
||||
if localCategory == nil {
|
||||
panic("implement not found for interface ICategory, forgot register?")
|
||||
}
|
||||
return localCategory
|
||||
}
|
||||
|
||||
func RegisterCategory(i ICategory) {
|
||||
localCategory = i
|
||||
}
|
||||
36
internal/service/chapter.go
Normal file
36
internal/service/chapter.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 (
|
||||
IChapter interface {
|
||||
// List retrieves a paginated list of chapters
|
||||
List(ctx context.Context, in *model.ChapterListIn) (out *model.ChapterListOut, err error)
|
||||
Create(ctx context.Context, in *model.ChapterAddIn) (out *model.ChapterCRUDOut, err error)
|
||||
Update(ctx context.Context, in *model.ChapterEditIn) (out *model.ChapterCRUDOut, err error)
|
||||
Delete(ctx context.Context, in *model.ChapterDelIn) (out *model.ChapterCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localChapter IChapter
|
||||
)
|
||||
|
||||
func Chapter() IChapter {
|
||||
if localChapter == nil {
|
||||
panic("implement not found for interface IChapter, forgot register?")
|
||||
}
|
||||
return localChapter
|
||||
}
|
||||
|
||||
func RegisterChapter(i IChapter) {
|
||||
localChapter = i
|
||||
}
|
||||
35
internal/service/feedback.go
Normal file
35
internal/service/feedback.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 (
|
||||
IFeedback interface {
|
||||
// List retrieves a paginated list of feedbacks
|
||||
List(ctx context.Context, in *model.FeedbackListIn) (out *model.FeedbackListOut, err error)
|
||||
// Create adds a new feedback
|
||||
Create(ctx context.Context, in *model.FeedbackAddIn) (out *model.FeedbackCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localFeedback IFeedback
|
||||
)
|
||||
|
||||
func Feedback() IFeedback {
|
||||
if localFeedback == nil {
|
||||
panic("implement not found for interface IFeedback, forgot register?")
|
||||
}
|
||||
return localFeedback
|
||||
}
|
||||
|
||||
func RegisterFeedback(i IFeedback) {
|
||||
localFeedback = i
|
||||
}
|
||||
37
internal/service/read_record.go
Normal file
37
internal/service/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 (
|
||||
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
|
||||
}
|
||||
36
internal/service/tag.go
Normal file
36
internal/service/tag.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 (
|
||||
ITag interface {
|
||||
// List retrieves a paginated list of tags
|
||||
List(ctx context.Context, in *model.TagListIn) (out *model.TagListOut, err error)
|
||||
Create(ctx context.Context, in *model.TagAddIn) (out *model.TagCRUDOut, err error)
|
||||
Update(ctx context.Context, in *model.TagEditIn) (out *model.TagCRUDOut, err error)
|
||||
Delete(ctx context.Context, in *model.TagDelIn) (out *model.TagCRUDOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localTag ITag
|
||||
)
|
||||
|
||||
func Tag() ITag {
|
||||
if localTag == nil {
|
||||
panic("implement not found for interface ITag, forgot register?")
|
||||
}
|
||||
return localTag
|
||||
}
|
||||
|
||||
func RegisterTag(i ITag) {
|
||||
localTag = i
|
||||
}
|
||||
37
internal/service/user.go
Normal file
37
internal/service/user.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 (
|
||||
IUser interface {
|
||||
Login(ctx context.Context, in *model.UserLoginIn) (out *model.UserLoginOut, err error)
|
||||
Register(ctx context.Context, in *model.UserRegisterIn) (out *model.UserRegisterOut, err error)
|
||||
Info(ctx context.Context, in *model.UserInfoIn) (out *model.UserInfoOut, err error)
|
||||
Delete(ctx context.Context, in *model.UserDeleteIn) (out *model.UserDeleteOut, err error)
|
||||
Code(ctx context.Context, in *model.UserCodeIn) (out *model.UserCodeOut, err error)
|
||||
EditPass(ctx context.Context, in *model.UserEditPassIn) (out *model.UserEditPassOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localUser IUser
|
||||
)
|
||||
|
||||
func User() IUser {
|
||||
if localUser == nil {
|
||||
panic("implement not found for interface IUser, forgot register?")
|
||||
}
|
||||
return localUser
|
||||
}
|
||||
|
||||
func RegisterUser(i IUser) {
|
||||
localUser = i
|
||||
}
|
||||
Reference in New Issue
Block a user