mirror of
https://gitee.com/johng/gf
synced 2026-07-02 19:31:07 +08:00
readme update
This commit is contained in:
@ -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(¶ms); 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()
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
并提供了Web服务开发的系列核心组件,如:Router、Cookie、Session、Middleware、服务注册、模板引擎等等,
|
||||
支持热重启、热更新、域名绑定、TLS/HTTPS、Rewrite等特性。
|
||||
|
||||
> 如果您初识`Go`语言,您可以将`GoFrame`类似于`PHP`中的`Laravel`, `Java`中的`SpringBoot`或者`Python`中的`Django`。
|
||||
|
||||
# 特点
|
||||
* 模块化、松耦合设计;
|
||||
|
||||
Reference in New Issue
Block a user