Documentation ¶
Index ¶
- Constants
- Variables
- func BindCreate(c *fiber.Ctx) (*model.Group, error)
- func GetGroupsByUserID(c *fiber.Ctx) error
- type GroupDao
- func (gd GroupDao) Apply(gid, uid uint) error
- func (gd GroupDao) Approve(gid, uid, mid uint) error
- func (gd GroupDao) Cancel(gid, uid uint) error
- func (gd GroupDao) Create(group *model.Group) error
- func (gd GroupDao) Exists(gid uint) error
- func (gd GroupDao) ExistsName(name string) error
- func (gd GroupDao) Fire(gid, uid, mid uint) error
- func (gd GroupDao) GetApplictionsByGroupID(gid uint) ([]model.GroupApplication, error)
- func (gd GroupDao) GetByID(gid uint) (*model.Group, error)
- func (gd GroupDao) GetByPage(page int, pageSize int) ([]*model.Group, error)
- func (gd GroupDao) GetByUserID(uid uint) ([]*model.Group, error)
- func (gd GroupDao) Promote(gid, uid, mid uint) error
- func (gd GroupDao) Quit(gid, mid uint) error
- func (gd GroupDao) Refuse(gid, uid, mid uint) error
- func (gd GroupDao) Remove(gid, uid uint) error
- func (gd GroupDao) Transfer(gid, uid, mid uint) error
- func (gd GroupDao) UpdateAddress(gid, uid uint, addr string) error
- func (gd GroupDao) UpdateLogo(gid, uid uint, logo string) error
- func (gd GroupDao) UpdateName(gid, uid uint, name string) error
- func (gd GroupDao) UpdateNotice(gid, uid uint, notice string) error
- type RequestUpdate
- type Result
Constants ¶
View Source
const ( KeyPostDB = "group.gorm.db" KeyPostNoCheckRouter = "group.router.nocheck" KeyPostCheckRouter = "group.router.check" )
View Source
const ( SqlQueryGroupByID = `SELECT * FROM groups WHERE id = ? AND deleted_at IS NULL` SqlQueryGroupByName = `SELECT * FROM groups WHERE name = ? AND deleted_at IS NULL` SqlQueryGroupByUserID = `` /* 207-byte string literal not displayed */ SqlQueryGroupByPage = `SELECT * FROM groups WHERE deleted_at IS NULL ORDER BY id DESC LIMIT ? OFFSET ?` SqlUpdateGroupNameByID = `UPDATE groups SET name = ? WHERE id = ?` SqlUpdateGroupLogoByID = `UPDATE groups SET logo = ? WHERE id = ?` SqlUpdateGroupNoticeByID = `UPDATE groups SET notice = ? WHERE id = ?` SqlUpdateGroupAddrByID = `UPDATE groups SET addr = ? WHERE id = ?` SqlDeleteGroupnByID = `DELETE FROM group WHERE id = ?` )
group
View Source
const ( SqlQueryGroupApplicationsByGroupID = `SELECT * FROM group_application WHERE group_id = ? AND deleted_at IS NULL` SqlQueryGroupApplicationsByUserID = `SELECT * FROM group_application WHERE user_id = ? AND deleted_at IS NULL` SqlQueryGroupApplicationByGroupIDAndUserID = `SELECT * FROM group_application WHERE group_id = ? AND user_id = ? AND deleted_at IS NULL` SqlDeleteGroupApplicationByGroupIDAndUserID = `DELETE FROM group_application WHERE group_id = ? AND user_id = ?` SqlDeleteGroupApplicationByGroupID = `DELETE FROM group_application WHERE group_id = ?` )
group application
View Source
const ( SqlQueryGroupMemberByGroupID = `SELECT * FROM group_members WHERE group_id = ? AND deleted_at IS NULL` SqlQueryGroupMemberByGroupIDAndPosition = `SELECT * FROM group_members WHERE group_id = ? AND position > ? AND deleted_at IS NULL` SqlQueryGroupMemberByGroupIDAndUserID = `SELECT * FROM group_members WHERE group_id = ? AND user_id = ? AND deleted_at IS NULL` SqlUpdateGroupMemberPositionByGroupIDAndUserID = `` /* 127-byte string literal not displayed */ SqlDeleteGroupMemberByGroupID = `DELETE FROM group_members WHERE group_id = ?` SqlDeleteGroupMemberByGroupIDAndUserID = `DELETE FROM group_members WHERE group_id = ? AND user_id = ?` )
group member
Variables ¶
View Source
var Dao = new(GroupDao)
Functions ¶
func BindCreate ¶
Types ¶
type GroupDao ¶
type GroupDao struct{}
func (GroupDao) ExistsName ¶
ExistsName group name exists or not
func (GroupDao) GetApplictionsByGroupID ¶
func (gd GroupDao) GetApplictionsByGroupID(gid uint) ([]model.GroupApplication, error)
GetApplictionsByGroupID return the applications of the group
func (GroupDao) GetByUserID ¶
GetByUserID get the groups by user id
func (GroupDao) UpdateAddress ¶
UpdateAddress update the address of the group
func (GroupDao) UpdateLogo ¶
UpdateLogo update the logo of the group
func (GroupDao) UpdateName ¶
UpdateName update the name of the group
type RequestUpdate ¶
type RequestUpdate struct { ID uint `json:"id" form:"id"` Uid uint `json:"uid" form:"uid"` Mid uint `json:"mid" form:"mid"` Name string `json:"name" form:"name"` Logo string `json:"logo" form:"logo"` Notice string `json:"notice" form:"notice"` Address string `json:"address" form:"address"` }
func Bind ¶
func Bind(c *fiber.Ctx) (*RequestUpdate, error)
type Result ¶
type Result struct { Group model.Group Member model.GroupMember Application model.GroupApplication Error error }
Click to show internal directories.
Click to hide internal directories.