readme update

This commit is contained in:
John
2020-04-29 19:33:14 +08:00
parent 8a13d94526
commit 938c46fec9
3 changed files with 9 additions and 79 deletions

View File

@ -1,92 +1,20 @@
package main
import (
"github.com/gogf/gf/errors/gerror"
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
// ListsInput ListsInput
type ListsInput struct {
Page int `v:"min:1#page不能小于1"`
Limit int `v:"between:10,100#limit必须是10-100之间的整数"`
Search
}
type ListRequest struct {
ListsInput
}
// Search Search
type Search struct {
GoodsName string
GoodsSource string
FreeShipping string
MarketPrice struct {
Min int
Max int
IsInclude bool
}
GuidePrice struct {
Min int
Max int
IsInclude bool
}
AgreementPrice struct {
Min int
Max int
IsInclude bool
}
NormalProfitMargin struct {
Min int
Max int
IsInclude bool
}
ActivityProfitMargin struct {
Min int
Max int
IsInclude bool
}
Sales struct {
Cycle string
Quantity struct {
Min int
Max int
IsInclude bool
}
}
SalesReturn struct {
Cycle string
Quantity struct {
Min int
Max int
IsInclude bool
}
}
ChooseGoods struct {
Cycle string
Quantity struct {
Min int
Max int
IsInclude bool
}
}
}
// Lists Lists
func Lists(r *ghttp.Request) {
var params *ListRequest
if err := r.Parse(&params); err != nil {
r.Response.WriteExit(gerror.Stack(err))
}
r.Response.Write(params)
}
func main() {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.POST("/test", Lists)
group.ALL("/", func(r *ghttp.Request) {
fmt.Println(r.GetBodyString())
fmt.Println(r.Header)
r.Response.Write(r.GetBodyString())
r.Response.Write(r.Header)
})
})
s.SetPort(8199)
s.Run()

View File

@ -15,6 +15,7 @@ cache, logging, containers, timer, resource, validator, database orm, etc.
Supporting web server integrated with router, cookie, session, middleware, logger, configure,
template, https, hooks, rewrites and many more features.
> If you're a newbie to `Go`, you may consider `GoFrame` easy and great as `Laravel` in `PHP`, `SpringBoot` in `Java` or `Django` in `Python`.
# Installation
```

View File

@ -15,6 +15,7 @@
并提供了Web服务开发的系列核心组件Router、Cookie、Session、Middleware、服务注册、模板引擎等等
支持热重启、热更新、域名绑定、TLS/HTTPS、Rewrite等特性。
> 如果您初识`Go`语言,您可以将`GoFrame`类似于`PHP`中的`Laravel`, `Java`中的`SpringBoot`或者`Python`中的`Django`。
# 特点
* 模块化、松耦合设计;