go-blog-service

command module
v0.0.0-...-5fb2406 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 20 Imported by: 0

README

go-blog-service

tech golang blog-service

add auth

vim internal/routers/router.go

- apiv1.Use() //middleware.JWT()
+ apiv1.Use(middleware.JWT()) //middleware.JWT()

get token

$ curl -v -X POST 'http://127.0.0.1:8000/auth' -d 'app_key=test&app_secret=test001'
{"token":"xxx-xxx-xxxx-xxxxx"}
$ curl -v -X GET http://127.0.0.1:8000/api/v1/tags -H 'token: xxx-xxx-xxxx-xxxxx'

tag op

$ curl -v -XPOST 'http://127.0.0.1:8000/api/v1/tags?name=11&state=1&created_by=test'
$ curl -v -XPOST 'http://127.0.0.1:8000/api/v1/tags?name=22&state=1&created_by=test'

$ curl -v '127.0.0.1:8000/api/v1/tags' 

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
internal
dao
pkg
app

Jump to

Keyboard shortcuts

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