compnay.go 1.1 KB
package domain

import "time"

// 公司信息
type Company struct {
	// 唯一标识
	Id int64 `json:"id"`
	// 名称
	Name string `json:"name"`
	// 公司简称
	Abbreviation string `json:"abbreviation"`
	// 手机号码
	Phone string `json:"phone"`
	// 公司logo
	Logo string `json:"logo"`
	// 备注
	Remarks string `json:"remarks"`
	// 总后台的公司id
	AdminCompanyId int `json:"adminCompanyId"`
	// 状态 1正常 2禁用
	Status int8 `json:"status"`
	// 创建时间
	CreateAt time.Time `json:"createAt"`
	// 更新时间
	UpdateAt time.Time `json:"updateAt"`
	// 删除时间
	DeleteAt time.Time `json:"deleteAt"`
	// 是否开启合伙人模块,是否有效【1:有效】【2:无效】
	Enable int8 `json:"enable"`
	// 小程序
	Applets []CompanyApplets `json:"applets"`
}

type CompanyRepository interface {
	Save(dm *Company) (*Company, error)
	Remove(dm *Company) (*Company, error)
	FindOne(queryOptions map[string]interface{}) (*Company, error)
	Find(queryOptions map[string]interface{}) (int64, []*Company, error)
}

func (m *Company) Identify() interface{} {
	if m.Id == 0 {
		return nil
	}
	return m.Id
}