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

将github项目导入到平台中 #309

Open
Darkone0 opened this issue Mar 17, 2020 · 8 comments
Open

将github项目导入到平台中 #309

Darkone0 opened this issue Mar 17, 2020 · 8 comments
Labels
2.0 database task about database webserver webserver task

Comments

@Darkone0
Copy link
Contributor

API: POST: /v1/projects/add

Param:
{
	“projectName” : string ,
	“projectCoverUrl” : string,
	“introdection” : string,
	“githubUrl” : string,
 	“decideType” : int//数据库需增加
}
@Darkone0
Copy link
Contributor Author

role : 已注册用户

@Darkone0 Darkone0 added 2.0 webserver webserver task database task about database labels Mar 17, 2020
@Guibeen
Copy link
Contributor

Guibeen commented Mar 21, 2020

let me fix this issue

@Guibeen
Copy link
Contributor

Guibeen commented Mar 21, 2020

首先到Cookie判断是否是注册用户
定义一个project结构体
定义一个controller,并注册对应路由
在controller里,用c.BINDJSON方法,将接收到的数据解析为结构体,然后存到k_project中

@Guibeen
Copy link
Contributor

Guibeen commented Mar 21, 2020

Param里应该是"introdection"还是"introduction"?

@zhang2j
Copy link
Contributor

zhang2j commented Mar 21, 2020

  1. 应该是 introduction
  2. 这个任务中有很多子问题还没有完成,比如判断url是否合法、用户是否有权限导入该项目等,这些可以先不实现,但要在controller里的适当位置加上TODO。
  3. jwt已经实现,可以从cookie中的jwt字段中获取已登录用户的信息。具体的解析jwt的函数可以参考service/jwt.go。

@Guibeen
Copy link
Contributor

Guibeen commented Mar 22, 2020

这里是不是判断是否登录就可以了?
因为role是已注册用户,而登陆了肯定是已注册用户

@zhang2j
Copy link
Contributor

zhang2j commented Mar 22, 2020

你可以看看router里的v1路由组,把api放在v1路由组里可以使用v1路由组的jwt中间件判断是否登录。

@Guibeen
Copy link
Contributor

Guibeen commented Mar 22, 2020

好的

Guibeen added a commit to Guibeen/Kcoin-Golang that referenced this issue Mar 22, 2020
zhang2j added a commit that referenced this issue Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 database task about database webserver webserver task
Projects
None yet
Development

No branches or pull requests

3 participants