calendar

package
v0.0.0-...-c07fb9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveCalendar

func SaveCalendar(dsnSrc string) error

Types

type PerpetualCalendar

type PerpetualCalendar struct {
	//Status       string `json:"status"`
	//T            string `json:"t"`
	//SetCacheTime string `json:"set_cache_time"`
	Data []PerpetualCalendarData `json:"data"`
}

type PerpetualCalendarAlmanac

type PerpetualCalendarAlmanac struct {
	SolarId int `gorm:"column:solarId;primarykey"`             // 阳历ymd,作为主键
	LunarId int `gorm:"column:lunarId;not null;index:lunarId"` // 阴历ymd,加入索引

	Animal         string    `json:"animal" gorm:"column:animal;not null;size:4"`                     // 生肖
	Suit           string    `json:"suit" gorm:"column:suit;not null"`                                // 宜
	Avoid          string    `json:"avoid" gorm:"column:avoid;not null"`                              // 忌
	CnDay          string    `json:"cnDay" gorm:"column:cnDay;not null;size:4"`                       // 星期
	Day            int       `json:"day,string" gorm:"column:day;not null;uniqueIndex:Solar"`         // 阳历日
	Month          int       `json:"month,string" gorm:"column:month;not null;uniqueIndex:Solar"`     // 阳历月
	Year           int       `json:"year,string" gorm:"column:year;not null;uniqueIndex:Solar"`       // 阳历年
	GzDate         string    `json:"gzDate" gorm:"column:gzDate;not null;size:8"`                     // 干支日
	GzMonth        string    `json:"gzMonth" gorm:"column:gzMonth;not null;size:8"`                   // 干支月
	GzYear         string    `json:"gzYear" gorm:"column:gzYear;not null;size:8"`                     // 干支年
	IsBigMonth     string    `json:"isBigMonth" gorm:"-"`                                             // json取数据,忽略gorm
	IsBigMonthBool bool      `gorm:"column:isBigMonth;not null;default:0"`                            // 是否为阴历大月
	LDate          string    `json:"lDate" gorm:"column:lDate;not null;size:4"`                       // 阴历日,汉字
	LMonth         string    `json:"lMonth" gorm:"column:lMonth;not null;size:4"`                     // 阴历月,汉字,带'闰'字表示闰月
	LunarDate      int       `json:"lunarDate,string" gorm:"column:lunarDate;not null;index:Lunar"`   // 阴历日,数字
	LunarMonth     int       `json:"lunarMonth,string" gorm:"column:lunarMonth;not null;index:Lunar"` // 阴历月,数字
	LunarYear      int       `json:"lunarYear,string" gorm:"column:lunarYear;not null;index:Lunar"`   // 阴历年,数字
	ODate          time.Time `json:"oDate" gorm:"column:oDate;not null"`                              // ODate.Local(),阳历当天0点
	Term           string    `json:"term,omitempty" gorm:"column:term;not null"`                      // 如'除夕','万圣节','三伏'等
	Desc           string    `json:"desc,omitempty" gorm:"column:desc;not null"`                      // 如'腊八节','下元节'等
	Type           string    `json:"type,omitempty" gorm:"column:type;not null;size:2"`               // a,c,h,i,t,用这种查询感觉看不出来啥:"SELECT *FROM perpetualCalendarAlmanac WHERE TYPE ='a' GROUP BY TERM HAVING COUNT(TERM)>1"
	Value          string    `json:"value,omitempty" gorm:"column:value;not null"`                    // 如'国际残疾人日'等
	Status         int       `json:"status,string,omitempty" gorm:"column:status;not null;default:0"` // 0 工作日,1 休假,2 上班,3 周末
}

func GetPerpetualCalendar

func GetPerpetualCalendar(year, mouth int) ([]PerpetualCalendarAlmanac, error)

GetPerpetualCalendar 返回[前一个月,本月,后一个月]的数据

func (PerpetualCalendarAlmanac) TableName

func (PerpetualCalendarAlmanac) TableName() string

type PerpetualCalendarData

type PerpetualCalendarData struct {
	//ExtendedLocation string `json:"ExtendedLocation"`
	//OriginQuery      string `json:"OriginQuery"`
	//SiteID           int    `json:"SiteId"`
	//StdStg           int    `json:"StdStg"`
	//StdStl           int    `json:"StdStl"`
	//SelectTime       int    `json:"_select_time"`
	//UpdateTime       string `json:"_update_time"`
	//Version          int    `json:"_version"`
	//Appinfo          string `json:"appinfo"`
	//CambrianAppid    string `json:"cambrian_appid"`
	//DispType         int    `json:"disp_type"`
	//Fetchkey         string `json:"fetchkey"`
	//Key              string `json:"key"`
	//Loc              string `json:"loc"`
	//Resourceid       string `json:"resourceid"`
	//RoleID           int    `json:"role_id"`
	//Showlamp         string `json:"showlamp"`
	//Tplt             string `json:"tplt"`
	//URL              string `json:"url"`
	Almanac []PerpetualCalendarAlmanac `json:"almanac"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL