controller

package
v0.0.0-...-e371da1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthController

func NewAuthController(cc infra.Resolver, conf *config.Config) web.Controller

func NewCreditController

func NewCreditController(cc infra.Resolver, conf *config.Config) web.Controller

func NewInspectController

func NewInspectController(cc infra.Resolver, conf *config.Config) web.Controller

func NewShareController

func NewShareController(cc infra.Resolver, conf *config.Config) web.Controller

func NewUploadController

func NewUploadController(cc infra.Resolver, conf *config.Config) web.Controller

func NewUserController

func NewUserController(cc infra.Resolver, conf *config.Config) web.Controller

Types

type AuthController

type AuthController struct {
	// contains filtered or unexported fields
}

func (AuthController) CurrentUser

func (ctl AuthController) CurrentUser(ctx web.Context, req web.Request) *User

CurrentUser return current user info

func (AuthController) Login

func (ctl AuthController) Login(ctx web.Context, req web.Request, userSrv service.UserService, authProvider auth.Auth) (*User, error)

Login let user login to the system

func (AuthController) Logout

func (ctl AuthController) Logout(req web.Request) error

func (AuthController) Register

func (ctl AuthController) Register(router web.Router)

type CreditController

type CreditController struct {
	// contains filtered or unexported fields
}

func (CreditController) Ranks

func (CreditController) Register

func (wel CreditController) Register(router web.Router)

type IDRes

type IDRes struct {
	ID int64 `json:"id"`
}

type InspectController

type InspectController struct {
	// contains filtered or unexported fields
}

func (InspectController) PasswordGenerator

func (wel InspectController) PasswordGenerator(ctx web.Context) web.Response

func (InspectController) Register

func (wel InspectController) Register(router web.Router)

func (InspectController) Version

func (wel InspectController) Version(ctx web.Context) web.Response

type PaginateRes

type PaginateRes struct {
	Page   query.PaginateMeta     `json:"page"`
	Data   interface{}            `json:"data"`
	Search map[string]interface{} `json:"search,omitempty"`
	Extra  interface{}            `json:"extra,omitempty"`
}

PaginateRes is a struct for paginate response

type PlanUpdateFields

type PlanUpdateFields struct {
	ShareDate    string `json:"share_date,omitempty"`
	ShareTime    string `json:"share_time,omitempty"`
	ShareRoom    string `json:"share_room"`
	PlanDuration int64  `json:"plan_duration"`
	Note         string `json:"note"`
}

type ShareController

type ShareController struct {
	// contains filtered or unexported fields
}

func (ShareController) CancelSharePlan

func (ctl ShareController) CancelSharePlan(ctx web.Context, req web.Request, shareSrv service.ShareService) error

CancelSharePlan cancel a share plan

func (ShareController) CreateOrUpdateSharePlan

func (ctl ShareController) CreateOrUpdateSharePlan(ctx web.Context, req web.Request, shareSrv service.ShareService) error

CreateOrUpdateSharePlan create or update a share plan

func (ShareController) CreateShare

func (ctl ShareController) CreateShare(ctx web.Context, req web.Request, shareSrv service.ShareService, pub event.Publisher) error

CreateShare create a share

func (ShareController) DeleteShare

func (ctl ShareController) DeleteShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

DeleteShare remove a share

func (ShareController) DislikeShare

func (ctl ShareController) DislikeShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

DislikeShare cancel a vote to share

func (ShareController) FinishShare

func (ctl ShareController) FinishShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

FinishShare set a share as finished

func (ShareController) JoinShare

func (ctl ShareController) JoinShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

JoinShare join a share as an audience

func (ShareController) LeaveShare

func (ctl ShareController) LeaveShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

LeaveShare leave a share

func (ShareController) LikeShare

func (ctl ShareController) LikeShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

LikeShare give a vote to a share

func (ShareController) MyShares

func (ctl ShareController) MyShares(ctx web.Context, req web.Request, shareSrv service.ShareService) (*PaginateRes, error)

MyShares return all shares for current user

  • status: 0 所有 1/2/3 基于状态筛选
  • type: 分享类型

func (ShareController) RecentlyShares

func (ctl ShareController) RecentlyShares(ctx web.Context, req web.Request, shareSrv service.ShareService) (*PaginateRes, error)

RecentlyShares return all shares recently

  • status: 0 所有 1/2/3 基于状态筛选
  • type: 分享类型

func (ShareController) Register

func (ctl ShareController) Register(router web.Router)

func (ShareController) Share

func (ctl ShareController) Share(ctx web.Context, req web.Request, shareSrv service.ShareService) (*ShareDetail, error)

Share get a share detail

func (ShareController) Shares

func (ctl ShareController) Shares(ctx web.Context, req web.Request, shareSrv service.ShareService) (*PaginateRes, error)

Shares return all shares

  • status: 0 所有 1/2/3 基于状态筛选
  • creator: 基于创建人筛选 0 - 所有人
  • type: 分享类型

func (ShareController) UpdateShare

func (ctl ShareController) UpdateShare(ctx web.Context, req web.Request, shareSrv service.ShareService) error

UpdateShare update an existed share

type ShareDetail

type ShareDetail struct {
	service.ShareDetail
	UserLike bool `json:"user_like"`
	UserJoin bool `json:"user_join"`
}

type SharesExtra

type SharesExtra struct {
	UserLikeOrJoin map[int64]service.UserLikeOrJoinShare `json:"user_like_or_join"`
}

type UploadController

type UploadController struct {
	// contains filtered or unexported fields
}

func (UploadController) Register

func (ctl UploadController) Register(router web.Router)

func (UploadController) Upload

func (ctl UploadController) Upload(ctx web.Context, req web.Request, attaSrv service.AttachmentService) (*IDRes, error)

Upload upload a file

type User

type User struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	UUID string `json:"uuid"`
}

type UserController

type UserController struct {
	// contains filtered or unexported fields
}

func (UserController) CurrentUser

func (ctl UserController) CurrentUser(req web.Request) (*User, error)

func (UserController) Register

func (ctl UserController) Register(router web.Router)

func (UserController) Users

func (ctl UserController) Users(userSrv service.UserService) ([]service.UserBasic, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL