achievement.go 4.7 KB
package protocol

import "time"

const (
	Grasper  = 1 //把握人
	Provider = 2 //提供者
)

//成果项
type AchievementItem struct {
	Id         int64         `json:"id"`
	CreateTime int64         `json:"createTime"`
	Provider   *BaseUserInfo `json:"provider"`
	Content    string        `json:"content"`
	Pictures   []Picture     `json:"pictures"`
	//GraspScore        float64       `json:"graspScore"`        //把握分
	//GraspScorePercent float64       `json:"graspScorePercent"` //把握分百分比
}

type GraspScore struct {
	GraspScore        float64 `json:"graspScore"`        //把握分
	GraspScorePercent float64 `json:"graspScorePercent"` //把握分百分比
}

//机会列表 通用项
type AchievementCommonListItem struct {
	Achievement   AchievementItem `json:"achievement,omitempty"`   //成果详情
	StatisticData interface{}     `json:"statisticData,omitempty"` //统计数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData
	//我审核的-通过
	Score      interface{} `json:"score,omitempty"`
	GraspScore interface{} `json:"graspScore,omitempty"` //把握分
	//模板
	ChanceType     interface{} `json:"chanceType,omitempty"` //机会类型
	ChanceTemplate interface{} `json:"template,omitempty"`   //机会模板

	Message     interface{} `json:"message,omitempty"`     //消息
	CommentData interface{} `json:"commentData,omitempty"` //评论
	CollectData interface{} `json:"collectData,omitempty"` //收藏数据
	ThumbUpData interface{} `json:"thumbUpData,omitempty"` //点赞数据
	//我评论的 评论数据
	CommentedData interface{} `json:"commentedData,omitempty"`

	SourceType int `json:"sourceType,omitempty"` //类型 1:机会 2:评论
	Status     int `json:"-"`                    //0:删除 1:开启 2:关闭
}

/*AchievementPool 成果池*/
type AchievementPoolRequest struct {
	UserId               int64 `json:"userId"`
	LastId               int64 `json:"lastId"`
	PageSize             int   `json:"pageSize" valid:"Required"`
	ChanceTypeId         int   `json:"chanceTypeId"` //0:所有机会 编号:对应机会类型编号的机会
	DepartmentId         int   `json:"departmentId"`
	IncludeSubDepartment bool
}
type AchievementPoolResponse struct {
	List  []*AchievementCommonListItem `json:"list"`
	Total int                          `json:"total"`
}

//通用 机会orm对象
type CommAchievementItemOrm struct {
	AchievementItemOrm
	StaticDataOrm
}
type AchievementItemOrm struct {
	AchievementId  int64     `orm:"column(id)"`
	UserId         int64     `orm:"column(user_company_id)"`
	CreateTime     time.Time `orm:"column(create_at)"`
	SourceContent  string    `orm:"column(source_content)"`
	Images         string    `orm:"column(images)"`
	GraspScore     float64   `orm:"column(grasp_score)"`
	UserGraspScore float64   `orm:"column(user_grasp_score)"`

	TemplateId   int `orm:"column(audit_template_id)"`
	ChanceTypeId int `orm:"column(chance_type_id)"`
	Status       int `orm:"column(status)"`
}

type StaticDataOrm struct {
	CommentTotal int `orm:"column(comment_total)"`
	ZanTotal     int `orm:"column(zan_total)"`
	ViewTotal    int `orm:"column(view_total)"`
}

//机会池收藏列表项
//type AchievementsOrm struct {
//	CommAchievementItemOrm
//}

/*MyGrasp  我把握的*/
type MyGraspRequest struct {
	AchievementPoolRequest
}
type MyGraspResponse struct {
	AchievementPoolResponse
}

/*AchievementDetail 成果详情*/
type AchievementDetailRequest struct {
	Id int64 `json:"id" valid:"Required"`
}
type AchievementDetailResponse struct {
	Achievement   AchievementItem `json:"achievement,omitempty"`   //成果详情
	GraspScore    interface{}     `json:"graspScore,omitempty"`    //把握分
	StatisticData interface{}     `json:"statisticData,omitempty"` //统计数据(是否收藏/点赞 浏览数 点赞总数 评论数
	//模板
	ChanceType     interface{}       `json:"chanceType,omitempty"` //机会类型
	ChanceTemplate interface{}       `json:"template,omitempty"`   //机会模板
	Status         int               `json:"-"`                    //0:删除 1:开启 2:关闭
	SourceChance   []*CommonListItem `json:"sourceChance"`         //机会来源
	Participants   []UserGraspInfo   `json:"participants"`         //参与人
}

type UserGraspInfo struct {
	Provider   *BaseUserInfo `json:"provider"`
	GraspScore GraspScore    `json:"graspScore"` //把握分
	//GraspScorePercent float64       `json:"graspScorePercent"` //把握分百分比
	Type int `json:"type"` //1:把握人 2:提供者
}

type SourceChanceItemOrm struct {
	CommChanceItemOrm

	TemplateId   int `orm:"column(audit_template_id)"`
	ChanceTypeId int `orm:"column(chance_type_id)"`
}

/*MyGraspStatistic */
type MyGraspStatisticRequest struct {
}
type MyGraspStatisticResponse struct {
	GraspStatistic interface{} `json:"list"`
}