初始化项目
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
type adPosition struct{}
|
type adPosition struct{}
|
||||||
|
|
||||||
var AdPosition = &adPosition{}
|
var AdPosition = new(adPosition)
|
||||||
|
|
||||||
// Add 添加广告位
|
// Add 添加广告位
|
||||||
func (c *adPosition) Add(ctx context.Context, req *dto.AddAdPositionReq) (res *dto.AddAdPositionRes, err error) {
|
func (c *adPosition) Add(ctx context.Context, req *dto.AddAdPositionReq) (res *dto.AddAdPositionRes, err error) {
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ import (
|
|||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var AdSource = new(adSource)
|
||||||
AdSource = adSource{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type adSource struct{}
|
type adSource struct{}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
type adStatistics struct{}
|
type adStatistics struct{}
|
||||||
|
|
||||||
var AdStatistics = &adStatistics{}
|
var AdStatistics = new(adStatistics)
|
||||||
|
|
||||||
// GetStatistics 获取统计数据
|
// GetStatistics 获取统计数据
|
||||||
func (c *adStatistics) GetStatistics(ctx context.Context, req *dto.GetAdStatisticsReq) (res *dto.GetAdStatisticsRes, err error) {
|
func (c *adStatistics) GetStatistics(ctx context.Context, req *dto.GetAdStatisticsReq) (res *dto.GetAdStatisticsRes, err error) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
type advertisement struct{}
|
type advertisement struct{}
|
||||||
|
|
||||||
var Advertisement = &advertisement{}
|
var Advertisement = new(advertisement)
|
||||||
|
|
||||||
// Add 添加广告
|
// Add 添加广告
|
||||||
func (c *advertisement) Add(ctx context.Context, req *dto.AddAdvertisementReq) (res *dto.AddAdvertisementRes, err error) {
|
func (c *advertisement) Add(ctx context.Context, req *dto.AddAdvertisementReq) (res *dto.AddAdvertisementRes, err error) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
type advertiser struct{}
|
type advertiser struct{}
|
||||||
|
|
||||||
var Advertiser = &advertiser{}
|
var Advertiser = new(advertiser)
|
||||||
|
|
||||||
// Add 添加广告主
|
// Add 添加广告主
|
||||||
func (c *advertiser) Add(ctx context.Context, req *dto.AddAdvertiserReq) (res *dto.AddAdvertiserRes, err error) {
|
func (c *advertiser) Add(ctx context.Context, req *dto.AddAdvertiserReq) (res *dto.AddAdvertiserRes, err error) {
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import (
|
|||||||
"cidservice/service"
|
"cidservice/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var Application = new(application)
|
||||||
Application = application{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type application struct{}
|
type application struct{}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import (
|
|||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var CID = new(cid)
|
||||||
CID = cid{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type cid struct{}
|
type cid struct{}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import (
|
|||||||
"cidservice/service"
|
"cidservice/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var RateLimit = new(rateLimit)
|
||||||
RateLimit = rateLimit{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type rateLimit struct{}
|
type rateLimit struct{}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
type report struct{}
|
type report struct{}
|
||||||
|
|
||||||
var Report = &report{}
|
var Report = new(report)
|
||||||
|
|
||||||
// Create 创建报表
|
// Create 创建报表
|
||||||
func (c *report) Create(ctx context.Context, req *dto.CreateReportReq) (res *dto.CreateReportRes, err error) {
|
func (c *report) Create(ctx context.Context, req *dto.CreateReportReq) (res *dto.CreateReportRes, err error) {
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import (
|
|||||||
"cidservice/service"
|
"cidservice/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var StatReport = new(statReport)
|
||||||
StatReport = &statReport{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type statReport struct{}
|
type statReport struct{}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import (
|
|||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var Strategy = new(strategy)
|
||||||
Strategy = strategy{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type strategy struct{}
|
type strategy struct{}
|
||||||
|
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -20,8 +20,8 @@ func main() {
|
|||||||
controller.AdPosition,
|
controller.AdPosition,
|
||||||
controller.AdStatistics,
|
controller.AdStatistics,
|
||||||
controller.Report,
|
controller.Report,
|
||||||
//controller.RateLimit,
|
controller.RateLimit,
|
||||||
//controller.Application,
|
controller.Application,
|
||||||
controller.StatReport,
|
controller.StatReport,
|
||||||
})
|
})
|
||||||
select {}
|
select {}
|
||||||
|
|||||||
Reference in New Issue
Block a user