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

WIP:Write a business demo code use Hertz #75

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

darrenli6
Copy link

What type of PR is this?

feat

What this PR does / why we need it (English/Chinese):

cloudwego/hertz#486 (comment)

Which issue(s) this PR fixes:

cloudwego/hertz#486 (comment)

@darrenli6 darrenli6 requested review from a team as code owners February 1, 2023 03:35
@CLAassistant
Copy link

CLAassistant commented Feb 1, 2023

CLA assistant check
All committers have signed the CLA.

@L2ncE
Copy link
Contributor

L2ncE commented Feb 1, 2023

@li-jin-gou cc

@L2ncE
Copy link
Contributor

L2ncE commented Feb 1, 2023

Can you make your project more complete? Now it seems that you can't see any advantages brought by using casbin.

@L2ncE
Copy link
Contributor

L2ncE commented Feb 1, 2023

It seems that you copied the code in bizdemo/hertz_session directly. Please write the IDL yourself and generate the code through hz. The service that can withdraw the advantages of casbin is defined in the IDL.

@darrenli6
Copy link
Author

Can you make your project more complete? Now it seems that you can't see any advantages brought by using casbin.

Thank you. I'll optimize it

@li-jin-gou
Copy link
Member

I think we should provide a contrib like https://github.com/gofiber/contrib/tree/main/casbin

@li-jin-gou
Copy link
Member

cla need to sign

@darrenli6
Copy link
Author

sign

I think we should provide a contrib like https://github.com/gofiber/contrib/tree/main/casbin

I just saw it now 😁

@li-jin-gou
Copy link
Member

li-jin-gou commented Feb 3, 2023

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

cla need to sign @darrenli6

@L2ncE
Copy link
Contributor

L2ncE commented Feb 3, 2023

  • go mod using github.com/cloudwego/hertz-examples/bizdemo/hertz_casbin
  • Add comments to all public functions. Except for generated code.
  • import using two-stage like below.
    "time"
    "string"
    
    "github.com/..."
  • Change the Chinese in the code to English.
  • CI need to fix.
  • Adapt a casbin middleware for hertz if possible like https://github.com/gofiber/contrib/tree/main/casbin. Or you can raise an issue about casbin in hertz.

@L2ncE
Copy link
Contributor

L2ncE commented Feb 3, 2023

I will carry out the development of casbin extension, please continue to follow up.

@darrenli6
Copy link
Author

I will carry out the development of casbin extension, please continue to follow up.

OK , I can contribute the code for heatz casbin!

@L2ncE
Copy link
Contributor

L2ncE commented Feb 3, 2023

I will carry out the development of casbin extension, please continue to follow up.

OK , I can contribute the code for heatz casbin!

Under development, welcome to participate in the code review at that time.

@darrenli6
Copy link
Author

- name: Lint run: | go vet -stdmethods=false $(go list ./...) go install mvdan.cc/[email protected] test -z "$(gofumpt -l -extra .)"

The above command works fine locally on my mac,but ci reports an error.

@li-jin-gou li-jin-gou added the enhancement New feature or request label Feb 13, 2023
@L2ncE
Copy link
Contributor

L2ncE commented Feb 14, 2023

Hello, the Casbin extension has been released, can you use the Casbin extension to optimize your demo?
https://github.com/hertz-contrib/casbin

@darrenli6
Copy link
Author

Ok

@li-jin-gou
Copy link
Member

Any progress?🥺

@darrenli6
Copy link
Author

I'm sorry I forgot. Try to finish as soon as possible.

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Mar 8, 2023

  1. 解下冲突吧~
  2. hz 最新版本为 v0.6.1,添加了 自定义 "handler_dir"、"model_dir"、"router_dir",从而去掉"biz"目录,并将这些参数持久化到了".hz"中。不知道对该项目的结构是否有优化?
  3. 可以加一个 makefile 来声明 new/update 的时候都用哪些命令~~~

@darrenli6
Copy link
Author

Any progress?🥺

I'm so sorry that recently I have a lot of work and family affairs, which may take a lot of time and cannot be completed in a short time. 🥺 😭

@FGYFFFF FGYFFFF changed the title Write a business demo code use Hertz [WIP]Write a business demo code use Hertz Mar 10, 2023
@FGYFFFF FGYFFFF added the WIP label Mar 10, 2023
@FGYFFFF FGYFFFF changed the title [WIP]Write a business demo code use Hertz WIP:Write a business demo code use Hertz Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP
Development

Successfully merging this pull request may close these issues.

5 participants