You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
625 B

package thirdPartyApi
import (
"github.com/gin-gonic/gin"
"recook/internal/back"
"recook/internal/v2/logic/thirdPartyApi"
"recook/tools"
)
type TianXingApi struct {
}
type argsHolidays struct {
Year string `binding:"required"`
}
// GetHolidays 获取节假日并缓存
func (t *TianXingApi) GetHolidays(c *gin.Context) {
var args argsHolidays
if err := tools.ParseParams(&args, c); err != nil {
back.Fail(c, err.Error())
return
}
holidays, err := thirdPartyApi.TianXingApiLogic.GetHolidays(args.Year)
if err != nil {
back.Fail(c, err.Error())
return
}
back.Suc(c, "操作成功", holidays.NewsList)
}