controllers

package
v0.0.0-...-ec88339 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindArticleController

func BindArticleController(app *iris.Application)

func BindCommentController

func BindCommentController(app *iris.Application)

BindCommentController 绑定评论API控制器

func BindFileController

func BindFileController(app *iris.Application)

BindFileController 绑定文件控制器

func BindMessageController

func BindMessageController(app *iris.Application)

BindMessageController 绑定消息路由

func BindQuestionnaireController

func BindQuestionnaireController(app *iris.Application)

BindQuestionnaireController 绑定问卷控制器

func BindTaskController

func BindTaskController(app *iris.Application)

BindTaskController 绑定任务控制器

func BindUserController

func BindUserController(app *iris.Application)

BindUserController 绑定用户控制器

func BindUtilsController

func BindUtilsController(app *iris.Application)

BindTaskController 绑定任务控制器

func InitSession

func InitSession(config utils.SessionConfig, dbConfig utils.RedisConfig)

InitSession 初始化 Session

func NewApp

func NewApp() *iris.Application

NewApp 创建服务器实例并绑定控制器

Types

type AddQuestionnaireReq

type AddQuestionnaireReq struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Anonymous   bool   `json:"anonymous"`
}

AddQuestionnaireReq 添加问卷请求

type AddTaskReq

type AddTaskReq struct {
	Title        string   `json:"title"`
	Content      string   `json:"content"`
	Images       []string `json:"images"`
	Attachment   []string `json:"attachment"`
	Type         string   `json:"type"`
	Status       string   `json:"status"`
	Reward       string   `json:"reward"`
	RewardValue  float32  `json:"reward_value"`
	RewardObject string   `json:"reward_object"`
	Location     []string `json:"location"`
	Tags         []string `json:"tags"`
	StartDate    int64    `json:"start_date"`
	EndDate      int64    `json:"end_date"`
	MaxPlayer    int64    `json:"max_player"`
	AutoAccept   bool     `json:"auto_accept"`
	Publish      bool     `json:"publish"`
}

AddTaskReq 添加任务请求

type ArticleController

type ArticleController struct {
	BaseController
	Service services.ArticleService
}

func (*ArticleController) Get

func (c *ArticleController) Get() int

Get 获取公告文章列表

func (*ArticleController) GetBy

func (c *ArticleController) GetBy(id string) int

GetBy 根据ID获取公告文章详情

func (*ArticleController) Post

func (c *ArticleController) Post() int

Post 添加公告文章

func (*ArticleController) SetBy

func (c *ArticleController) SetBy(id string) int

SetBy 根据ID修改公告文章详情

type ArticleReq

type ArticleReq struct {
	Title     string   `json:"title"`
	Content   string   `json:"content"`
	Publisher string   `json:"publisher"`
	Images    []string `json:"images"`
}

ArticleReq 添加或修改公告文章请求

type ArticlesListRes

type ArticlesListRes struct {
	Pagination PaginationRes
	Data       []services.ArticleBrief
}

GetArticlesRes 公告文章列表数据

type BaseController

type BaseController struct {
	Ctx     iris.Context
	Session *sessions.Session
}

BaseController 控制基类

func (*BaseController) JSON

func (b *BaseController) JSON(data interface{})

JSON 使用 JSON 返回数据

type CertificationController

type CertificationController struct {
	BaseController
	Service services.UserService
}

CertificationController 认证API

func (*CertificationController) DeleteAutoBy

func (c *CertificationController) DeleteAutoBy(key string) int

DeleteAutoBy 删除自动认证前缀

func (*CertificationController) GetAuth

func (c *CertificationController) GetAuth() string

GetAuth 验证认证链接

func (*CertificationController) GetAuto

func (c *CertificationController) GetAuto() int

GetAuto 获取自动认证前缀

func (*CertificationController) GetCertification

func (c *CertificationController) GetCertification() int

GetCertification 获取待审核认证列表

func (*CertificationController) Post

func (c *CertificationController) Post() int

Post 提交用户认证

func (*CertificationController) PostAuto

func (c *CertificationController) PostAuto() int

PostAuto 添加自动认证前缀

func (*CertificationController) PostEmail

func (c *CertificationController) PostEmail() int

PostEmail 再次发送认证邮件

func (*CertificationController) PutUserBy

func (c *CertificationController) PutUserBy(userID string) int

PutUserBy 更新认证

type CommentController

type CommentController struct {
	BaseController
	Service services.CommentService
}

CommentController 评论相关API

func (*CommentController) DeleteBy

func (c *CommentController) DeleteBy(id string) int

DeleteBy 删除评论

func (*CommentController) DeleteByLike

func (c *CommentController) DeleteByLike(id string) int

DeleteByLike 取消点赞

func (*CommentController) GetBy

func (c *CommentController) GetBy(id string) int

GetBy 获取相关内容的评论

func (*CommentController) PostBy

func (c *CommentController) PostBy(id string) int

PostBy 添加评论

func (*CommentController) PostByLike

func (c *CommentController) PostByLike(id string) int

PostByLike 评论点赞

type DeleteUselessReq

type DeleteUselessReq struct {
	RemoveCount int64
}

DeleteUselessReq 移除无用文件请求

type FileController

type FileController struct {
	BaseController
	Service services.FileService
}

FileController 文件相关API

func (*FileController) DeleteBy

func (c *FileController) DeleteBy(id string) int

DeleteBy 移除文件

func (*FileController) DeleteUseless

func (c *FileController) DeleteUseless() int

DeleteUseless 删除用户未使用文件

func (*FileController) DeleteUselessAll

func (c *FileController) DeleteUselessAll() int

DeleteUselessAll 删除所有未使用文件

func (*FileController) Post

func (c *FileController) Post() int

Post 新建文件

func (*FileController) PutBy

func (c *FileController) PutBy(id string) int

PutBy 更新附件信息

type FollowListRes

type FollowListRes struct {
	Pagination PaginationRes
	Data       []models.UserBaseInfo
}

FollowListRes 关注/粉丝列表数据

type GetMessageRes

type GetMessageRes struct {
	Pagination PaginationRes
	Data       services.SessionDetail
}

GetMessageRes 获取会话消息数据

type GetMessagesRes

type GetMessagesRes struct {
	Pagination PaginationRes
	Data       []services.SessionListDetail
}

GetMessagesRes 获取会话列表数据

type GetSessionRes

type GetSessionRes struct {
	URL string `json:"url"`
}

GetSessionRes 获取登陆URL返回值

type GetSessionStatusRes

type GetSessionStatusRes struct {
	Status string
}

GetSessionStatusRes 获取登陆状态返回值

type GetTasksReq

type GetTasksReq struct {
	Page    int
	Size    int
	Sort    string
	Type    string
	Status  string
	Reward  string
	User    string
	Keyword string
}

GetTasksReq 获取任务列表请求

type GetWeChatImageRes

type GetWeChatImageRes struct {
	Data string
}

GetWeChatImageRes 获取微信登陆位置码

type LogsRes

type LogsRes struct {
	Count int64
	Data  []services.LogDetail
}

type MessageController

type MessageController struct {
	BaseController
	Service services.MessageService
}

MessageController 消息关API

func (*MessageController) Get

func (c *MessageController) Get() int

Get 获取会话列表

func (*MessageController) GetBy

func (c *MessageController) GetBy(id string) int

GetBy 获取会话消息

func (*MessageController) GetUserBy

func (c *MessageController) GetUserBy(id string) int

GetUserBy 获取会话消息

func (*MessageController) PostBy

func (c *MessageController) PostBy(id string) int

PostBy 发送消息

func (*MessageController) PostSystem

func (c *MessageController) PostSystem() int

PostSystem 发送系统消息

type PaginationRes

type PaginationRes struct {
	Page  int64
	Size  int64
	Total int64
}

PaginationRes 分页数据结构

type PlayerListRes

type PlayerListRes struct {
	Pagination PaginationRes
	Data       []services.TaskStatus
}

PlayerListRes 任务参与用户数据

type PostAnswersReq

type PostAnswersReq struct {
	Data []models.ProblemDataSchema `json:"data"`
}

PostAnswersReq 添加回答请求

type PostCertificationReq

type PostCertificationReq struct {
	Identity   models.UserIdentity
	Data       string
	Type       string
	Attachment []string
	Email      string
}

