Documentation ¶
Index ¶
- Constants
- func LoadLinks() error
- type AuthController
- type CLAController
- type CorporationManagerController
- type CorporationPDFController
- type CorporationSigningController
- func (this *CorporationSigningController) Delete()
- func (this *CorporationSigningController) GetAll()
- func (this *CorporationSigningController) ListDeleted()
- func (this *CorporationSigningController) Post()
- func (this *CorporationSigningController) Prepare()
- func (this *CorporationSigningController) ResendCorpSigningEmail()
- type EmailController
- type EmployeeManagerController
- type EmployeeSigningController
- type IndividualSigningController
- type LinkController
- type OrgRepoController
- type OrgSignatureController
- type VerificationCodeController
Constants ¶
const ( PermissionOwnerOfOrg = "owner of org" PermissionIndividualSigner = "individual signer" PermissionCorpAdmin = "corporation administrator" PermissionEmployeeManager = "employee manager" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthController ¶
type AuthController struct {
// contains filtered or unexported fields
}
func (*AuthController) Auth ¶
func (this *AuthController) Auth()
@Title Auth @Description authentication by user's password of code platform @Param :platform path string true "gitee/github" @Param body body controllers.userAccount true "body for auth on code platform" @Success 201 {object} map @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 error_parsing_api_body: parse payload of request failed @Failure 402 unsupported_code_platform: unsupported code platform @Failure 500 system_error: system error @router /:platform [post]
func (*AuthController) AuthCodeURL ¶
func (this *AuthController) AuthCodeURL()
@Title AuthCodeURL @Description get authentication code url @Param :platform path string true "gitee/github" @Param :purpose path string true "purpose: login, sign" @Success 200 {object} map @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 unsupported_code_platform: unsupported code platform @Failure 402 unkown_purpose_for_auth: unknown purpose parameter @router /authcodeurl/:platform/:purpose [get]
func (*AuthController) Callback ¶
func (this *AuthController) Callback()
@Title Callback @Description callback of authentication by oauth2 @Param :platform path string true "gitee/github" @Param :purpose path string true "purpose: login, sign" @Failure 400 auth_failed: authenticated on code platform failed @Failure 401 unsupported_code_platform: unsupported code platform @Failure 402 refuse_to_authorize_email: the user refused to access his/her email @Failure 403 no_public_email: no public email @Failure 500 system_error: system error @router /:platform/:purpose [get]
func (*AuthController) Prepare ¶
func (this *AuthController) Prepare()
type CLAController ¶
type CLAController struct {
// contains filtered or unexported fields
}
func (*CLAController) Add ¶
func (this *CLAController) Add()
@Title Link @Description link org and cla @Param body body models.OrgCLA true "body for org-repo content" @Success 201 {int} models.OrgCLA @Failure 403 body is empty @router /:link_id/:apply_to [post]
func (*CLAController) Delete ¶
func (this *CLAController) Delete()
@Title Delete CLA @Description delete cla @Param uid path string true "cla id" @Success 204 {string} delete success! @Failure 403 uid is empty @router /:link_id/:apply_to/:language [delete]
func (*CLAController) List ¶
func (this *CLAController) List()
@Title List @Description list clas of link @Param link_id path string true "link id" @Success 200 {string} delete success! @Failure 403 uid is empty @router /:link_id [get]
func (*CLAController) Prepare ¶
func (this *CLAController) Prepare()
type CorporationManagerController ¶
type CorporationManagerController struct {
// contains filtered or unexported fields
}
func (*CorporationManagerController) Auth ¶
func (this *CorporationManagerController) Auth()
@Title authenticate corporation manager @Description authenticate corporation manager @Param body body models.CorporationManagerAuthentication true "body for corporation manager info" @Success 201 {int} map @Failure util.ErrNoCLABindingDoc "no cla binding applied to corporation" @router /auth [post]
func (*CorporationManagerController) Patch ¶
func (this *CorporationManagerController) Patch()
@Title Patch @Description reset password of corporation manager @Param body body dbmodels.CorporationManagerResetPassword true "body for resetting password" @Success 204 {string} "reset password successfully" @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 error_parsing_api_body: parse payload of request failed @Failure 406 same_password: the old and new passwords are same @Failure 407 too_short_or_long_password: the length of new password is too short or long @Failure 408 invalid_password: the format of new password is invalid @Failure 409 corp_manager_does_not_exist: manager may be removed @Failure 410 wrong_old_password: the old password is not correct @Failure 411 frequent_operation: don't operate frequently @Failure 500 system_error: system error @router / [patch]
func (*CorporationManagerController) Prepare ¶
func (this *CorporationManagerController) Prepare()
func (*CorporationManagerController) Put ¶
func (this *CorporationManagerController) Put()
@Title Put @Description add corporation administrator @Param :org_cla_id path string true "org cla id" @Param :email path string true "email of corp" @Success 202 {int} map @Failure util.ErrPDFHasNotUploaded @Failure util.ErrNumOfCorpManagersExceeded @router /:link_id/:email [put]
type CorporationPDFController ¶
type CorporationPDFController struct {
// contains filtered or unexported fields
}
func (*CorporationPDFController) Download ¶
func (this *CorporationPDFController) Download()
@Title Download @Description download pdf of corporation signing @Param :org_cla_id path string true "org cla id" @Param :email path string true "email of corp" @Success 200 {int} map @router /:link_id/:email [get]
func (*CorporationPDFController) Prepare ¶
func (this *CorporationPDFController) Prepare()
func (*CorporationPDFController) Preview ¶
func (this *CorporationPDFController) Preview()
@Title Preview @Description preview the unsinged pdf of corp @Param :org_cla_id path string true "org cla id" @Success 200 {int} map @router /preview/:linkID/:language [get]
func (*CorporationPDFController) Review ¶
func (this *CorporationPDFController) Review()
@Title Review @Description corp administrator review pdf of corporation signing @Success 200 {int} map @router / [get]
func (*CorporationPDFController) Upload ¶
func (this *CorporationPDFController) Upload()
@Title Upload @Description upload pdf of corporation signing @Param :org_cla_id path string true "org cla id" @Param :email path string true "email of corp" @Success 204 {int} map @router /:link_id/:email [patch]
type CorporationSigningController ¶
type CorporationSigningController struct {
// contains filtered or unexported fields
}
func (*CorporationSigningController) Delete ¶
func (this *CorporationSigningController) Delete()
@Title Delete @Description delete corp signing @Param :link_id path string true "link id" @Param :email path string true "corp email" @Success 204 {string} delete success! @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 not_yours_org: the link doesn't belong to your community @Failure 406 unknown_link: unkown link id @Failure 407 no_link: the link id is not exists @Failure 500 system_error: system error @router /:link_id/:email [delete]
func (*CorporationSigningController) GetAll ¶
func (this *CorporationSigningController) GetAll()
@Title GetAll @Description get all the corporations which have signed to a org @Param :link_id path string true "link id" @Success 200 {object} controllers.corpsSigningResult @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 unknown_link: unkown link id @Failure 406 not_yours_org: the link doesn't belong to your community @Failure 500 system_error: system error @router /:link_id [get]
func (*CorporationSigningController) ListDeleted ¶
func (this *CorporationSigningController) ListDeleted()
@Title GetAll @Description get all the corporations which have been deleted @Param :link_id path string true "link id" @Success 200 {object} dbmodels.CorporationSigningBasicInfo @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 unknown_link: unkown link id @Failure 406 not_yours_org: the link doesn't belong to your community @Failure 500 system_error: system error @router /deleted/:link_id [get]
func (*CorporationSigningController) Post ¶
func (this *CorporationSigningController) Post()
@Title Post @Description sign corporation cla @Param :link_id path string true "link id" @Param :cla_lang path string true "cla language" @Param :cla_hash path string true "the hash of cla content" @Param body body models.CorporationSigningCreateOption true "body for signing corporation cla" @Success 201 {string} "sign successfully" @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 error_parsing_api_body: parse input paraemter failed @Failure 402 expired_verification_code: the verification code is expired @Failure 403 wrong_verification_code: the verification code is wrong @Failure 404 not_an_email: the email inputed is wrong @Failure 405 no_link: the link id is not exists @Failure 406 unmatched_cla: the cla hash is not equal to the one of backend server @Failure 407 resigned: the signer has signed the cla @Failure 500 system_error: system error @router /:link_id/:cla_lang/:cla_hash [post]
func (*CorporationSigningController) Prepare ¶
func (this *CorporationSigningController) Prepare()
func (*CorporationSigningController) ResendCorpSigningEmail ¶
func (this *CorporationSigningController) ResendCorpSigningEmail()
@Title ResendCorpSigningEmail @Description resend corp signing email @Param :org_id path string true "org cla id" @Param :email path string true "corp email" @Success 201 {int} map @router /:link_id/:email [post]
type EmailController ¶
type EmailController struct {
// contains filtered or unexported fields
}
func (*EmailController) Auth ¶
func (this *EmailController) Auth()
@Title Auth @Description authorized by org email @router /auth/:platform [get]
func (*EmailController) Get ¶
func (this *EmailController) Get()
@Title Get @Description get auth code url @Param platform path string true "The email platform" @router /authcodeurl/:platform [get]
func (*EmailController) Prepare ¶
func (this *EmailController) Prepare()
type EmployeeManagerController ¶
type EmployeeManagerController struct {
// contains filtered or unexported fields
}
func (*EmployeeManagerController) Delete ¶
func (this *EmployeeManagerController) Delete()
@Title Delete @Description delete employee manager @Param body body models.EmployeeManagerCreateOption true "body for employee manager" @Success 204 {string} delete success! @router / [delete]
func (*EmployeeManagerController) GetAll ¶
func (this *EmployeeManagerController) GetAll()
@Title GetAll @Description get all employee managers @Success 200 {object} dbmodels.CorporationManagerListResult @router / [get]
func (*EmployeeManagerController) Post ¶
func (this *EmployeeManagerController) Post()
@Title Post @Description add employee managers @Param body body models.EmployeeManagerCreateOption true "body for employee manager" @Success 201 {int} map @router / [post]
func (*EmployeeManagerController) Prepare ¶
func (this *EmployeeManagerController) Prepare()
type EmployeeSigningController ¶
type EmployeeSigningController struct {
// contains filtered or unexported fields
}
func (*EmployeeSigningController) Delete ¶
func (this *EmployeeSigningController) Delete()
@Title Delete @Description delete employee signing @Param :email path string true "email" @Success 204 {string} delete success! @router /:email [delete]
func (*EmployeeSigningController) GetAll ¶
func (this *EmployeeSigningController) GetAll()
@Title GetAll @Description get all the employees @Success 200 {object} dbmodels.IndividualSigningBasicInfo @Failure 400 missing_token: token is missing @Failure 401 unknown_token: token is unknown @Failure 402 expired_token: token is expired @Failure 403 unauthorized_token: the permission of token is unmatched @Failure 500 system_error: system error @router / [get]
func (*EmployeeSigningController) List ¶
func (this *EmployeeSigningController) List()
@Title List @Description get all the employees by community manager @Param :link_id path string true "link id" @Param :email path string true "the email of corp" @Success 200 {object} dbmodels.IndividualSigningBasicInfo @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 unknown_link: unkown link id @Failure 406 not_yours_org: the link doesn't belong to your community @Failure 500 system_error: system error @router /:link_id/:email [get]
func (*EmployeeSigningController) Post ¶
func (this *EmployeeSigningController) Post()
@Title Post @Description sign employee cla @Param :link_id path string true "link id" @Param :cla_lang path string true "cla language" @Param :cla_hash path string true "the hash of cla content" @Param body body models.EmployeeSigning true "body for individual signing" @Success 201 {string} "sign successfully" @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 error_parsing_api_body: parse payload of request failed @Failure 406 unmatched_email: the email is not same as the one which signer sets on the code platform @Failure 407 unmatched_user_id: the user id is not same as the one which was fetched from code platform @Failure 408 expired_verification_code: the verification code is expired @Failure 409 wrong_verification_code: the verification code is wrong @Failure 410 no_link: the link id is not exists @Failure 411 no_employee_manager: there is not any employee managers for the corresponding corp @Failure 412 unmatched_cla: the cla hash is not equal to the one of backend server @Failure 413 resigned: the signer has signed the cla @Failure 500 system_error: system error @router /:link_id/:cla_lang/:cla_hash [post]
func (*EmployeeSigningController) Prepare ¶
func (this *EmployeeSigningController) Prepare()
func (*EmployeeSigningController) Update ¶
func (this *EmployeeSigningController) Update()
@Title Update @Description enable/unable employee signing @Param :email path string true "email" @Success 202 {int} map @router /:email [put]
type IndividualSigningController ¶
type IndividualSigningController struct {
// contains filtered or unexported fields
}
func (*IndividualSigningController) Check ¶
func (this *IndividualSigningController) Check()
@Title Check @Description check whether contributor has signed cla @Param platform path string true "code platform" @Param org_repo path string true "org:repo" @Param email query string true "email of contributor" @Success 200 {object} map @Failure 400 no_link: there is not link for this org and repo @Failure 500 system_error: system error @router /:platform/:org_repo [get]
func (*IndividualSigningController) List ¶
func (this *IndividualSigningController) List()
@Title List @Description get all the individuals by community manager @Param :link_id path string true "link id" @Success 200 {object} dbmodels.IndividualSigningBasicInfo @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 unknown_link: unkown link id @Failure 406 not_yours_org: the link doesn't belong to your community @Failure 500 system_error: system error @router /:link_id [get]
func (*IndividualSigningController) Post ¶
func (this *IndividualSigningController) Post()
@Title Post @Description sign individual cla @Param :link_id path string true "link id" @Param :cla_lang path string true "cla language" @Param :cla_hash path string true "the hash of cla content" @Param body body dbmodels.IndividualSigningInfo true "body for individual signing" @Success 201 {string} "sign successfully" @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 405 error_parsing_api_body: parse payload of request failed @Failure 406 unmatched_email: the email is not same as the one which signer sets on the code platform @Failure 407 unmatched_user_id: the user id is not same as the one which was fetched from code platform @Failure 408 unmatched_cla: the cla hash is not equal to the one of backend server @Failure 409 resigned: the signer has signed the cla @Failure 410 no_link: the link id is not exists @Failure 411 go_to_sign_employee_cla: should sign employee cla instead @Failure 500 system_error: system error @router /:link_id/:cla_lang/:cla_hash [post]
func (*IndividualSigningController) Prepare ¶
func (this *IndividualSigningController) Prepare()
type LinkController ¶
type LinkController struct {
// contains filtered or unexported fields
}
func (*LinkController) GetCLAForSigning ¶
func (this *LinkController) GetCLAForSigning()
@Title GetCLAForSigning @Description get signing page info @Param :platform path string true "code platform" @Param :org_id path string true "org" @Param :apply_to path string true "apply to" @Success 201 {int} map @Failure util.ErrNoCLABindingDoc "this org/repo has not been bound any clas" @Failure util.ErrNotReadyToSign "the corp signing is not ready" @router /:platform/:org_id/:apply_to [get]
func (*LinkController) Link ¶
func (this *LinkController) Link()
@Title Link @Description link org and cla @Param body body models.LinkCreateOption true "body for creating link" @Success 201 {string} "create org cla successfully" @router / [post]
func (*LinkController) ListLinks ¶
func (this *LinkController) ListLinks()
@Title ListLinks @Description list all links @Success 200 {object} dbmodels.LinkInfo @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 500 system_error: system error @router / [get]
func (*LinkController) Prepare ¶
func (this *LinkController) Prepare()
func (*LinkController) Unlink ¶
func (this *LinkController) Unlink()
@Title Unlink @Description unlink cla @Param uid path string true "The uid of binding" @Success 204 {string} delete success! @Failure 403 uid is empty @router /:link_id [delete]
type OrgRepoController ¶
type OrgRepoController struct {
// contains filtered or unexported fields
}
func (*OrgRepoController) Check ¶
func (org *OrgRepoController) Check()
@Title Check @Description check whether the repo exists @Param :org path string true "org" @Param :repo path string true "repo" @Success 200 {string} map @Failure 400 missing_url_path_parameter: missing url path parameter @Failure 401 missing_token: token is missing @Failure 402 unknown_token: token is unknown @Failure 403 expired_token: token is expired @Failure 404 unauthorized_token: the permission of token is unmatched @Failure 500 system_error: system error @router /:org/:repo [get]
func (*OrgRepoController) List ¶
func (org *OrgRepoController) List()
@Title List @Description get all orgs @Success 200 {string} list @Failure 400 missing_token: token is missing @Failure 401 unknown_token: token is unknown @Failure 402 expired_token: token is expired @Failure 403 unauthorized_token: the permission of token is unmatched @Failure 500 system_error: system error @router / [get]
func (*OrgRepoController) Prepare ¶
func (org *OrgRepoController) Prepare()
type OrgSignatureController ¶
type OrgSignatureController struct {
// contains filtered or unexported fields
}
func (*OrgSignatureController) BlankSignature ¶
func (this *OrgSignatureController) BlankSignature()
@Title BlankSignature @Description get blank pdf of org signature @Param language path string true "The language which the signature applies to" @router /blank/:language [get]
func (*OrgSignatureController) Get ¶
func (this *OrgSignatureController) Get()
@Title Get @Description download org signature @Param org_cla_id path string true "org cla id" @router /:link_id/:language [get]
func (*OrgSignatureController) Prepare ¶
func (this *OrgSignatureController) Prepare()
type VerificationCodeController ¶
type VerificationCodeController struct {
// contains filtered or unexported fields
}
func (*VerificationCodeController) Post ¶
func (this *VerificationCodeController) Post()
@Title Post @Description send verification code when signing @Param :org_cla_id path string true "org cla id" @Param :email path string true "email of corp" @Success 201 {int} map @Failure util.ErrSendingEmail @router /:link_id/:email [post]
func (*VerificationCodeController) Prepare ¶
func (this *VerificationCodeController) Prepare()
Source Files ¶
- access-controller.go
- auth_on_code_platform.go
- auth_on_corp_manager.go
- base-controller.go
- cla.go
- corporation-manager.go
- corporation-pdf.go
- corporation-signing.go
- employee-manager.go
- employee-signing.go
- error.go
- individual-signing.go
- link.go
- org-email.go
- org-repo.go
- org-signature.go
- util.go
- verification_code.go