init push
This commit is contained in:
35
backend/api/share/v1/auth.go
Normal file
35
backend/api/share/v1/auth.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package v1
|
||||
|
||||
import "github.com/chaitin/panda-wiki/consts"
|
||||
|
||||
type AuthLoginSimpleReq struct {
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type AuthLoginSimpleResp struct {
|
||||
}
|
||||
|
||||
type AuthGetReq struct {
|
||||
}
|
||||
type AuthGetResp struct {
|
||||
AuthType consts.AuthType `json:"auth_type"`
|
||||
SourceType consts.SourceType `json:"source_type"`
|
||||
LicenseEdition consts.LicenseEdition `json:"license_edition"`
|
||||
}
|
||||
|
||||
type AuthGitHubReq struct {
|
||||
KbID string `json:"kb_id"`
|
||||
RedirectUrl string `json:"redirect_url"`
|
||||
}
|
||||
|
||||
type AuthGitHubResp struct {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
type GitHubCallbackReq struct {
|
||||
Code string `json:"code" query:"code"`
|
||||
State string `json:"state" query:"state"`
|
||||
}
|
||||
|
||||
type GitHubCallbackResp struct {
|
||||
}
|
||||
21
backend/api/share/v1/common.go
Normal file
21
backend/api/share/v1/common.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package v1
|
||||
|
||||
type ShareFileUploadReq struct {
|
||||
KbId string `json:"-"`
|
||||
File string `form:"file"`
|
||||
CaptchaToken string `form:"captcha_token" json:"captcha_token" validate:"required"`
|
||||
}
|
||||
|
||||
type FileUploadResp struct {
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
type ShareFileUploadUrlReq struct {
|
||||
KbId string `json:"-"`
|
||||
Url string `json:"url" validate:"required,url"`
|
||||
CaptchaToken string `json:"captcha_token" validate:"required"`
|
||||
}
|
||||
|
||||
type ShareFileUploadUrlResp struct {
|
||||
Key string `json:"key"`
|
||||
}
|
||||
5
backend/api/share/v1/nav.go
Normal file
5
backend/api/share/v1/nav.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package v1
|
||||
|
||||
type ShareNavListReq struct {
|
||||
KbId string `json:"kb_id" query:"kb_id" validate:"required"`
|
||||
}
|
||||
37
backend/api/share/v1/node.go
Normal file
37
backend/api/share/v1/node.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/chaitin/panda-wiki/domain"
|
||||
)
|
||||
|
||||
type ShareNodeDetailResp struct {
|
||||
ID string `json:"id"`
|
||||
KbID string `json:"kb_id"`
|
||||
Type domain.NodeType `json:"type"`
|
||||
Status domain.NodeStatus `json:"status"`
|
||||
Name string `json:"name"`
|
||||
Content string `json:"content"`
|
||||
Meta domain.NodeMeta `json:"meta"`
|
||||
ParentID string `json:"parent_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Permissions domain.NodePermissions `json:"permissions"`
|
||||
CreatorId string `json:"creator_id"`
|
||||
EditorId string `json:"editor_id"`
|
||||
PublisherId string `json:"publisher_id"`
|
||||
CreatorAccount string `json:"creator_account"`
|
||||
EditorAccount string `json:"editor_account"`
|
||||
PublisherAccount string `json:"publisher_account"`
|
||||
List []*domain.ShareNodeDetailItem `json:"list" gorm:"-"`
|
||||
PV int64 `json:"pv" gorm:"-"`
|
||||
}
|
||||
|
||||
type NodeListGroupNavResp struct {
|
||||
NavName string `json:"nav_name"`
|
||||
NavID string `json:"nav_id"`
|
||||
Position float64 `json:"position"`
|
||||
Count int64 `json:"count"`
|
||||
List []domain.ShareNodeListItemResp `json:"list"`
|
||||
}
|
||||
8
backend/api/share/v1/wechat.go
Normal file
8
backend/api/share/v1/wechat.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package v1
|
||||
|
||||
type WechatAppInfoResp struct {
|
||||
WeChatAppIsEnabled bool `json:"wechat_app_is_enabled"`
|
||||
FeedbackEnable bool `json:"feedback_enable"`
|
||||
FeedbackType []string `json:"feedback_type"`
|
||||
DisclaimerContent string `json:"disclaimer_content"`
|
||||
}
|
||||
Reference in New Issue
Block a user