PostCertificationReq 申请认证请求

type PostCommentReq

type PostCommentReq struct {
	Type    string
	Content string
}

PostCommentReq 添加评论请求

type PostMessageReq

type PostMessageReq struct {
	Title   string
	Content string
	About   string
}

PostMessageReq 发送消息请求

type PostPlayerReq

type PostPlayerReq struct {
	Note string
}

PostPlayerReq 增加人员请求

type PostWechatReq

type PostWechatReq struct {
	Code string
}

PostWechatReq 温馨登陆请求

type PostWechatRes

type PostWechatRes struct {
	New bool
}

PostWechatRes 微信登陆数据

type PutFileReq

type PutFileReq struct {
	Name        string
	Description string
	Public      bool
}

PutFileReq 更新附件信息请求

type PutUserInfoReq

type PutUserInfoReq struct {
	*models.UserInfoSchema
	AvatarURL string `json:"avatar_url"`
}

PutUserInfoReq 修改用户信息请求

type PutUserReq

type PutUserReq struct {
	Operate  string
	Data     string
	Feedback string
}

PutUserReq 更新认证请求

type PutUserTypeReq

type PutUserTypeReq struct {
	Type string `json:"type"`
}

PutUserTypeReq 修改用户类型请求

type PutWechatReq

type PutWechatReq struct {
	Session string
}

type QuestionnaireController

type QuestionnaireController struct {
	BaseController
	Server services.QuestionnaireService
}

QuestionnaireController 问卷相关API

func (*QuestionnaireController) GetBy

func (c *QuestionnaireController) GetBy(id string) int

GetBy 获取问卷信息

func (*QuestionnaireController) GetByAnswers

func (c *QuestionnaireController) GetByAnswers(id string) int

GetByAnswers 获取问卷答案数据

func (*QuestionnaireController) GetByQuestions

func (c *QuestionnaireController) GetByQuestions(id string) int

GetByQuestions 获取问卷问题

func (*QuestionnaireController) PostBy

func (c *QuestionnaireController) PostBy(id string) int

PostBy 新建问卷

func (*QuestionnaireController) PostByAnswers

func (c *QuestionnaireController) PostByAnswers(id string) int

PostByAnswers 添加新回答

func (*QuestionnaireController) PostByQuestions

func (c *QuestionnaireController) PostByQuestions(id string) int

PostByQuestions 修改问卷问题

func (*QuestionnaireController) PutBy

func (c *QuestionnaireController) PutBy(id string) int

PutBy 修改问卷信息

type QuestionsRes

type QuestionsRes struct {
	Data []models.ProblemSchema `json:"problems"`
}

QuestionsRes 问题请求

type SessionController

type SessionController struct {
	BaseController
	Service services.UserService
}

SessionController 用户登陆状态控制

func (*SessionController) Delete

func (c *SessionController) Delete() int

Delete 退出登陆

func (*SessionController) Get

func (c *SessionController) Get() int

Get 获取 Violet 登陆授权 URL

func (*SessionController) GetStatus

func (c *SessionController) GetStatus() int

GetStatus 获取登陆状态

func (*SessionController) GetViolet

func (c *SessionController) GetViolet() int

GetViolet 通过 Violet 登陆

func (*SessionController) GetWechat

func (c *SessionController) GetWechat() int

GetWechat 获取微信登陆二维码

func (*SessionController) PostWechat

func (c *SessionController) PostWechat() int

PostWechat 通过微信登陆

func (*SessionController) PutWechat

func (c *SessionController) PutWechat() int

PutWechat 微信扫码登陆

type TaskController

type TaskController struct {
	BaseController
	Service services.TaskService
}

TaskController 任务相关API

func (*TaskController) DeleteBy

func (c *TaskController) DeleteBy(id string) int

DeleteBy 删除草稿任务

func (*TaskController) DeleteByCollect

func (c *TaskController) DeleteByCollect(id string) int

DeleteByCollect 删除收藏

func (*TaskController) DeleteByLike

func (c *TaskController) DeleteByLike(id string) int

DeleteByLike 取消点赞任务

func (*TaskController) Get

func (c *TaskController) Get() int

