Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature issue #4402 finish router get example #4416

Merged
merged 11 commits into from
Jan 12, 2021

Conversation

changsongl
Copy link
Contributor

@changsongl changsongl commented Jan 6, 2021

This is not finished yet. I just write a quick demo for how to implement this feature for issue #4402. I may have some details to think about, but I just wanna make sure the implementation is ok. I post demo below.

type MyController struct {
	web.Controller
}

func (m MyController) Ping() {
	m.Ctx.Output.Body([]byte("hello world"))
}

func main() {
	web.RouterGet("/ping", MyController.Ping)
	web.Run(":8090")
}

http://127.0.0.1:8090/ping
hello world

@flycash @jianzhiyao

@changsongl changsongl changed the title Feature issue #4402 finish router get example [WIP] Feature issue #4402 finish router get example Jan 6, 2021
@jianzhiyao jianzhiyao requested review from jianzhiyao and flycash and removed request for jianzhiyao January 6, 2021 05:44
@codecov-io
Copy link

codecov-io commented Jan 7, 2021

Codecov Report

Merging #4416 (40d3954) into develop (82164e8) will increase coverage by 0.23%.
The diff coverage is 88.48%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4416      +/-   ##
===========================================
+ Coverage    52.43%   52.66%   +0.23%     
===========================================
  Files          225      225              
  Lines        17237    17344     +107     
===========================================
+ Hits          9038     9135      +97     
- Misses        7272     7278       +6     
- Partials       927      931       +4     
Impacted Files Coverage Δ
server/web/router.go 67.35% <84.33%> (+1.58%) ⬆️
server/web/server.go 14.97% <87.50%> (+5.61%) ⬆️
server/web/namespace.go 59.06% <100.00%> (+11.19%) ⬆️
server/web/session/sess_mem.go 30.58% <0.00%> (+2.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82164e8...40d3954. Read the comment docs.

Copy link
Collaborator

@flycash flycash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@changsongl 我在原来的issue之下comment了一下,你可以看一下。

这个PR其实很不错,不过还可以弄得更好,虽然风险会更大。你可以考虑给我发封邮件,留个微信号,我们可以线下沟通一番。

server/web/router.go Outdated Show resolved Hide resolved
Copy link
Member

@jianzhiyao jianzhiyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked @flycash

server/web/router.go Outdated Show resolved Hide resolved
@flycash flycash linked an issue Jan 10, 2021 that may be closed by this pull request
@changsongl changsongl changed the title [WIP] Feature issue #4402 finish router get example Feature issue #4402 finish router get example Jan 11, 2021
server/web/router.go Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jan 12, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.4% 1.4% Duplication

@flycash flycash merged commit 8cd3acf into beego:develop Jan 12, 2021
@hhstu
Copy link

hhstu commented Feb 24, 2021

什么时间 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSRouter参数提议
5 participants