note

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

笔记接口

添加

POST /note

Param

Return

  • code (int) 请求返回码,一般0表示正常,非0表示异常
  • msg (string) 信息,一般是出错时的描述信息
  • data (object)
    • id (int) 新纪录ID
Param
{}
Return
{
    "code": 0,
    "msg": "",
    "data": {
        "id": 16
    },
    "requestID": "35eb9d01-0431-4fd0-a7b2-d67c7c87b699"
}

修改

PUT /note

Param

  • noteID (int) 记录ID
  • title (string) 标题
  • detail (string) 详情

Return

  • code (int) 请求返回码,一般0表示正常,非0表示异常
  • msg (string) 信息,一般是出错时的描述信息
Param
{
    "noteID": 16,
    "title": "mod title",
    "detail": "mod detail"
}
Return
{
    "code": 0,
    "msg": "",
    "data": null,
    "requestID": "adfc0af1-6735-42c1-b5be-b67983ffe199"
}

获取分页

GET /note/page

Param

  • title (string) 标题
  • detail (string) 详情
  • beginTime (int64) 开始时间
  • endTime (int64) 结束时间
  • pageIndex (int) 分页开始
  • pageSize (int) 分页大小

Return

  • code (int) 请求返回码,一般0表示正常,非0表示异常
  • msg (string) 信息,一般是出错时的描述信息
  • data (object)
    • total (int) 总数
    • list (object list) 列表
      • noteID (int) 笔记ID
      • userName (string) 用户名
      • title (string) 标题
      • detail (string) 详情
      • createdAt (int64) 创建时间
Param
beginTime=0&detail=&endTime=0&pageIndex=0&pageSize=10&title=
Return
{
    "code": 0,
    "msg": "",
    "data": {
        "total": 16,
        "list": [
            {
                "noteID": 16,
                "userName": "0",
                "title": "mod title",
                "detail": "mod detail",
                "createdAt": 1597493300
            },
            {
                "noteID": 15,
                "userName": "0",
                "title": "",
                "detail": "",
                "createdAt": 1597493299
            },
            {
                "noteID": 14,
                "userName": "0",
                "title": "",
                "detail": "testDetail",
                "createdAt": 1597493299
            },
            {
                "noteID": 13,
                "userName": "0",
                "title": "mod title",
                "detail": "mod detail",
                "createdAt": 1597490651
            },
            {
                "noteID": 12,
                "userName": "0",
                "title": "",
                "detail": "",
                "createdAt": 1597490650
            },
            {
                "noteID": 11,
                "userName": "0",
                "title": "",
                "detail": "testDetail",
                "createdAt": 1597490650
            },
            {
                "noteID": 10,
                "userName": "0",
                "title": "mod title",
                "detail": "mod detail",
                "createdAt": 1597488159
            },
            {
                "noteID": 9,
                "userName": "0",
                "title": "",
                "detail": "",
                "createdAt": 1597481727
            },
            {
                "noteID": 8,
                "userName": "0",
                "title": "",
                "detail": "testDetail",
                "createdAt": 1597481727
            },
            {
                "noteID": 7,
                "userName": "0",
                "title": "mod title",
                "detail": "mod detail",
                "createdAt": 1597481724
            }
        ]
    },
    "requestID": "e5e4051e-4931-452b-8fe9-ae68c4833306"
}

获取详情

GET /note

Param

  • noteID (int)

Return

  • code (int) 请求返回码,一般0表示正常,非0表示异常
  • msg (string) 信息,一般是出错时的描述信息
  • data (object)
    • noteID (int) 笔记ID
    • userName (string) 用户名
    • title (string) 标题
    • detail (string) 详情
    • createdAt (int64) 创建时间
Param
noteID=16
Return
{
    "code": 0,
    "msg": "",
    "data": {
        "noteID": 16,
        "userName": "1",
        "title": "mod title",
        "detail": "mod detail",
        "createdAt": 1597493300
    },
    "requestID": "2cd4bdba-f45e-4a53-9ab0-d636e71bfff3"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {

	// 频率限制
	Limiter route.Limiter `rate:"Rate(0.25, 2)"`
	// contains filtered or unexported fields
}

Note 笔记

func (*Note) Add

func (n *Note) Add(ctx context.Context, p route.Param) (res route.Result, err error)

Add 添加

func (*Note) Del

func (n *Note) Del(ctx context.Context, p route.Param) (res route.Result, err error)

Del 删除

func (*Note) Get

func (n *Note) Get(ctx context.Context, p route.Param) (res route.Result, err error)

Get 获取

func (*Note) GetPage

func (n *Note) GetPage(ctx context.Context, p route.Param) (res route.Result, err error)

GetPage 获取分页

func (*Note) Mod

func (n *Note) Mod(ctx context.Context, p route.Param) (res route.Result, err error)

Mod 修改

Jump to

Keyboard shortcuts

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