123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package model
- import (
- "time"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- )
- type CowImmunizationPlan struct {
- Id int64 `json:"id"`
- CowId int64 `json:"cowId"`
- ImmunizationPlanId int64 `json:"immunizationPlanId"`
- ImmunizationPlanName string `json:"immunizationPlanName"`
- PlanDay string `json:"planDay"`
- RealityDay string `json:"realityDay"`
- Status pasturePb.IsShow_Kind `json:"status"`
- OperationId int64 `json:"operationId"`
- OperationName string `json:"operationName"`
- DrugsId int64 `json:"drugsId"`
- Unit pasturePb.Unit_Kind `json:"unit"`
- Usage string `json:"usage"`
- Remarks string `json:"remarks"`
- CreateAt int64 `json:"createAt"`
- UpdateAt int64 `json:"updateAt"`
- }
- func (c *CowImmunizationPlan) TableName() string {
- return "cow_immunization_plan"
- }
- func NewCowImmunizationPlan(cowId int64, immunizationPlan *ImmunizationPlan) *CowImmunizationPlan {
- return &CowImmunizationPlan{
- CowId: cowId,
- ImmunizationPlanId: immunizationPlan.Id,
- ImmunizationPlanName: immunizationPlan.Name,
- PlanDay: time.Now().Format(LayoutDate2),
- Status: pasturePb.IsShow_No,
- }
- }
- func NewCowImmunizationPlanList(cowList []*Cow, immunizationPlan *ImmunizationPlan) []*CowImmunizationPlan {
- cowImmunizationPlanList := make([]*CowImmunizationPlan, len(cowList))
- for i, v := range cowList {
- cowImmunizationPlanList[i] = NewCowImmunizationPlan(v.Id, immunizationPlan)
- }
- return cowImmunizationPlanList
- }
- type ImmunizationPlanCowSlice []*CowImmunizationPlan
- type ImmunizationCalendarHeader struct {
- Id string `json:"id"`
- CowId string `json:"cowId"`
- PlanStartTime string `json:"planStartTime"`
- ImmunizationPlanId string `json:"immunizationPlanId"`
- ImmunizationPlanName string `json:"immunizationPlanName"`
- Status string `json:"status"`
- }
- func (I ImmunizationPlanCowSlice) ToPB() []*CowImmunizationPlan {
- res := make([]*CowImmunizationPlan, len(I))
- for i, v := range I {
- res[i] = v
- }
- return res
- }
|