Documentation ¶
Index ¶
- func CreateAwardByProjectIDandCompetitionID(tx *gorm.DB, projectID int64, competitionName string, awardRanking string, ...) (err error)
- func CreateComment(tx *gorm.DB, comment Comment) (err error)
- func CreateCompetition(tx *gorm.DB, competition Competition) error
- func CreatePositionByProjectID(tx *gorm.DB, projectID uint, name string, needPeople int64, describe string) (err error)
- func CreatePositionTemplate(tx *gorm.DB, positionTemplate *PositionTemplate) (err error)
- func CreateProject(tx *gorm.DB, project Project) (projectID uint, err error)
- func CreateResumeBySenderIDAndPositionName(tx *gorm.DB, projectID int64, senderID int64, positionName string, ...) (err error)
- func CreateType(tx *gorm.DB, typeNew Type) error
- func EditPositionByID(tx *gorm.DB, positionID uint, needPeople int64, describe string) (err error)
- func FindTypeIDByName(tx *gorm.DB, typeName string) int64
- func GetProjectNum(tx *gorm.DB) int64
- func UpdateAwardByProjectIDandCompetitionID(tx *gorm.DB, projectID int64, competitionID int64, awardRanking string, ...) (err error)
- func UpdateProjectByID(tx *gorm.DB, projectID uint, key string, value string) (err error)
- func UpdateResumeBySenderIAndPositionID(tx *gorm.DB, senderID int64, positionID int64, content string) (err error)
- type Comment
- type Competition
- type CompetitionProject
- type Conversation
- type File
- type Message
- type MessageType
- type Position
- type PositionTemplate
- type Project
- type Resume
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePositionTemplate ¶
func CreatePositionTemplate(tx *gorm.DB, positionTemplate *PositionTemplate) (err error)
func CreateProject ¶
创建项目
func EditPositionByID ¶
func UpdateProjectByID ¶
通过ID更新岗位
Types ¶
type Comment ¶
type Competition ¶
type Competition struct { gorm.Model //比赛名称; Name string `gorm:"unique"` //比赛介绍 Description string //比赛图片, 一般为比赛的宣传海报;填写该图片的URL ImageURL string //比赛官网链接 HomePageURL string //比赛时间,若有下一次比赛的具体时间,则更新为具体时间,否则为上一届的时间 //这里用字符串而非time.Time的原因是比赛时间可能是较为复杂的多个时间点,如:提交立项申请书:6月10日~7月15日;初审答辩:7月中旬 Time string //相关资料下载; 填写File的ID; 若有多个资料则用英文分号隔开 //注意:由于无需通过文件查找有关比赛,因此不用定义反向引用 Files []File //比赛下属项目,比赛与项目为多对多关系,可由此通过比赛进行项目的筛选 Projects []*Project `gorm:"many2many:competition_projects"` }
比赛Competition; 由管理员创建,使用者仅可从已有比赛中进行勾选
func FindCompetitionByID ¶
func FindCompetitionByID(tx *gorm.DB, competitionID int64) Competition
func FindCompetitionByName ¶
func FindCompetitionByName(tx *gorm.DB, competitionName string) Competition
type CompetitionProject ¶
type CompetitionProject struct { ProjectID int64 CompetitionID int64 //奖项名次, 如一等奖就等于1,二等奖就等于2 AwardRanking string //奖项证明链接 ProveImgURL string }
func FindCompetitionProjectByProjectID ¶
func FindCompetitionProjectByProjectID(tx *gorm.DB, projectID int64) []CompetitionProject
func FindCompetitionProjectsByProjectID ¶
func FindCompetitionProjectsByProjectID(tx *gorm.DB, projectID int64) []CompetitionProject
type Conversation ¶
type Conversation struct { gorm.Model ProjectID int64 //招募者ID RecruiterID int64 //寻募者ID JobSeeker int64 Messages []Message //意向岗位与聊天属于多对多关系,一个人可以有多个意向岗位,一个岗位可以有多个人有意愿 IntentionPositions []*Position `gorm:"many2many:conversation_positions;"` }
聊天逻辑:对于一个项目来说,每有一个“求募者”与“招募者”进行沟通,就会产生一个Conversation,每个Conversation对应若干个message 在Conversation模型中,加入IntentionPositions表示意向岗位
type Message ¶
type Message struct { gorm.Model ConversationID int64 //消息类型 MessageType MessageType //消息内容,如果是文字消息,则为消息内容,若为图片消息则为图片地址URL Content string }
一次Conversation的“元”,在前端以左右气泡的形式,以时间顺序排列
type MessageType ¶
type MessageType = int
const ( TextMessage MessageType = 0 ImageMessage MessageType = 1 )
约定如下:0-文字消息,1-图片消息,。。。
type Position ¶
type Position struct { gorm.Model //岗位对应的项目ID,作为岗位-项目关系的foreignKey ProjectID int64 //岗位介绍 //岗位名称ID PositionTemplateID int64 //岗位简介,若未空则显示对应PositionTemplate中的DefaultDescribe Describe string //目前该岗位已招募的人数(录用人数) NowPeople int64 //需要招募的人数(需求人数) NeedPeople int64 //对该岗位感兴趣的人数 InterestPeople int64 //对该岗位有兴趣的聊天 Conversations []*Conversation `gorm:"many2many:conversation_positions;"` //该岗位的简历 Resumes []Resume }
岗位Position,即招募需求中,需要具有哪些方面能力的人才;举例:前端开发、后端开发、UI设计、UX设计等
type PositionTemplate ¶
type PositionTemplate struct { gorm.Model //岗位名称 Name string //岗位对象,用于通过岗位名称查找相对应的岗位 Positions []Position //默认岗位描述 DefaultDescribe string }
岗位模板,这里把岗位名称单拎出来是为了让岗位名称仅来自于从已有岗位名称中挑选,以方便首屏中依据岗位的筛选 附有默认的岗位描述,该内容可自定义,若用户未编写则未默认内容 同时Position未定死的原因是同一个岗位比如后端开发,在不同项目中的实际需求可能是不一样的
func FindAllPositionTemplates ¶
func FindAllPositionTemplates(tx *gorm.DB) []PositionTemplate
获取所有岗位模板
func FindPositionTemplateByID ¶
func FindPositionTemplateByID(tx *gorm.DB, positionTemplateID int64) PositionTemplate
通过项目ID查找所有岗位ID
func FindPositionTemplateByName ¶
func FindPositionTemplateByName(tx *gorm.DB, positionTemplateName string) PositionTemplate
通过名称查找所有岗位模板
type Project ¶
type Project struct { gorm.Model //是否可用,初始值为false,若项目已招募够需要的人数、或由招募者手动操作后,进入true状态;招募者可重新开启招募 //解释:变量用途:1.用于展示优先度的计算;2.封存阶段仅可浏览、不可与招募者联系,可选择当招募再次开启时提醒 IsAvailable bool `gorm:"default:true"` //创建者ID CreatorID int64 //队员:项目与比赛为多对多关系,且比赛名次以项目为单位 //获奖逻辑: //A项目获奖 - A项目关联比赛 - A项目在该比赛中名次;【项目创建者操作】 //查看成员 - 获取成员关联项目 - 获取项目获奖情况; //查看项目 - 查看该项目的获奖情况 //查看比赛 - 查看所有项目获奖情况; //查看competition_projects连接表 - 查看使用组队系统的所有项目的获奖情况 Members []*models.User `gorm:"many2many:user_projects"` //比赛/活动:【在此系统中,比赛与活动视作一个类,下方将仅用“比赛”词代替“比赛/活动”】 //注意此处功能设计上需要有:点击项目卡片上的比赛标签 => 进入带有设置了该比赛筛选的首屏 Competitions []*Competition `gorm:"many2many:competition_projects"` //类别: //注意:此类别区别于”比赛“属性,其内容为:如:“校企合作”,“导师科研”,“学生自研”等 //“比赛”为多选,”类别“为单选 //类别ID,由于一个项目仅能对应一个类别,所以使用int64类型 TypeID int64 //项目介绍: //项目名称; 要求:不允许出现两个项目名称相同 Name string `gorm:"unique"` //简短的文字介绍,用3~5句话讲清是做什么,用于首屏中卡片中简单介绍项目,以及详情页中的”简介“ DescribeSimple string //详细的文字介绍,详细介绍项目是做什么,包括项目背景、目标、成果等等信息,用于详情页中的详细介绍项目 DescribeDetail string //介绍链接URL,类似于微信”阅读原文“功能,如有交互式展示、图文消息等复杂形式的介绍,目前不做集成仅作跳转 LinkURL string //项目招募结束时间,可作为首屏项目卡片排序的参照属性之一 EndTime time.Time //项目需要的岗位,一对多关系 Positions []Position //项目评论,一个项目可以有多个评论 Comments []Comment //项目评论数 CommentsNum int64 `gorm:"default:0"` //项目Star数 StarNum int64 `gorm:"default:0"` }
项目Project; 由招募者创建,并可进行二次编辑、选择封存、删除等
Click to show internal directories.
Click to hide internal directories.