project_belong.go 945 字节
package domain

// 项目归属
type ProjectBelong struct {
	// 项目归属ID
	ProjectBelongId int `json:"projectBelongId"`
	// 项目归属名称
	ProjectBelongName string `json:"projectBelongName"`
	// 公司ID
	CompanyId int64 `json:"companyId"`
}

type ProjectBelongRepository interface {
	Save(projectBelong *ProjectBelong) (*ProjectBelong, error)
	Remove(projectBelong *ProjectBelong) (*ProjectBelong, error)
	FindOne(queryOptions map[string]interface{}) (*ProjectBelong, error)
	Find(queryOptions map[string]interface{}) (int64, []*ProjectBelong, error)
}

func (projectBelong *ProjectBelong) Identify() interface{} {
	if projectBelong.ProjectBelongId == 0 {
		return nil
	}
	return projectBelong.ProjectBelongId
}

func (projectBelong *ProjectBelong) Update(data map[string]interface{}) error {
	if projectBelongName, ok := data["projectBelongName"]; ok {
		projectBelong.ProjectBelongName = projectBelongName.(string)
	}
	return nil
}