chance.go 3.6 KB
package protocol

import "opp/models"

const (
	MarkFlag_Zan     = 1
	MarkFlag_Collect = 2
)

const (
	UnMarkFlag = 0
	MarkFlag   = 1 //是否标记   /点赞 /收藏
)

const (
	AuditFlowType_Departmentor = iota + 1 //部门长
	AuditFlowType_User                    //指定用户
	AuditFlowType_Role                    //指定角色
	AuditFlowType_SpecailUser             //特殊人员
)

const (
	FlowType_Normal = iota + 1
	FlowType_Specail
)

const (
	NoApprover_Pass    = 1
	NoApprover_ToAdmin = 2
)

const (
	StaticType_Question = 1 << iota
	StaticType_Question2
)

/*Favorite */
type FavoriteRequest struct {
	ObjectType int `json:"object_type" valid:"Required"` //收藏 点赞
	ChanceType int `json:"chance_type" valid:"Required"`
	//TagId   int `json:"tag_id"`  //标签id
	LastId   int64 `json:"lastId"`
	PageSize int   `json:"pageSize" valid:"Required"`
}
type FavoriteResponse struct {
	Total int               `json:"total"`
	Lists []*ChanceFavorite `json:"lists"`
}

type ChanceFavorite struct {
	Id       int64       `json:"id"`
	Favorite interface{} `json:"favorite"`
}

type ChanceDetail struct {
	Id         int64         `json:"id"`
	Provider   *BaseUserInfo `json:"provider"`
	IsCollect  bool          `json:"is_collect"`
	IsZan      bool          `json:"is_zan"`
	Content    string        `json:"content"`
	ChanceType int           `json:"chance_type"`

	//图片
	//视频
	//语音

	ViewTotal    int `json:"view_total"`
	CommentTotal int `json:"comment_total"`
	ZanTotal     int `json:"zan_total"`
}

/*SympathyAction */
type SympathyActionRequest struct {
	MarkType     int   `json:"mark_type" valid:"Required"`   // 1.赞  2.收藏
	SourceType   int   `json:"source_type" valid:"Required"` //protocol.SourceType //机会 评论
	Id           int64 `json:"id" valid:"Required"`
	SympathyType int   `json:"sympathy_type"` //1:标记 0:取消标记
}
type SympathyActionResponse struct {
}

/*ChanceType */
type ChanceTypeRequest struct {
}
type ChanceTypeResponse struct {
	List []*models.ChanceType `json:"list"`
}

/*Templates */
type TemplatesRequest struct {
	ChanceTypeId int `json:"chanceTypeId" valid:"Required"`
}
type TemplatesResponse struct {
	Templates []*Template `json:"list"`
}

type Template struct {
	Id       int64   `json:"id"`
	Name     string  `json:"name"`
	Doc      string  `json:"doc"`
	Icon     string  `json:"icon"`
	FormList []*Form `json:"formList"`
}

type Form struct {
	Id          int    `json:"id"`
	Lable       string `json:"lable"`
	InputType   string `json:"inputType"`
	SectionType int8   `json:"sectionType"`
	Value       string `json:"value"`
	Required    int8   `json:"required"`
}

type ChanceSubmitRequest struct {
	Id                int64     `json:"id"` // = 0添加  >0 编辑
	AuditTemplateId   int64     `json:"auditTemplateId" valid:"Required"`
	Content           string    `json:"content" valid:"Required"`
	FormList          []*Form   `json:"formList" valid:"Required"`
	Speechs           []Speech  `json:"speechs"`
	Pictures          []Picture `json:"pictures"`
	Videos            []Video   `json:"videos"`
	RelatedDepartment int64     `json:"relatedDepartments" valid:"Required"`
}

type ChanceSubmitResponse struct {
}

type Speech struct {
	Path     string `json:"path"`
	Duration int    `json:"duration"`
}
type Picture struct {
	Path string `json:"path"`
	W    int    `json:"w"`
	H    int    `json:"h"`
}
type Video struct {
	Path     string `json:"path"`
	Cover    string `json:"cover"` //封面
	Duration int    `json:"duration"`
}

type AuditConfig struct {
	NoApprover int8 `json:"no_approver"` //审核人空时:【1:自动通过】【2:转交给管理员】
}