Conversation
Summary of ChangesHello @JavaPythonAIForBAT, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求主要增强了企业CLA(贡献者许可协议)管理系统的功能。它引入了一个新的API端点和相应的后端逻辑,允许社区管理员修改已签署企业CLA的法人授权代表的姓名和邮箱。此外,为了提升数据检索效率,企业签署列表页面现在支持通过授权代表的邮箱或企业名称进行模糊搜索。这些改进旨在提高企业CLA管理的灵活性和用户体验。 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| return | ||
| } | ||
| adminAdded, sizeErr := ctl.GetBool("admin_added", false) | ||
| searchQuery := ctl.GetString("search") // 新增搜索参数 |
| Date string `json:"date"` | ||
| } | ||
|
|
||
| // models/corp_signing.go |
signing/adapter/corp_signing.go
Outdated
| // 验证参数 | ||
| if opt.RepName == "" || opt.RepEmail == "" { | ||
| return toModelError(errors.New("representative name and email are required")) | ||
| } | ||
|
|
||
| // 验证邮箱格式 | ||
| if _, err := dp.NewEmailAddr(opt.RepEmail); err != nil { | ||
| return toModelError(err) | ||
| } | ||
|
|
||
| // 调用service层更新 | ||
| err := adapter.s.UpdateRepresentative(userId, linkID, signingID, opt.RepName, opt.RepEmail) | ||
| return toModelError(err) |
There was a problem hiding this comment.
这部分验证逻辑是多余的。RepresentativeUpdateOption 结构体已经有了 valid 标签(Required, Email),这些标签应该由控制器中的 ctl.fetchInputPayload 来处理。在此处重复验证可能导致维护问题。请移除此代码块,并依赖于控制器层的验证。此外,这里的注释是中文,也应改为英文。
// Call the service layer to update. Input validation is handled in the controller.
err := adapter.s.UpdateRepresentative(userId, linkID, signingID, opt.RepName, opt.RepEmail)
return toModelError(err)| } | ||
|
|
||
| func (s *corpSigningService) UpdateRepresentative(userId, linkID, signingID, repName, repEmail string) error { | ||
| // 权限验证 - 只有社区管理员可以操作 |
| } | ||
|
|
||
| func (impl *corpSigning) FindPage(linkId string, intPage, intPageSize int, adminAdded bool) (repository.CorpSigningSummaryPage, error) { | ||
| // 邮箱验证辅助函数 |
| filter[childField(fieldRep, fieldEmail)] = searchQuery | ||
| } else { | ||
| // 按企业名称搜索(模糊匹配) | ||
| filter[childField(fieldCorp, fieldName)] = bson.M{"$regex": searchQuery, "$options": "i"} |
| return err | ||
| } | ||
|
|
||
| // 构建更新文档 |
|
commit合并为一个 |
CLA Signature Guide@JavaPythonAIForBAT , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
2f3e96b to
d9cb199
Compare
CLA Signature Guide@JavaPythonAIForBAT , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
d9cb199 to
fc4ec3b
Compare
CLA Signature Guide@JavaPythonAIForBAT , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
fc4ec3b to
eda9a3d
Compare
CLA Signature Guide@JavaPythonAIForBAT , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
|
commit合并成一个 |
eda9a3d to
022f1fa
Compare
CLA Signature Guide@JavaPythonAIForBAT , thanks for your pull request. The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
To sign CLA, click here. To check if your email is configured correctly, refer to the FAQs. Once you've signed the CLA or updating your email, please comment |
CLA支持修改企业法人的授权代表和邮箱