Get 获取任务列表

func (*TaskController) GetBy

func (c *TaskController) GetBy(id string) int

GetBy 获取指定任务详情

func (*TaskController) GetByPlayer

func (c *TaskController) GetByPlayer(id string) int

GetByPlayer 获取任务参与者

func (*TaskController) GetByPlayerBy

func (c *TaskController) GetByPlayerBy(id, userIDString string) int

GetByPlayerBy 获取用户任务状态

func (*TaskController) GetByWechat

func (c *TaskController) GetByWechat(id string) int

GetByWechat 生成活动微信小程序码

func (*TaskController) Post

func (c *TaskController) Post() int

Post 添加任务

func (*TaskController) PostByCollect

func (c *TaskController) PostByCollect(id string) int

PostByCollect 添加收藏

func (*TaskController) PostByLike

func (c *TaskController) PostByLike(id string) int

PostByLike 点赞任务

func (*TaskController) PostByPlayer

func (c *TaskController) PostByPlayer(id string) int

PostByPlayer 增加任务参与人员

func (*TaskController) PutBy

func (c *TaskController) PutBy(id string) int

PutBy 修改指定任务信息

func (*TaskController) PutByPlayerBy

func (c *TaskController) PutByPlayerBy(id, userIDString string) int

PutByPlayerBy 修改任务参与者状态

type TaskStatusReq

type TaskStatusReq struct {
	Status   string `json:"status"`
	Note     string `json:"note"`
	Degree   int    `json:"degree"`
	Remark   string `json:"remark"`
	Score    int    `json:"score"`
	Feedback string `json:"feedback"`
}

TaskStatusReq 任务参与状态请求

type TasksListRes

type TasksListRes struct {
	Pagination PaginationRes
	Tasks      []services.TaskDetail
}

TasksListRes 任务列表数据

type TasksStatusListRes

type TasksStatusListRes struct {
	Pagination PaginationRes
	Data       []services.TaskStatusDetail
}

TasksStatusListRes 用户参与任务数据

type UserController

type UserController struct {
	BaseController
	Service services.UserService
}

UserController 用户控制

func (*UserController) DeleteFollowingBy

func (c *UserController) DeleteFollowingBy(id string) int

DeleteFollowingBy 取消关注

func (*UserController) DeleteHistory

func (c *UserController) DeleteHistory() int

DeleteHistory 清空用户搜索历史

func (*UserController) Get

func (c *UserController) Get() int

Get 搜索用户

func (*UserController) GetCollectBy

func (c *UserController) GetCollectBy(userIDString string) int

GetCollectBy 获取用户收藏

func (*UserController) GetFollowerBy

func (c *UserController) GetFollowerBy(id string) int

GetFollowerBy 获取用户粉丝列表

func (*UserController) GetFollowingBy

func (c *UserController) GetFollowingBy(id string) int

GetFollowingBy 获取用户关注者列表

func (*UserController) GetHistory

func (c *UserController) GetHistory() int

GetHistory 获取用户搜索历史

func (*UserController) GetInfoBy

func (c *UserController) GetInfoBy(userID string) int

GetInfoBy 获取用户信息

func (*UserController) GetTaskBy

func (c *UserController) GetTaskBy(userIDString string) int

GetTaskBy 获取用户参与的任务列表

func (*UserController) PostAttend

func (c *UserController) PostAttend() int

PostAttend 用户签到

func (*UserController) PostFollowingBy

func (c *UserController) PostFollowingBy(id string) int

PostFollowingBy 添加关注

func (*UserController) PostPay

func (c *UserController) PostPay() int

func (*UserController) PutInfo

func (c *UserController) PutInfo() int

PutInfo 修改用户信息

func (*UserController) PutTypeByID

func (c *UserController) PutTypeByID(userID string) int

PutTypeByID 修改用户类型

type UserListRes

type UserListRes struct {
	Pagination PaginationRes
	Data       []services.UserDetail
}

UserListRes 用户数据

type UtilsController

type UtilsController struct {
	BaseController
	Service services.UtilsService
}

TaskController 任务相关API

func (*UtilsController) GetLogs

func (c *UtilsController) GetLogs() int

Jump to

Keyboard shortcuts

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