news

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var GetNewsListRouter = router.Handler(func(c router.Context) {
	var (
		input Query
	)

	c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response {
		return GetNewsList(input)
	})
})
View Source
var GetNewsRouter = router.Handler(func(c router.Context) {
	id := c.Param("news_id")

	c.ResponseFunc(nil, func() schema.Response {
		return GetNews(id)
	})
})

Functions

func GetNews

func GetNews(id string) (res schema.Response)

func GetNewsList

func GetNewsList(query Query) (res schema.Response)

Types

type Query

type Query struct {
	schema.Query
	Status *model.NewsStatus `json:"status" url:"status" validate:"omitempty,number" comment:"状态"`
	Type   *model.NewsType   `json:"type" url:"type" validate:"omitempty" comment:"类型"`
}

Jump to

Keyboard shortcuts

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